Repository navigation
Conversation
One owner-only JSON file per conversation under <config>/chats/<account-key>/, listed newest first, with create/read/update/delete endpoints behind the existing session guard. Chats never go to the coordinator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014XvdYnpnYBSTkq2tBgQTA3
The AI chat now lists previous conversations (newest first) under the AI chat entry, saves after every question and answer, reopens a chat with its model, and offers New chat / delete. A reply that arrives after switching chats is stored in the chat it belongs to. Also tolerate job status responses without lifecycle events (older coordinators) instead of failing the request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014XvdYnpnYBSTkq2tBgQTA3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014XvdYnpnYBSTkq2tBgQTA3
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c155c7f02
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| s.status==="running"?(lastWorker?t("workingNamed",{worker:lastWorker}):t("working")):pendingText.textContent; | ||
| setPendingDots(pendingLine,busy); | ||
| pendingTimeline.replaceChildren(...s.events.map(e=>{const{text,cls}=eventLabel(e); | ||
| pendingTimeline.replaceChildren(...(s.events||[]).map(e=>{const{text,cls}=eventLabel(e); |
There was a problem hiding this comment.
Guard the remaining events read for older coordinators
When a coordinator returns job status without events, renderPending() still spreads s.events before reaching this fallback, so the status poll throws and the request falls into the error path instead of displaying the answer. Apply the empty-list fallback to that earlier read too.
Useful? React with 👍 / 👎.
| if(s.status==="failed"||s.status==="cancelled"){setPendingDots(pendingLine,false);pendingText.textContent=t("noAnswer",{reason:s.error||s.status});refreshMe();return}} | ||
| setPendingDots(pendingLine,false);pendingText.textContent=t("tooLong")} | ||
| catch(e){setPendingDots(pendingLine,false);pendingText.textContent=t("error")+": "+e.message;state.ai.pop()}} | ||
| catch(e){setPendingDots(pendingLine,false);pendingText.textContent=t("error")+": "+e.message;conv.messages.pop();saveChat(conv,model)}} |
There was a problem hiding this comment.
Keep submitted prompts when status polling fails
If the job was accepted but a later status poll fails temporarily, this catch removes the prompt from the conversation and saves the shorter history; if it was the chat’s only prompt, the chat is deleted. The job may still complete and consume credits, leaving the user without the submitted question in local history.
Useful? React with 👍 / 👎.
What
The AI chat in the desktop app used to live only in browser memory, so a reload lost everything. Now every conversation is saved locally by the app and can be reopened and continued.
projectzero/chats.py(ChatStore): one JSON file per chat under<config>/chats/<account-key>/<id>.json. Files are 0600 and dirs 0700, writes go through an atomic replace, and ids are validated (^[0-9a-f]{16}$, so paths can't traverse). Corrupt files are skipped.GET/POST /local/chats,GET/PUT/DELETE /local/chats/{id}. They return 409 when not signed in, 404 for unknown ids and 422 for bad bodies (role must be user/assistant, at most 500 messages, content up to 100k chars).events(older coordinator) no longer breaks the request with "s.events is undefined".Tests
tests/test_chats.pycovers the store: roundtrip, ordering, account isolation, invalid ids and traversal, corrupt files, title trimming, permissions.tests/test_client_app.py::test_chat_history_endpointscovers the endpoints: auth, 404/422 cases, account isolation across logout/login, delete.pytest -q -m "not slow": 262 passed, 3 skipped.scripts/check_public_tree.py: 0 findings.projectzero demo: ask twice, reload, reopen, continue, new chat, delete. No page errors, and the files on disk hold the expected message counts.🤖 Generated with Claude Code
https://claude.ai/code/session_014XvdYnpnYBSTkq2tBgQTA3