Repository navigation
feat(native-chat): keep restart recovery available in status bar - #21397
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe restart-resume host now preserves unread, unreadable, and eligible claimed markers during teardown. It removes offers when a chat recovers through a hold. The modal uses shared stores to separate snoozing from explicit dismissal. A status-bar segment displays remaining restart candidates and reopens the modal. Tests cover persistence, recovery, dismissal, store state, feature gating, and status-bar rendering. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to A transient host-read failure can hide recovery offers until relaunch, and a later refresh failure can show candidates the host no longer confirms. These issues should be fixed before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Remove continued sessions from the shared candidate… · NativeChatResumeOnRestartModal.tsx:252
src/renderer/src/components/NativeChatResumeOnRestartModal.tsx:252
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRemove continued sessions from the shared candidate snapshot.
When
restartContinuesucceeds, this path closes the modal but does not updatecandidatesor the status-bar store. The continued sessions therefore remain in both candidate snapshots.Mirror the
resumeremaining-candidate update before resolving the modal.Proposed fix
}>(LOCAL, 'agentSession.restartContinue', { sessionIds }) + const settled = new Set(result.continued.map((entry) => entry.sessionId)) + const remaining = candidates.filter((candidate) => !settled.has(candidate.sessionId)) announceRestartResults(sessionIds, result.continued, 'continue') + setCandidates(remaining) + setNativeChatResumeOnRestartCandidates(remaining) setResolved(true) @@ - [persistPreference] + [candidates, persistPreference]
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 63f54f13-435c-428b-b9ac-0f446a746b4d
📒 Files selected for processing (9)
src/main/native-chat/agent-session-wire/structured-agent-session-restart-claim.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.tssrc/main/runtime/rpc/methods/structured-agent-session-restart-resume.tssrc/renderer/src/components/NativeChatResumeOnRestartModal.test.tsxsrc/renderer/src/components/NativeChatResumeOnRestartModal.tsxsrc/renderer/src/components/native-chat-resume-on-restart-store.tssrc/renderer/src/components/status-bar/NativeChatResumeStatusSegment.test.tsxsrc/renderer/src/components/status-bar/NativeChatResumeStatusSegment.tsxsrc/renderer/src/components/status-bar/StatusBarSurface.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| consumeNativeChatResumeOnRestartDialogRequest() | ||
| setResolved(false) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '130,310p' src/renderer/src/components/NativeChatResumeOnRestartModal.tsx
sed -n '90,155p' src/renderer/src/components/NativeChatResumeOnRestartModal.test.tsxRepository: stablyai/orca
Length of output: 8935
🏁 Script executed:
printf '%s\n' '--- modal state and handlers ---'
sed -n '1,145p' src/renderer/src/components/NativeChatResumeOnRestartModal.tsx
printf '%s\n' '--- modal tests around reopen/status behavior ---'
rg -n -C 8 'reopen|openRequested|resume|Not now|snapshot|status' src/renderer/src/components/NativeChatResumeOnRestartModal.test.tsx
printf '%s\n' '--- snapshot API bindings ---'
rg -n -C 6 'setNativeChatResumeOnRestartCandidates|consumeNativeChatResumeOnRestartDialogRequest|getNativeChatResumeOnRestartSnapshot|openRequested' src/renderer/srcRepository: stablyai/orca
Length of output: 34594
Do not reapply the initial offer when reopening the dialog.
After a partial successful resume, the settled sessions are removed from local and shared candidates, but resolved remains false while candidates remain. Snoozing then reopening sets resolved to false and reruns the loading effect. Because launchOffer.current contains the original offer, the effect restores settled sessions to both candidate lists.
Load and apply the launch offer only when structured chat becomes enabled. Do not make the loading effect depend on resolved.
Proposed fix
- if (!structuredEnabled || resolved) {
+ if (!structuredEnabled) {
return
@@
- }, [resolved, structuredEnabled])
+ }, [structuredEnabled])There was a problem hiding this comment.
Important
Two behavioral issues found and reproduced: a stale claimed marker can overwrite the fresh teardown marker for the same session, and reopening the dialog from the status bar after a partial reconnect resurrects already-settled candidates (inflating the status-bar count).
Reviewed changes
- Status-bar recovery segment — a new
NativeChatResumeStatusSegmentshows the remaining reconnect count and reopens the existing resume dialog through a shared external store. - Snooze vs. dismiss — closing the dialog ("Not now") is now a non-destructive snooze; a new "Dismiss all" button is the only path that spends the host claim via
agentSession.restartResumableDismiss. - Teardown carries unconsumed claims —
recordMarkersmerges claimed launch markers into the persisted set so a second orderly quit does not lose the offer. - Shared renderer store —
native-chat-resume-on-restart-store.tsbacks both the modal and the status segment.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…t on recovery Closing the reconnect dialog spent the durable recovery offer, so looking around before deciding lost the recovery for good. The offer now survives a close, and the status bar carries it — but a durable offer needs a way to die, and it only had a reconnect, an explicit dismiss, and a 24h expiry. The claim's launch-scoped lifecycle moves into its own collaborator, which splits what the host ADVERTISES from the evidence it holds. A resume-capable hold that hands a marked chat its provider child back is the recovery the offer existed to perform, so it stops being advertised and stops being written back at quit, while the marker stays valid evidence — a user who reopened a chat can still ask the agent to carry on. Teardown re-derives the snoozed offer rather than round-tripping raw markers, and this teardown's own witness now outranks the stale claim for the same chat instead of being overwritten by it, which was silently persisting an old turn id and making the next launch refuse the chat that was actually mid-turn. On the renderer the candidate list gets its own producer against agentSession.restartResumable, so the status entry and the dialog read one host-owned answer instead of the dialog pushing its local state at a sibling. The entry re-reads the host before reopening, so a reopened list can never name a chat the host would now refuse; dialog open becomes the external one-shot request rather than a flag mirrored into render state, which is what let a reopen replay the launch answer and re-offer chats already reconnected. Dismiss all is quiet rather than destructive, saves the preference like every other exit, and reports a write the host never confirmed instead of trapping the dialog open.
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 0c9b90cd-7f39-4352-a050-67e600c54fa8
📒 Files selected for processing (18)
src/main/native-chat/agent-session-wire/structured-agent-session-holds.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-holds.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-lifetime.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-claim.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-claim.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-ownership.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.tssrc/main/runtime/agent-session-recovery-capsule.tssrc/renderer/src/components/NativeChatResumeOnRestartGroups.tsxsrc/renderer/src/components/NativeChatResumeOnRestartModal.test.tsxsrc/renderer/src/components/NativeChatResumeOnRestartModal.tsxsrc/renderer/src/components/native-chat-restart-action-notifications.tssrc/renderer/src/components/native-chat-resume-on-restart-dialog.tssrc/renderer/src/components/native-chat-resume-on-restart-store.tssrc/renderer/src/components/status-bar/NativeChatResumeStatusSegment.test.tsxsrc/renderer/src/components/status-bar/NativeChatResumeStatusSegment.tsxsrc/renderer/src/i18n/locales/en.json
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| useEffect(() => { | ||
| if (enabled) { | ||
| // Fetched after mount, never awaited by startup: the workspace is usable first. | ||
| launch ??= loadLaunchOffer() |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,190p' src/renderer/src/components/native-chat-resume-on-restart-store.ts
sed -n '1,120p' src/renderer/src/components/status-bar/NativeChatResumeStatusSegment.tsx
rg -n -C 5 'useNativeChatRestartOffer|refreshNativeChatRestartOffer|loadLaunchOffer|_resetNativeChatRestartOffer' src/renderer/srcRepository: stablyai/orca
Length of output: 27636
Retry a failed launch offer read.
When the initial agentSession.restartResumable call fails, refreshNativeChatRestartOffer returns the initial empty candidate list. loadLaunchOffer then resolves, so launch remains cached and useEffect does not retry while enabled stays true. Both renderer consumers receive no candidates; the status segment also returns null, so its refresh action is unavailable.
Add a bounded retry, or clear and retry the cached launch operation when the host did not return an answer.
| setResolved(true) | ||
| } finally { | ||
| setBusy(false) | ||
| consumeNativeChatResumeOnRestartDialogRequest() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '160,245p' src/renderer/src/components/NativeChatResumeOnRestartModal.tsx
rg -n -C 5 'restartContinue|continued' src/main src/renderer/src | head -240
sed -n '45,105p' src/renderer/src/components/native-chat-resume-on-restart-store.tsRepository: stablyai/orca
Length of output: 29506
🏁 Script executed:
set -eu
rg -n -C 8 "restartContinue|RestartActionOutcome|continueAfterRestart|settleNativeChatRestartOffer|NativeChatRestartOffer" src/main/native-chat src/renderer/src/components src/renderer/src | head -320Repository: stablyai/orca
Length of output: 38797
🏁 Script executed:
set -eu
printf '%s\n' '--- restart-related files ---'
rg --files src/main/native-chat src/renderer/src | rg 'restart|agent-session.*wire'
printf '%s\n' '--- RPC and continuation definitions ---'
rg -n -C 12 "agentSession\\.restartContinue|restartContinue|continueAfterRestart|type RestartActionOutcome|interface RestartActionOutcome" src/main src/shared src/renderer/src --glob '*.ts' --glob '*.tsx' | head -500Repository: stablyai/orca
Length of output: 50369
🏁 Script executed:
set -eu
printf '%s\n' '--- RPC wiring ---'
rg -n -C 18 "restartContinue|restartResume|continueAfterRestart" src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-wiring.ts src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts
printf '%s\n' '--- modal imports and action ---'
sed -n '1,35p' src/renderer/src/components/NativeChatResumeOnRestartModal.tsx
sed -n '175,218p' src/renderer/src/components/NativeChatResumeOnRestartModal.tsx
printf '%s\n' '--- shared offer state ---'
sed -n '1,145p' src/renderer/src/components/native-chat-resume-on-restart-store.tsRepository: stablyai/orca
Length of output: 25844
🏁 Script executed:
set -eu
printf '%s\n' '--- continuation result types and return path ---'
rg -n -C 10 "StructuredAgentSessionContinuationOutcome|type .*ContinuationOutcome|interface .*ContinuationOutcome|return \{.*continued|continued\\.push|continueStructuredAgentSessionAfterRestart" src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts
printf '%s\n' '--- continuation implementation ---'
sed -n '1,180p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts
sed -n '210,285p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.tsRepository: stablyai/orca
Length of output: 31816
🏁 Script executed:
set -eu
sed -n '100,212p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts
sed -n '1,220p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-claim.tsRepository: stablyai/orca
Length of output: 9019
Settle continued candidates before closing the dialog.
When agentSession.restartContinue returns, result.continued contains entries with sessionId. reconnectAndContinue only announces those entries, then closes the dialog. The shared offer remains unchanged, so the status segment can continue counting processed candidates.
}>(LOCAL, 'agentSession.restartContinue', { sessionIds })
announceRestartResults(sessionIds, result.continued, 'continue')
+ settleNativeChatRestartOffer(result.continued.map((entry) => entry.sessionId))…e the one a continuation spent Teardown replaced the recovery capsule with whatever this launch still owed, and a launch that never read the offer owes nothing — so a quit after a failed first read, a disabled flag, or a window that never mounted deleted a recovery the user was never shown. The write-back now distinguishes "claimed and still owed" from "never claimed": the first is re-derived as before, the second carries forward verbatim, because nothing revealed those sessions and the predicate would refuse every one for want of a journal nobody opened. Reconnect and continue spent the same claims Reconnect does but never shrank the offer, leaving the status bar counting chats the host had already handed back and sending the user to an entry that re-reads, finds nothing and does nothing.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Claim moved to its own collaborator —
structured-agent-session-restart-claim.tssplits what the host advertises (offered, minus recovered sessions) from the evidence it holds (evidence), withspend/recover/abandonreplacing the inline claim state. - Reopening a chat retires its offer —
StructuredAgentSessionHolds.onResumeCapableAcquisitionis wired torestartResume.recoveredByHold, so a resume-capable hold stops the offer being advertised or written back while the marker stays valid evidence. - Teardown re-derives rather than round-trips —
recordMarkersre-runs the predicate over the outstanding offer and mergesconfirmedMarkerslast, so this teardown's fresh witness outranks a stale carried claim. - Renderer store replaces modal-local state —
native-chat-resume-on-restart-store.tsandnative-chat-resume-on-restart-dialog.tsback both the modal and the new status segment, and the status entry re-reads the host before reopening. - Snooze vs. dismiss split — closing is now a non-destructive snooze; "Dismiss all" is the only path that spends the claim and reports a dismissal the host did not confirm.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- A durable offer a launch never read is preserved —
owed()reports whether this launch claimed the capsule, andrecordMarkerscarries an unclaimed capsule forward verbatim instead of re-deriving it, which would refuse every marker for journals nobody revealed. - Continuation now settles the shared offer —
reconnectAndContinuereads the host'sresumedoutcomes (optional, so an older host degrades to no settle) and callssettleNativeChatRestartOffer, so the status segment stops counting chats the host already handed back. - Teardown coverage reworked — the stale
leaves no marker behindtest was replaced by a never-claimed case, and real-teardown tests now cover both the snoozed and never-claimed paths.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
… read Two ways the write-back deleted a durable recovery offer nobody had seen. A take that FAILED left the claim holding an empty list and reporting that this launch had answered for the offer. The markers were still on disk, unread and unknowable, and teardown then overwrote them with its own empty list. It now writes nothing at all unless it has a witness of its own. `owed()` read "has the capsule been touched" where it meant "did anything here LOOK at the offer" — and its own write-back read counted. Teardown is retried when a phase fails, so the second attempt re-derived carried markers against a session map eviction had already emptied, refused every one, and wiped what the first attempt had just carried forward. The flag is now set only by the paths that actually read or act on the offer. The mock guard for the carry could not fail: it indexed the session it claimed nothing had revealed, so re-deriving passed and the verbatim carry was never the reason it went green. It now runs against no indexed session, which is what an unread offer looks like. Also drops the `Not now` row from the preference table, where it was paired with a dismiss method it no longer calls, and asserts the same thing where the snooze is already covered. Splits the marker predicate's journal reader out of the resume host, which was at its line ceiling.
Electron validation pass — commit
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Retain claimed markers when re-derivation fails. · structured-agent-session-restart-resume-host.ts:280-287
src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts:280-287
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRetain claimed markers when re-derivation fails.
When
claim.owed()returns claimed markers,derive(owed.markers, ...)runs beforecarriedreceives them. If the candidate reader throws, the catch leavescarriedempty. The subsequentAgentSessionRecoveryCapsule.record()replaces the capsule with only the current teardown witnesses, so the outstanding markers are lost. The current-head check only filters a successful result; it does not preserve markers after an exception.Assign
owed.markersas the fallback before callingderive, then replace it only after eligibility evaluation completes.Suggested fix
} else if (!owed.claimed) { carried = owed.markers } else { + carried = owed.markers const stillResumable = new Set( derive(owed.markers, 'must-be-released').map((candidate) => candidate.sessionId) ) - carried = owed.markers.filter((marker) => stillResumable.has(marker.sessionId)) + carried = carried.filter((marker) => stillResumable.has(marker.sessionId)) }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ea633e70-6828-4c9f-80c8-a0095106c5ba
📒 Files selected for processing (5)
src/main/native-chat/agent-session-wire/structured-agent-session-restart-candidates.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-claim.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-claim.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.tssrc/renderer/src/components/NativeChatResumeOnRestartModal.test.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the single commit added since the prior pullfrog review (35f1d45), which reworks teardown so it never answers for a recovery offer it could not read.
- Teardown stops overwriting an unreadable offer —
recordMarkersnow returns without writing when the capsule take failed and this teardown has no witness of its own, instead of replacing the intact-but-unreadable markers with an empty list. - "Did this launch read the offer" is now an explicit flag —
owed()reportsread(set only byevidence/abandon) rather than "has the capsule been touched", so a teardown repeated after a failed phase carries the same unread offer forward instead of re-deriving it against an emptied session map. - The marker predicate's journal reader was extracted — the inline
derive/itemsFormoved tocreateStructuredAgentSessionRestartCandidateReader, built once by the host and shared by the offer, click and write-back. - Tests tightened — the never-claimed teardown guard now runs against no indexed sessions (so a re-derive would fail it), with new coverage for repeated teardown and both failed-take write-back paths; the "Not now" preference row folded into its dedicated snooze test.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
A capsule whose contents no longer parse made take() throw before it ever reached the clear, so the bad file survived every launch. Nothing else rewrites it now that a teardown owing nothing readable declines to write, and the freshness filter runs after the parse, so the 24h window could not release it either: one corrupt file refused recovery forever. Clear it inside the same transaction that failed to read it, then rethrow, so the poison dies on the next launch while callers still see why the take failed. A clear that fails is swallowed rather than allowed to mask the parse error. Refusing to expose partial candidates is unchanged, and a read that fails for any other reason still writes nothing.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Clear the shared offer when refresh fails. · NativeChatResumeStatusSegment.tsx:17-20
src/renderer/src/components/status-bar/NativeChatResumeStatusSegment.tsx:17-20
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winClear the shared offer when refresh fails.
reopenOffer()can receive cached candidates becauserefreshNativeChatRestartOffer()returnsoffer.candidatesfrom itscatchblock. The dialog can reopen with stale candidates, and the status bar keeps rendering the cached candidates because the store is not updated. Clear the shared offer and return an empty list only on failure. Keep the successful empty response path unchanged.} catch { clearNativeChatRestartOffer() return [] }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ee27a4a5-c5f5-47c6-8673-ad97aae875d7
📒 Files selected for processing (2)
src/main/runtime/agent-session-recovery-capsule.test.tssrc/main/runtime/agent-session-recovery-capsule.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the single commit added since the prior pullfrog review (d58d340), which makes a refused recovery-capsule read self-healing.
- Corrupt capsule content is cleared, not left to refuse forever —
AgentSessionRecoveryCapsule.take()now empties the capsule when its content cannot be parsed or validated, then rethrows, so one unreadable file no longer fails every subsequent take. - Discriminating coverage — a new
it.eachproves a later take (and a fresh capsule instance) returns[]after the refused read, for both invalid JSON and a valid capsule containing one malformed marker.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Review status: ready to mergeAll checks green at What the change doesWhen Orca restarts while a chat is mid-reply, that reply is lost. Orca notes which chats were interrupted and offers to reconnect them at the next launch. Previously, closing that dialog any way threw those notes away — so if you closed it to go look at the chats first, the offer was gone for good. Now closing it is a snooze: the offer stays reachable from a status-bar entry until you either reconnect, dismiss it outright, or simply open the chat yourself. Why the mechanism changedThe original version kept the list of interrupted chats in the window, written there by the dialog. The status-bar entry read that copy. This meant the same fact lived in three places — the backend, the dialog, and the shared copy — and they could disagree. They did. Reopening the dialog after reconnecting some chats restored the original list, re-offering chats that had already been reconnected and pushing the count back up. Clicking reconnect on one of those then failed, because the backend had already handed it back. The backend now owns the offer outright. Both the dialog and the status-bar entry read the backend's current answer, and anything about to act on the offer asks again first. A count can no longer name a chat the backend would refuse. The bugs that mattered mostFive of the eight were ways the saved notes could be destroyed or corrupted — the exact thing this feature exists to prevent:
The rest: reconnecting a chat and continuing it left the status-bar count too high; dismissing silently discarded the "don't ask again" preference; and a failed dismiss left the dialog stuck open with nothing reported. Also fixed
Validation
Durability evidence is pinned to Known gaps
Suggested follow-ups (not blocking)
|
…tually resume The restart prompt offered two actions: "Reconnect all", which reattached and sent nothing — exactly what opening the chat already does — and "Reconnect and continue", which reattached and asked the agent to carry on. The vacuous one is gone, the "Not now" button and the info popover with it, and the feature is now called resume throughout. "Don't ask again (resume automatically)" now runs the action the button runs: the launch calls agentSession.restartContinue instead of agentSession.restartResume, so the preference means what it says. Several comments asserted the opposite as a structural guarantee and are corrected. agentSession.restartResume stays: no in-app caller is left, but it is a published wire method a non-desktop or older client can call.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the only substantive commit landed since the prior pullfrog review (508eedf merged main without touching the PR's files; 87b6f2771b is the change).
- One restart action, and it resumes — the dialog's separate "Reconnect" and "Reconnect and continue" buttons, the "Not now" button, and the "what gets sent" popover are gone; the single primary action calls
agentSession.restartContinue(reattach AND send), with the description copy carrying the transparency. - The automatic path now resumes too — an opted-in launch calls
restartContinueand settles the offer fromresult.resumed, instead of the send-freerestartResume;restartResumestays published on the wire. - Snooze and dismiss are preserved — closing the dialog only consumes the request and persists the preference;
Dismiss allremains the sole path that spends the claim, clears the store only on a confirmed host answer, and reports the unconfirmed case. - Strings and catalogues renamed — Reconnect→Resume across the modal, status segment, settings and notifications, with
en.json/en-runtime-required.jsonkept in sync and the now-dead keys removed. - Comments corrected — the "automatic reconnect can never continue" guarantee is explicitly retired everywhere it was asserted (continuation module, host
send/continueAfterRestart, RPC method, claim test).
ℹ️ The automatic setting now sends a message, not just a reconnect
The single action is a deliberate and well-documented change, but note that it changes what an existing nativeChatResumeWorkOnRestart = true means. Such a user opted in to reconnecting mid-turn chats; on the next launch they will now have a continuation message sent to each agent without pressing anything, with only the launch toast as notice. That is the intended semantics of "make it actually resume", and the setting copy now says so, so this is for the maintainer to bless rather than a defect. Worth confirming that widening an existing boolean from "reattach" to "send at launch" is acceptable, since the opt-in was taken under the old wording.
Technical details
# Automatic launch now sends a continuation message
## Affected sites
- `src/renderer/src/components/native-chat-resume-on-restart-store.ts:112-138` — `loadLaunchOffer`
calls `agentSession.restartContinue` when `nativeChatResumeWorkOnRestart === true`.
- `src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts:173-233`
— `continueAfterRestart` sends `AGENT_SESSION_RESTART_CONTINUATION_MESSAGE` to each reattached
session.
- `src/shared/agent-session-restart-continuation.ts:8-13` — the old "no setting can reach this"
contract is explicitly retired.
## Required outcome
- None mechanically; the behavior matches the PR's stated intent. This is a consent/rollout question.
## Open questions for the human
- Is the widened meaning of the existing setting acceptable without a migration or a one-time
re-prompt for users who already had it enabled?
- Should the launch toast (the only notice a message went out) be more prominent than the same
fire-and-forget toast the interactive button raises?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Fresh screenshots — this replaces the earlier screenshot commentThis supersedes the earlier screenshot comment. Those pictures show the previous design of this dialog and are now out of date: the wording, the buttons and the status-bar text have all changed since. Please read this comment instead.
Everything below was photographed from the real app running commit What changed since the old pictures
How the interrupted chats were producedNothing was hand-written or injected. The state came from the app doing what it normally does:
Orca's own shutdown wrote the recovery record — three entries, one per chat that was mid-reply. On the next launch the dialog below came up on its own. 1. The dialog, three interrupted chats, darkThe chats are grouped the way the sidebar groups things: project, then workspace, then the chats inside it. Every chat is ticked to begin with, and each row shows which assistant it was, the first line of what you asked, the model, and how long ago it stopped. 2. The same dialog in light mode3. Untick a chat and the button counts what is leftWith one chat unticked the button reads "Resume 2": With two unticked it reads "Resume 1": Untick everything and the button is greyed out, because there would be nothing to do. 4. Closing the dialog does not throw the chats awayClosing with the X puts the list aside rather than discarding it. The bottom-right of the window keeps a way back to it: Clicking that entry reopens the dialog. It asks the app again before it opens, so the list is always current — here it correctly shows two, because in between I had opened one of those chats, and simply opening a chat already picks it back up: 5. The status-bar wording, plural and singularTwo waiting reads "2 chats to resume": Then I actually used the button: ticked one chat, pressed "Resume 1", and that chat started working again. The list shrank with it, and one waiting reads "1 chat to resume" — not "1 chats": 6. In a narrow window it shrinks to an icon and a numberThe whole app is cramped at this width; the only thing this is evidence for is that the entry collapses like the other status-bar items do. 7. The rewritten Settings textSettings → Experimental → Chat UI. The description of the automatic option used to say resuming does not carry on the interrupted reply. It now says what actually happens, and matches the dialog: the chat is put back where it stopped and the assistant is asked to check its last action before carrying on, and your own message is not sent again. The same text in the full Settings window: What I did not photograph
|
…lected The button read "Resume all" whenever every chat happened to be ticked, which described the selection rather than the action. It always acted on the selected chats only. Now it always names that count, with a singular variant so one chat does not read "1 chats".
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the single commit added since the prior pullfrog review (87b6f2771b), which fixes the resume button's label.
- The Resume button now names the selection count — it no longer reads "Resume all" merely because every chat happened to be ticked. It shows
Resume 1 chat(a dedicatedresumeSelectedOnekey) when exactly one is checked andResume {{value0}} chatsotherwise; the two branches already acted on the samechosenlist, so this is copy-only. - Dead branch and string removed — the
chosen.length === candidates.lengthcondition and theresumeAllcatalog entry are gone, so the label depends only onchosen.length. - Tests and catalogue updated — the modal tests target the new labels (including the "exactly two actions" assertion, now
Resume 2 chats), anden.jsoncarries the renamed/added keys.
chosen is still intersected against the host's candidate list and resume(chosen) is unchanged. pnpm verify:localization-runtime-catalog passes (the new keys are rebuildable from their call-site defaults, so no runtime-required regeneration is needed), and the modal, status-segment and catalog tests pass (47 tests).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…n left behind Resuming became one action — reattach and ask the agent to carry on — so the notification helpers no longer need to be told which action they are reporting. Every caller passed `continue`; the `reconnect` branch, its helper and its catalog keys are gone. The dialog and the launch path had grown two copies of the same call: same RPC, same response shape, same announce-and-settle. That now lives once in the store module that owns the offer, which also takes the dismiss call, leaving the modal presentational. The two copies had drifted — only the dialog's caught a malformed payload — and the unified one keeps the defensive reading. No behaviour change. `agentSession.restartResume` stays: it is a published wire method even though nothing in the app calls it.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the single commit added since the prior pullfrog review (db148c2), which removes the reconnect vocabulary the single-action resume left behind and consolidates the offer's two network actions.
- Notification helpers speak only
continue—announceResumed, theaction: 'reconnect' | 'continue'parameters, and thereconnectUnconfirmed/reconnectRefusedcatalog keys are gone;RestartActionOutcomenow mirrors the host'sStructuredAgentSessionContinuationOutcomeexactly (continued | pending | unknown | refused). The call sites already passedcontinue, so this is vocabulary-only. - The two offer actions live once in the store —
continueNativeChatRestartOfferanddismissNativeChatRestartOfferreplace the duplicated call in the modal and the launch path. Both former copies had the same RPC, response shape and announce/settle order; the unified one keeps the dialog's defensive malformed-payload catch, so an unexpected shape is reported as an unconfirmed delivery rather than surfacing as an unhandled rejection on the launch path. - Dead catalog keys pruned —
oneAgent,manyAgents,projects,reconnectAgent,resume,resumedOne/resumedManyand the reconnect variants are removed fromen.jsonanden-runtime-required.json, all unreferenced from any call site. - Small cleanups — a
notify()helper innative-chat-resume-on-restart-dialog.ts, and comment-only updates in the main-process resume host, RPC methods, and the shared continuation constant.
I traced the refactor against both former call sites and found no behavior change: RPC arguments ({ sessionIds } versus {}), the reported list used for toasts, and the settle input are identical. pnpm tc:web and verify:localization-runtime-catalog pass; the modal (17), status-segment (5), runtime-required catalog (23) and main restart-claim/ownership/holds (81) suites pass. All prior pullfrog threads are resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…cting it The modal's selection was intersected back against the host's candidate list before every action, as a guard against naming a chat the host never offered. That guard could never fire: the selection was already derived from that same list, so the intersection was the identity. The array of chosen ids is now the derived value and the lookup set falls out of it, which makes the property structural rather than checked. The helper had no other caller and is gone, along with its three tests. Three tests mocked the resume response in the shape the old API returned. Two never reached that branch at all; the third only passed because the unreadable shape happened to exercise the malformed-payload path. All three now use the real shape, and the malformed-payload behaviour — report an unconfirmed delivery, leave the offer standing — gets a test that says so. Also: the candidate reader took two trailing optional parameters, so one caller passed a placeholder `false` to reach the second; they are an options object now. `isFolderWorkspaceId` had no caller outside its own module and is no longer exported. `RestartActionOutcome` only ever describes a continuation row, so it is named for that. `dismissAll` set a busy flag that nothing could render, since it closes the dialog first. Several comments repeated an argument already made in the module they point at. Settings: the automatic-resume description is one sentence again. No behaviour change.
There was a problem hiding this comment.
ℹ️ No critical issues — one copy suggestion inline.
Reviewed changes
This run re-reviewed the single commit landed since the prior pullfrog review (ec2dce4f24): ac2c65ca33 ("derive the resume selection instead of intersecting it"), a self-described no-behavior-change cleanup.
- The dialog's selection is now structurally safe —
chosenis the derived id array (offered minus exclusions) andselectedfalls out of it; theselectedResumeSessionIdsintersection helper and its three tests are gone, because the selection was already derived from the host's list. - Candidate reader takes an options object — the trailing
providerStopped/pendingContinuationIdpositional params becameStructuredAgentSessionRestartCandidateOptions, removing the placeholderfalseat one call site. - Continuation rows are named for what they are —
RestartActionOutcome→RestartContinuationOutcome. - Small cleanups — a dead
busyflag removed fromdismissAll(the dialog is already consumed) andisFolderWorkspaceIdun-exported. - Tests use the real response shape — three mocks returned the pre-refactor
{ results: [] }; a new test pins the malformed-payload path (unconfirmed toast, offer left standing). - Settings copy shortened — the automatic-resume description is one sentence again.
I traced the refactor against the deleted helper and the former positional parameters: the intersection was the identity, and the options object is equivalent, so the "no behaviour change" claim holds. pnpm tc:web and verify:localization-runtime-catalog pass; the renderer modal/grouping/status suites (33) and the main-process restart-claim/ownership/holds suites (81) pass. All prior pullfrog threads remain resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| )} | ||
| </Label> | ||
| <p className="text-xs text-muted-foreground"> | ||
| {translate( | ||
| 'auto.components.settings.ExperimentalPane.nativeChat.resumeCopy', | ||
| 'When Orca quits or installs an update, chats that were mid-turn are offered again on the next launch. On, they are reconnected without asking and Orca tells you afterwards — the same thing as ticking "Don\'t ask again" in that prompt. Off, you choose from the list each time. Reconnecting restores a chat where it stopped; it does not continue the interrupted reply.' | ||
| 'When Orca quits or installs an update, chats that were mid-turn are automatically resumed when Orca is reopened.' |
There was a problem hiding this comment.
Now that the automatic path sends a continuation message, this is the only place a user who enables the setting from Settings — rather than ticking the dialog's box — learns what will happen, and the shortened sentence no longer says a message is sent. Consider keeping it a single sentence but retaining that disclosure, e.g. …automatically resumed when Orca reopens — each agent is asked to carry on, so a message is sent on your behalf.
Technical details
# Automatic-resume description drops the message-send disclosure
## Affected sites
- `src/renderer/src/components/settings/NativeChatExperimentalSetting.tsx:168` — the call-site default for `resumeCopy`.
- `src/renderer/src/i18n/locales/en.json:7129` — the rendered value; must stay in sync with the default above.
## Required outcome
- The settings copy states that enabling automatic resume sends a continuation message to each mid-turn agent at launch.
## Open questions for the human (optional)
- Is dropping the disclosure deliberate, on the view that the dialog body (or the post-hoc toast) already covers it?
Electron validation (hidden window, CDP only)Ran against this branch in an isolated profile. The chats were real Claude sessions. Orca was quit through its normal restart path while a turn was still in progress, and the recovery file on disk held a Working reply, just before quit Relaunch shows "Resume interrupted chats?" with Resume 1 chat. The row is the tides prompt. Close is the X. The status bar already reads "1 chat to resume" behind the dialog. After clicking Close (snooze, not Dismiss all). The dialog is gone and the status bar still reads "1 chat to resume". The chat itself is open and shows "Worked for 30s". A second quit, this time during Clicking that status-bar entry did not reopen the dialog. The entry disappeared. Clicking Resume 1 chat on a later interrupt (a Renderer console on these launches: 0 errors, 1 warning (React Grab outdated). The dev log also reported Not exercised: a continuation the host accepts, "Don't ask again", Dismiss all, light theme, Windows, Linux, and SSH. |
|
Fresh hidden-app check of the restart-recovery offer on this branch. Two Codex chats were mid-command when the app quit, and the next launch offered both.
|
Review status: ready to mergeThe restart-recovery flow has been replaced with a durable, machine-local per-chat store.
Validation on commit
No mobile, SSH, WSL, Windows, or remote-host surfaces are changed. The Electron run covered the manual flow; automatic-resume and non-macOS/remote-host validation remain outside this change’s exercised matrix. |
There was a problem hiding this comment.
Important
The new durable capsule drops its dismissedAt fence whenever any newer teardown marker arrives, which reopens the door to a stale cross-owner write resurrecting a different chat the user explicitly dismissed. Details and a one-line fix inline.
Reviewed changes
This run re-reviewed the single substantive commit landed since the prior pullfrog review (7d114997bf merged main without touching the PR's files); f991fe3872 is the change, which reworks restart recovery from a launch-scoped take into durable per-session records.
- Restart offers are now durable, per-session records —
AgentSessionRecoveryCapsulewas rewritten to a v2 file of{ state, marker, replacement }entries withbeginResume/completeResume/rollbackResume/clearAllreplacing the take-and-delete workflow (takeis gone; v1 files migrate on first mutation). - Listing is read-only, and opening a chat no longer retires an offer —
list()never spends or rewrites records;recoveredByHoldandStructuredAgentSessionHolds.onResumeCapableAcquisitionare removed, andlist/runderive withmay-be-heldso a chat the user inspected stays offered. - Renderer reconciliation replaces local settle —
restartContinue/restartResumableDismissnow return the host's authoritative remainingsessions, the store publishes that list after every action, and the launch read retries transient failures three times before hiding the offer. - Teardown write-back is merge-based —
recordmerges this teardown's confirmed witnesses into existing offers (fenced bydismissedAt) instead of replacing the file, so an offer no launch acted on survives a subsequent quit. - Tests moved to the durable model — the take-era
structured-agent-session-restart-claim.test.tssuite was deleted; the ownership and capsule suites were expanded with real-file coverage (a chat stays offered after being opened, concurrent reads are non-destructive, corrupt storage is advisory, dismissal serializes behind publication).
ℹ️ The settlement-outcome unit tests were lost with claim.test.ts
Production still branches on the settled dispatch in continueStructuredAgentSessionAfterRestart (accepted → note, pending after a timed-out waiter, unknown, rejected dispatch), but the only direct tests for those branches were in the deleted claim.test.ts. The ownership suite keeps the important "accepted vs pending" regression pinned, so this is a coverage reduction rather than a gap in the primary path.
Technical details
# Settlement-outcome branch coverage removed
## Affected sites
- `src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts:157-186` — the branches: `awaitSettlement` undefined → `pending`, `unknown` dispatch → `unknown`, `rejected` → refused, `accepted` → note.
- `src/main/native-chat/agent-session-wire/structured-agent-session-restart-ownership.test.ts:96-134` — the surviving integration coverage (continued + note, and note failure).
- Deleted: `src/main/native-chat/agent-session-wire/structured-agent-session-restart-claim.test.ts` — previously covered `pending` after settlement timeout, `unknown`, rejected dispatch, and send refusal.
## Required outcome
- Keep direct coverage for the untested settlement branches, or state that the ownership-level tests are considered sufficient.
## Open questions for the human (optional)
- Is the loss of the fine-grained settlement tests intentional (they mocked the surface heavily), or an oversight from replacing the take-based harness?ℹ️ The PR description still describes the take-based design
The description's "Review" and "Suggested follow-up" sections predate this commit: recovery notes are no longer "read and then deleted at startup", "Opening one of those chats yourself retires its offer" is now the opposite of the behavior, and the suggested follow-up ("store each recovery note against its own chat record rather than in a single file that is deleted on read") is exactly what this commit implements. A reviewer reading the description will form the wrong model of the shipped behavior.
Technical details
# PR body is stale against head f991fe38
## Affected sites
- PR description, "## Review" and "**Suggested follow-up:**" sections.
## Required outcome
- The description reflects the durable per-session capsule and that opening a chat no longer retires its offer.
## Open questions for the human (optional)
- Is the single-file capsule now considered permanent, so the crash-survival follow-up should be dropped or re-scoped?ℹ️ Nitpicks
src/main/runtime/agent-session-recovery-capsule.ts:176— the in-progress guard's|| marker.teardownId !== current.teardownIddisjunct is dead: with equalrecordedAt,shouldReplaceMarkerreturnsteardownId === current.teardownId, so the second disjunct can never be the deciding one. Dropping it would make the intent (only a strictly newer, or same-teardown, witness replaces an in-progress record) explicit.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Follow-up review updateThe latest review identified one real edge case: a newer interruption could clear the dismissal timestamp, allowing an older delayed shutdown write to bring back a chat the user had already dismissed. That is fixed in
Final readiness on this commit is clean:
|
There was a problem hiding this comment.
ℹ️ No critical issues — one coverage suggestion inline.
Reviewed changes
This run re-reviewed the single commit added since the prior pullfrog review (f991fe3872): c139b377ca ("preserve dismissal fence across new interruptions").
recordkeeps the globaldismissedAtfence unconditionally — thereopensDismissalbranch that dropped the fence whenever any incoming marker was newer is gone; genuinely newer interruptions still pass the per-markerrecordedAt <= dismissedAtskip, so a stale cross-owner write can no longer resurrect a previously dismissed chat.- Settlement-outcome unit coverage is restored — the new
structured-agent-session-restart-continuation.test.tspinsaccepted(note written),pending/unknown/rejected(preserved, no note), send refusal (no settlement wait) and unattached (no send), replacing the branches the deletedclaim.test.tsheld. - A fence regression assertion was added to the capsule suite's late-teardown test (see inline note on its discriminating power).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| expect(await capsule.list(NOW + 2)).toEqual([newer]) | ||
|
|
||
| // A new interruption must not remove the fence before the old callback has finished. | ||
| await capsule.record([marker()], NOW + 2) |
There was a problem hiding this comment.
The new fence assertion uses the same SESSION as newer, so shouldReplaceMarker already blocks the late marker and the test passes whether or not the fence is kept — I confirmed it still passes with the old reopensDismissal logic restored. Using a different session id, which is the stale cross-owner write this fence actually guards against, makes it fail on the old code and pass on the fixed code.
| await capsule.record([marker()], NOW + 2) | |
| await capsule.record([marker({ sessionId: 'second' })], NOW + 2) |
|
Final validation on c139b37:
Backing checks: 164 focused tests pass, node/web typechecks pass, changed-code quality is clean, and the worktree is clean. Mobile, Windows/WSL, and SSH QA are not applicable to this local desktop-only change. |











































Summary
If Orca closes while an agent is halfway through a reply, the chat can now be offered again when Orca opens.
The offer is kept on the machine until the user makes a clear choice:
The user’s original message is never sent again.
What was wrong before
The old design mixed two separate things together: opening a chat so the user could look at it, and restoring a chat so its agent could continue. Opening a chat could therefore make the offer disappear even though the user had not chosen Resume.
The dialog and the status bar also kept different copies of the list. After one chat was resumed, the dialog could still show it, which made the buttons and the count disagree with what the app could actually do.
What changed
There is now one saved list owned by the chat-session manager. It stores one entry for each interrupted chat on the local machine.
A short retry covers the normal startup race while the chat-session manager is coming online. If the app cannot confirm the list, it hides the offer rather than showing a possibly wrong one.
Why this design
The saved list is the source of truth, and user actions are the only things that change it. This keeps inspection, resuming, postponing, and dismissing separate and predictable.
The older approach tried to infer the user’s choice from chat-window activity. That is why merely opening a chat could be mistaken for recovery. This change records the user’s actual choice instead.
Visual proof
The real app was tested in a hidden Electron window using two genuinely interrupted chats:
Screenshots are attached in the Electron validation comment.
Testing
Not exercised: Windows, Linux, SSH/remote hosts, mobile, or automatic resume. No code in those areas changed.
Linked issue
Follow-up to merged PR #21096; no separate issue exists.
AI disclosure
Codex (GPT-6) wrote the change. Claude Opus 5 performed the review-driven rewrite.
Scope and compatibility
This changes local structured-chat recovery only. It does not add polling, shell commands, subprocesses, mobile code, or remote-host protocol changes. Folder workspaces remain supported.
Checklist