Conversation
Greptile SummaryThis PR implements abort-recovery persistence for chat sessions: streamed assistant text and reasoning are buffered in a new Key points:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Client JS
participant S as LiveChatService
participant DB as SessionStore
C->>S: chat.send { text }
S->>S: Insert ActiveAssistantDraft into active_partial_assistant
S->>DB: append user_message
loop Streaming
S-->>C: chat delta events
S->>S: draft.append_text / set_reasoning
end
S->>DB: append assistant_tool_call_frame
S->>DB: append tool_result
C->>S: chat.abort { sessionKey }
S->>S: resolve_session_key_for_run
S->>S: abort_run_handle — AbortHandle.abort, task dropped at current await
S->>S: persist_partial_assistant_on_abort
alt Draft has visible content
S->>DB: append partial_assistant_message
S->>DB: count session
S-->>C: broadcast state=aborted with partialMessage and messageIndex
else No visible content
S-->>C: broadcast state=aborted no partial
end
S->>S: Remove active_thinking_text, active_tool_calls, active_reply_medium
C->>C: handleChatAborted
C->>C: cacheSessionHistoryMessage
C->>C: bumpSessionCount if new messageIndex
C->>C: Update DOM with partial content
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1846476007
ℹ️ 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".
Address PR #418 review feedback for abort recovery and tool history persistence.
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbea499657
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4602943de1
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01bb8a0a2e
ℹ️ 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".
The switchInProgress guard added in #418 drops delta and tool_call_end events during session initialization. This test was not updated to call waitForChatSessionReady(), so the delta event was silently dropped and the assistant message never rendered. Entire-Checkpoint: 093cf8daea5f
* feat(skills): support safe agent-written sidecar files * test(sandbox): make off-mode test deterministic * fix(tools): address PR #413 review feedback for skill sidecar files - Anchor confinement check to canonical skills root, not the skill dir itself, preventing symlinked skill roots from bypassing path checks - Validate no symlinks in ancestry before create_dir_all to prevent out-of-tree directory creation via symlinked intermediates - Add rollback of previously written files when a batch fails mid-way - Surface audit log I/O failures via tracing::warn instead of silently swallowing them - Add minItems/maxItems to the JSON schema so the LLM sees file count limits upfront - Add tests for symlinked skill root rejection and batch rollback Entire-Checkpoint: 916a7838ac8e * test(web): wait for session ready before injecting tool events in e2e The switchInProgress guard added in #418 drops delta and tool_call_end events during session initialization. This test was not updated to call waitForChatSessionReady(), so the delta event was silently dropped and the assistant message never rendered. Entire-Checkpoint: 093cf8daea5f
* fix(chat): persist aborted partial history * test(web): wait for chat session state before websocket injections * fix(chat): close abort history review gaps * test(web): make voice fallback rpc failure deterministic * fix(chat): wait for pending tool history on abort
* feat(skills): support safe agent-written sidecar files * test(sandbox): make off-mode test deterministic * fix(tools): address PR #413 review feedback for skill sidecar files - Anchor confinement check to canonical skills root, not the skill dir itself, preventing symlinked skill roots from bypassing path checks - Validate no symlinks in ancestry before create_dir_all to prevent out-of-tree directory creation via symlinked intermediates - Add rollback of previously written files when a batch fails mid-way - Surface audit log I/O failures via tracing::warn instead of silently swallowing them - Add minItems/maxItems to the JSON schema so the LLM sees file count limits upfront - Add tests for symlinked skill root rejection and batch rollback Entire-Checkpoint: 916a7838ac8e * test(web): wait for session ready before injecting tool events in e2e The switchInProgress guard added in #418 drops delta and tool_call_end events during session initialization. This test was not updated to call waitForChatSessionReady(), so the delta event was silently dropped and the assistant message never rendered. Entire-Checkpoint: 093cf8daea5f
* fix(chat): persist aborted partial history * test(web): wait for chat session state before websocket injections * fix(chat): close abort history review gaps * test(web): make voice fallback rpc failure deterministic * fix(chat): wait for pending tool history on abort
Summary
chat.abortso interrupted runs keep the visible assistant text and reasoning in session historyFixes #186.
Validation
Completed
cargo test -p moltis-chat abort_persists_partial_stream_and_followup_reuses_it -- --nocapturecargo test -p moltis-chat send_sync_persists_tool_call_assistant_frames_for_history_replay -- --nocapturebiome check --write crates/web/src/assets/js/websocket.js crates/web/ui/e2e/specs/chat-abort.spec.jscd crates/web/ui && ./build.shcargo +nightly-2025-11-30 fmt --all -- --checkcargo +nightly-2025-11-30 build --bin moltiscd crates/web/ui && MOLTIS_BINARY=/Users/penso/.superset/worktrees/moltis/issue-186/target/debug/moltis npx playwright test e2e/specs/chat-abort.spec.jscargo +nightly-2025-11-30 clippy -p moltis-chat --all-features --tests -- -D warningsRemaining
cargo +nightly-2025-11-30 clippy -Z unstable-options --workspace --all-features --all-targets --timings -- -D warningsblocked locally because
llama-cpp-sys-2configuresGGML_CUDA=ONand this host does not have a CUDA toolkit availableManual QA
continue.