Repository navigation
fix(native-chat): keep chats that failed to resume in the status bar and say what to do - #22448
Conversation
…and say what to do After a restart, a chat whose resume did not carry on was reported only by a four-second toast that named nothing, and the status bar entry vanished because the reattach had already spent the offer. The host now files the outcome as a durable `failed` entry in the recovery capsule, with the refusal code and the prompt the offer quoted, and returns it from the restart-resume RPCs. The renderer shows a "N chats failed to resume" status bar entry, a count-only toast with Show and Dismiss, and keeps the resume dialog open with a status icon per row and a "To resume" line whose action is chosen from the reason. A failure dies on dismiss, on a successful retry, on the user's own send in that chat, or with the marker's 24h expiry.
There was a problem hiding this comment.
Important
One user-visible defect in the new failure dialog: after the per-row Retry succeeds (or the last failure is dismissed while a just-resumed row is still shown), the dialog stays open and its title reads "0 chats couldn't be resumed" next to a green "Resumed and asked to continue" row, with only a disabled "Dismiss failed" button as its control. Details inline. There is also one minor wire-compatibility note inline.
Reviewed changes
- Durable failure record. The recovery capsule gains a third entry state
failed(outcome/reason/prompt snapshot) withlistFailed/failResume/dismiss(sessionIds); file parsing and normalization move toagent-session-recovery-capsule-entries.ts. Failures die via dismiss, a successful retry, the user's own send, or the marker TTL; a newer teardown replaces them with a fresh offer. - Host wiring. New
structured-agent-session-restart-failure-ledger.tsdecides filing and eviction.settlefilesrefused/unconfirmedoutcomes beforerollbackResume, so a failure is never reopened as an offer.restartContinuationDepsis extracted from the resume host; the host'ssendreleases a recorded failure on the user's own message, skipping the continuation caller. Teardown witnesses move to their own module. - Wire (additive).
restartContinue/restartResumablereturn optionalfailed;restartResumableDismissaccepts optionalsessionIdsvia a widenedRestartResumableParams. - Renderer. The store carries host-owned
failedplus window-localsettled; a newNativeChatResumeOutcomeRowandnative-chat-resume-failure-guidance.tsmap each reason to one sentence and its action; the modal stays open on partial failure; the status bar adds a separate yellow failure entry; the toast becomes count-only with Show/Dismiss; newstatus-warning*tokens replace raw palette colours. - Tests. Capsule, restart-ownership, modal, status-segment, and guidance suites are extended.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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 recovery capsule now stores refused and unconfirmed restart-resume failures. Host and RPC interfaces list these records and support named dismissal and retry. The renderer shows failures separately from pending chats, provides outcome-specific guidance, and supports opening, retrying, or dismissing failed chats. Continuation attempts also add refused or unconfirmed status notes to the chat journal. Merge Risk: 🟡 Moderate · up to An unusually long message ID can make recovery records unavailable. Resolve that persistence mismatch before merging unless the risk is explicitly accepted; the dismissal test and older-host retry guidance also need correction. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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: 5
🧹 Nitpick comments (1)
src/renderer/src/assets/main.css (1)
191-195: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse
status-warningfor the skill-update failure icon.
SkillUpdateStatusSegmentstill usestext-yellow-500for its failed state. Use the shared, theme-specific token for this same status tone.Suggested fix
- icon: <AlertCircle className="size-3 text-yellow-500" />, + icon: <AlertCircle className="size-3 text-status-warning" />,Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 65e421e9-c6fe-4dcf-91ee-20aa1d9c21fb
📒 Files selected for processing (27)
src/main/native-chat/agent-session-wire/structured-agent-session-host.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.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/native-chat/agent-session-wire/structured-agent-session-restart-resume-set.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-witnesses.tssrc/main/runtime/agent-session-recovery-capsule-entries.tssrc/main/runtime/agent-session-recovery-capsule.test.tssrc/main/runtime/agent-session-recovery-capsule.tssrc/main/runtime/rpc/methods/structured-agent-session-restart-resume.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/NativeChatResumeOnRestartGroups.tsxsrc/renderer/src/components/NativeChatResumeOnRestartModal.test.tsxsrc/renderer/src/components/NativeChatResumeOnRestartModal.tsxsrc/renderer/src/components/NativeChatResumeOutcomeRow.tsxsrc/renderer/src/components/native-chat-restart-action-notifications.tssrc/renderer/src/components/native-chat-resume-failure-guidance.test.tssrc/renderer/src/components/native-chat-resume-failure-guidance.tssrc/renderer/src/components/native-chat-resume-on-restart-grouping.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/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/shared/agent-session-resume-marker.tssrc/shared/rpc-contract/structured-agent-session-params.ts
💤 Files with no reviewable changes (1)
- src/renderer/src/i18n/en-runtime-required.json
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| send = (...args: Parameters<StructuredConversationCommandController['send']>) => { | ||
| // The user's own message is the manual continuation a failed restart resume asked for. | ||
| this.restartResume.releaseFailureOnUserSend(...args) | ||
| return this.conversationCommands.send(...args) | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Release the failure record only after the user's send is accepted.
releaseFailureOnUserSend runs before conversationCommands.send, whatever the result. StructuredConversationCommandController.send can return { ok: false }, for example agent_session_operation_invalid while a conversation command is pending. Fence and payload refusals are also possible. In each of these cases, the durable failure is already dismissed while the chat was never continued. The status bar entry and the dialog row then disappear, and nothing still names the chat. The ledger documents this record as released by "the manual continuation", not by an attempt.
Release the record after the send resolves with ok: true. The release stays fire-and-forget, so the send is not delayed.
🐛 Proposed fix
send = (...args: Parameters<StructuredConversationCommandController['send']>) => {
- // The user's own message is the manual continuation a failed restart resume asked for.
- this.restartResume.releaseFailureOnUserSend(...args)
- return this.conversationCommands.send(...args)
+ // The user's own ACCEPTED message is the manual continuation a failed restart resume asked for;
+ // a refused send continued nothing and must not erase the record.
+ return this.conversationCommands.send(...args).then((result) => {
+ if (result.ok) {
+ this.restartResume.releaseFailureOnUserSend(...args)
+ }
+ return result
+ })
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| send = (...args: Parameters<StructuredConversationCommandController['send']>) => { | |
| // The user's own message is the manual continuation a failed restart resume asked for. | |
| this.restartResume.releaseFailureOnUserSend(...args) | |
| return this.conversationCommands.send(...args) | |
| } | |
| send = (...args: Parameters<StructuredConversationCommandController['send']>) => { | |
| // The user's own ACCEPTED message is the manual continuation a failed restart resume asked for; | |
| // a refused send continued nothing and must not erase the record. | |
| return this.conversationCommands.send(...args).then((result) => { | |
| if (result.ok) { | |
| this.restartResume.releaseFailureOnUserSend(...args) | |
| } | |
| return result | |
| }) | |
| } |
| const before = await readFile(filePath) | ||
|
|
||
| expect(await capsule.dismiss([SESSION, 'second', 'missing'], NOW)).toBe(2) | ||
| expect(await capsule.list(NOW)).toEqual([marker({ sessionId: 'third' })]) | ||
| expect(await capsule.listFailed(NOW)).toEqual([]) | ||
| // Nothing named, nothing rewritten. | ||
| expect(await capsule.dismiss(['missing'], NOW)).toBe(0) | ||
| expect(await readFile(filePath)).not.toEqual(before) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Fix the "nothing rewritten" assertion so it tests the no-op dismiss.
before is read before the first dismiss([SESSION, 'second', 'missing']). The assertion on Line 214 therefore only proves that the first dismiss rewrote the file. It does not show that dismiss(['missing']) left the file unchanged, which is what the comment on Line 212 claims. Read the bytes after the first dismiss and assert equality after the second.
💚 Proposed fix
- const before = await readFile(filePath)
-
expect(await capsule.dismiss([SESSION, 'second', 'missing'], NOW)).toBe(2)
expect(await capsule.list(NOW)).toEqual([marker({ sessionId: 'third' })])
expect(await capsule.listFailed(NOW)).toEqual([])
// Nothing named, nothing rewritten.
+ const before = await readFile(filePath)
expect(await capsule.dismiss(['missing'], NOW)).toBe(0)
- expect(await readFile(filePath)).not.toEqual(before)
+ expect(await readFile(filePath)).toEqual(before)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const before = await readFile(filePath) | |
| expect(await capsule.dismiss([SESSION, 'second', 'missing'], NOW)).toBe(2) | |
| expect(await capsule.list(NOW)).toEqual([marker({ sessionId: 'third' })]) | |
| expect(await capsule.listFailed(NOW)).toEqual([]) | |
| // Nothing named, nothing rewritten. | |
| expect(await capsule.dismiss(['missing'], NOW)).toBe(0) | |
| expect(await readFile(filePath)).not.toEqual(before) | |
| expect(await capsule.dismiss([SESSION, 'second', 'missing'], NOW)).toBe(2) | |
| expect(await capsule.list(NOW)).toEqual([marker({ sessionId: 'third' })]) | |
| expect(await capsule.listFailed(NOW)).toEqual([]) | |
| // Nothing named, nothing rewritten. | |
| const before = await readFile(filePath) | |
| expect(await capsule.dismiss(['missing'], NOW)).toBe(0) | |
| expect(await readFile(filePath)).toEqual(before) |
| "notContinuedOne": "1 chat couldn’t be resumed", | ||
| "notContinuedMany": "{{value0}} chats couldn’t be resumed", | ||
| "failedBody": "Resumed chats were asked to check their last action before carrying on. A chat that couldn’t be resumed stays here and in the status bar until you open, retry, or dismiss it.", | ||
| "outcomeListLabel": "How each chat was resumed", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use a label that includes failed outcomes.
The dialog lists chats that could not be resumed, so “How each chat was resumed” can imply that every listed chat resumed successfully. Use a neutral label, such as “Resume outcomes.”
The PR objective says the dialog shows each chat’s outcome, including failed chats.
…ts as rows The failure view had replaced the resume dialog's title, checkboxes, preference box, and footer. The dialog is back to main's layout. A chat an earlier resume could not carry on is now an ordinary selectable row there, plus a status icon whose tooltip carries the reason, a dismiss control, and a "To resume" line. Selecting it and pressing Resume retries it; it is pre-selected only when a retry can succeed. Resumed chats leave the list as before. Also stubs the new failure listing on the cross-version wire host fixture, which the restart-resume RPC now reaches.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor label suggestion inline.
Reviewed changes
Reviewed a039073 (the delta since the prior pullfrog review at 5aba432). The main-process work (capsule failed state, failure ledger, host wiring, additive wire fields) is unchanged by this commit and was covered in the prior review.
- Merged failed resumes into the dialog's ordinary row list: a failed chat is now the same selectable row plus a status icon/tooltip, a ✕, and a "To resume" guidance line, instead of a separate outcome list.
NativeChatResumeOutcomeRow.tsxis deleted and its pieces live inNativeChatResumeFailureDetails.tsx. - Kept the dialog chrome generic — title, body, and the Dismiss all / Resume footer no longer branch on whether failures exist, which removes the prior review's stale "0 chats couldn't be resumed" header.
- Replaced the window-local
settledlist and theexcludedselection set with per-rowoverrides(default from the row's reason), and dropped the generic row renderer fromNativeChatResumeOnRestartGroups. - Removed the now-unused
failedBody,outcomeListLabel,dismissFailed,continueRefused, andcontinuedstrings, and added stub-host failure members totests/e2e/cross-version-wire.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| rows | ||
| .filter( | ||
| (row) => | ||
| overrides.get(row.sessionId) ?? selectedByDefault(failureBySession.get(row.sessionId)) | ||
| ) | ||
| .map((row) => row.sessionId), | ||
| [rows, overrides, failureBySession] |
There was a problem hiding this comment.
When the only failures are not retryable — the agent_session_restart_work_superseded case this PR is about — chosen is empty, so the footer renders a disabled Resume 0 chats next to the per-row Open chat action. That zero-count label reads oddly as the dialog's primary control. Optional: when chosen.length === 0, use a neutral label (or hide the primary button) instead of naming zero chats; the count suffix only earns its place once something is ticked.
Technical details
# Disabled footer names a zero count
## Affected sites
- `src/renderer/src/components/NativeChatResumeOnRestartModal.tsx:252-270` — the footer button renders `chosen.length === 1 ? 'Resume 1 chat' : 'Resume {{value0}} chats'`, i.e. "Resume 0 chats" when nothing is selected.
- `src/renderer/src/components/NativeChatResumeOnRestartModal.tsx:86-95` — `chosen` is empty whenever every failure's `selectedByDefault` is false (e.g. `agent_session_restart_work_superseded`).
- `src/renderer/src/components/NativeChatResumeOnRestartModal.test.tsx:508` — pins the exact `'Resume 0 chats'` string, so a label change updates that expectation.
## Required outcome
Treat the empty selection as a distinct state so the primary control does not advertise resuming zero chats; the per-row actions already carry the real affordances. Mergeable as-is if the current wording is intended.… admitted Keeps the host file at main's size, and only releases the record for a send the controller actually lets through.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor coverage note inline.
Reviewed changes
Reviewed 5df6d36, the delta since the prior pullfrog review at a039073. The commit is a small refactor of where a recorded resume failure is released.
- Moved
releaseFailureOnUserSendoff the host'ssendwrapper and intoStructuredConversationCommandController.admitSend, so a send the per-session pending gate refuses no longer clears a recorded failure. - Widened the controller's host
PickwithrestartResume; the host'ssendis a thin delegate again, keeping that file at its existing size.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
… when it is settled The chat itself now says when Orca could not continue it after a restart, with an error (refused) or warning (unconfirmed) status row, so the failure survives the toast, a dismissed record, and another restart. A recorded failure is current only while the chat's newest user message is the one it had when the failure was filed. Listing re-derives that from the journal and prunes superseded records, replacing the in-memory set and the hook on every send. Failures move to their own optional top-level key in the recovery file, so an older build that rejects unknown entry states keeps reading its offers. A retried failure stays a failure through a rollback or a lapsed lease instead of returning as a pending offer, and the toast's Dismiss names only the chats the host listed as failed. Co-Authored-By: Claude <[email protected]>
…ore any retry Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 80717059-c070-41fa-8ef7-bb3d75c0c08e
📒 Files selected for processing (16)
src/main/native-chat/agent-session-wire/structured-agent-session-restart-candidates.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.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-entries.tssrc/main/runtime/agent-session-recovery-capsule.test.tssrc/main/runtime/agent-session-recovery-capsule.tssrc/renderer/src/components/NativeChatResumeOnRestartModal.test.tsxsrc/renderer/src/components/native-chat-restart-action-notifications.tssrc/renderer/src/components/native-chat-resume-on-restart-store.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/agent-session-restart-continuation.tssrc/shared/rpc-contract/structured-agent-session-params.tstests/e2e/cross-version-wire/structured-agent-session-host-fixture.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/i18n/locales/en.json
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — a careful rework of where the durable failure record comes from and when it leaves. One edge case inline, one rollout observation, one nitpick.
Reviewed changes
Reviewed 2afadce and 5d0d433, the delta since the prior pullfrog review at 5df6d36.
- Moved failures out of the entry list. A
failedresume is now a top-level optionalfailedarray in the recovery capsule instead of a third entrystate, so an older build's two-state entry parser still reads every offer;parseState/normalizeStatenow split offers from failures. - Derived settlement. Removed
releaseOnUserSendand theadmitSendplacement entirely: a failure is current only while the chat's live newest root user message is the one it had when filed, and superseded records are pruned from the file.latestUserItemIdjoins the failure record, andsettle()reads it after the action so a journaled continuation message does not retire its own failure. - Chat-authored notes. A refused or unconfirmed continuation appends a host status note (
tone: 'error' | 'warning') to the chat itself. - Toast Dismiss narrowed.
announceNotContinuedforwards only ids the host listed asfailed, closing the prior review's compatibility gap. - Tests. Added continuous-settlement-notes, no-send-hook retirement, named-retry-success, and older-reader compatibility cases.
ℹ️ A downgrade write silently discards the new failure records
The capsule comment reasons only about how an older build reads an unknown key, and the new format is a clear win there — a two-state entry parser no longer loses every offer. But the older build also writes: every capsule mutation republishes the file through the base publish, which serialized only { version, entries, dismissedAt }. Since teardown record() runs on every quit, a downgrade + quit + re-upgrade permanently drops the failed array (offers are untouched). This looks like accepted degradation rather than a bug, but it is not covered by the compatibility test, which exercises only the old reader.
Technical details
# Older-build writes clobber the top-level `failed` key
## Affected sites
- `src/main/runtime/agent-session-recovery-capsule-entries.ts:35-36` — design comment covers older reads, not older writes.
- `src/main/runtime/agent-session-recovery-capsule.ts` `publish()` — this build serializes `failed`; the base build's `publish` did not.
- `src/main/runtime/agent-session-recovery-capsule.test.ts:256-284` — asserts offers survive an old read only.
## Required outcome
- Decide whether losing failure records on a downgrade is acceptable (advisory data, re-filed only on a new failure) or not. If not, failures need a home an older build never rewrites.
## Open questions for the human
- A sibling file (`agent-session-recovery-failures.json`) would survive an older build's mutations, at the cost of cross-file ordering with the offers it settles. Is the current same-file shape a deliberate trade for the "newer teardown supersedes" normalization?ℹ️ Nitpicks
src/main/runtime/agent-session-recovery-capsule.ts:183—failResumeslicesreasonandlatestPrompttoMAX_FAILURE_FIELD_LENGTHbut storeslatestUserItemIdunsliced, whilefailureSchemacaps that field at 512 on read. Bound it where the id is produced (or slice here) so a long provider item id cannot make the whole capsule unparseable.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| } | ||
| const latest = liveStructuredAgentSessionLatestUserItemId(deps.sessions, sessionId) | ||
| // An unreadable journal decides nothing; the record stays until something that can decide. | ||
| if (latest !== undefined && latest !== failure.latestUserItemId) { |
There was a problem hiding this comment.
list() treats a live session with no root user item as a decisive different answer, but a session can be present in the map with an empty journal: reveal deliberately restores a pre-SQLite-format chat into a fresh, empty journal (structured-agent-session-read-restore.ts:44-61). In that state latest is null and the record is pruned with no user send — contradicting the comment on the line above. A journal that cannot yield a user item should decide nothing.
Technical details
# `null` (present, no user item) is treated as decisive, so an empty revealed journal prunes the failure
## Affected sites
- `src/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.ts:138-144` — `latest === null` supersedes when `failure.latestUserItemId` is a non-null string.
- `src/main/native-chat/agent-session-wire/structured-agent-session-restart-candidates.ts:47-55` — `undefined` only for an absent session; a present session with no root user item yields `null`.
- `src/main/native-chat/agent-session-wire/structured-agent-session-read-restore.ts:44-61` — a legacy remnant opens a fresh, empty journal and the session becomes present via `onReadable`.
## Required outcome
- A session that is present but cannot produce a root user item must not prune a record whose stored id was non-null; only a genuinely newer user item should.
## Suggested approach (optional)
- Treat `latest === null` as undecidable when `failure.latestUserItemId !== null`, e.g. gate on `latest !== undefined && latest !== null && latest !== failure.latestUserItemId` (a real user action only ever adds items, so a non-null stored id can never legitimately become `null`), or thread the reveal's readability/empty-journal signal into the ledger.…s attempt ended A failure was filed against the chat's newest user message read at settlement, after every chat in the action had finished. The chat's note asks the user to send a message, and one sent while other chats were still being continued became part of the filed state, so the failure stayed listed after the user had done what it asked. Each chat's newest message is now observed as its own attempt ends. Co-Authored-By: Claude <[email protected]>
…failure When a restart resume reached a chat the user had already replied in, the attempt was refused as no longer eligible, but the failure was filed against that very reply. It then stayed listed as "finished on its own" until the user sent yet another message. An ineligible chat is no longer observed at the attempt, so its failure falls back to the reserved marker and the reply that made it ineligible supersedes it at the next listing. Co-Authored-By: Claude <[email protected]>
…uld run When the agent refused Orca's "continue" message with its own reason, the failed row fell to the generic guidance, which offers Retry and pre-selects the chat in the resume dialog. The refused message is already the chat's newest user message, so a retry is never eligible: it did nothing and the same "couldn't be resumed" toast came back. The host now reports whether a retry would run, derived at list time from the same predicate the retry applies to the failure's marker. Where it would not, the row offers Open chat and Dismiss and is not pre-selected. An older host omits the flag and the reason alone decides, as before. Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Clear the named witness after dismissal. · structured-agent-session-restart-resume-host.ts:323
src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts:323
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winClear the named witness after dismissal.
Named dismissal removes the durable record but does not clear the confirmed in-memory witness. A later
recordMarkers()can write that witness again. Add a session-scoped witness-clear operation and call it after named dismissal succeeds. Keep the existing all-session clear for unnamed dismissal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: fba04789-f47d-4636-80f2-f184407daddb
📒 Files selected for processing (3)
src/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.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.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.
| await afterAcquire?.(marker) | ||
| } | ||
| } finally { | ||
| attempts.observe(sessionId) | ||
| surfaces.release(sessionId, holder) | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '200,290p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts
sed -n '85,150p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-runner.ts
sed -n '135,235p' src/main/native-chat/agent-session-wire/structured-agent-session-turns.tsRepository: stablyai/orca
Length of output: 7938
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- relevant declarations/usages ---'
rg -n --glob '*.ts' 'admission\.run|create.*Admission|attempts\.observe|function.*observe|class.*Admission|surfaces\.(hold|release|send)|continueStructuredAgentSessionAfterRestart|failureAfterResume|latestUserItemId|forgetFailures|setFailure|settle\(' src/main/native-chat/agent-session-wire
printf '%s\n' '--- host surrounding definitions ---'
sed -n '1,245p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts
printf '%s\n' '--- ledger relevant definitions ---'
sed -n '120,265p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.ts
printf '%s\n' '--- continuation and admission-related definitions ---'
sed -n '1,115p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts
rg -n --glob '*.ts' 'type .*Admission|interface .*Admission|run:\s*.*owner|create.*admission|admission =|acquire.*session|resume.*owner|AgentSessionPreDispatchError' src/main/native-chat src | head -120Repository: stablyai/orca
Length of output: 42171
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- resume admission and attempt types ---'
sed -n '1,145p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-runner.ts
sed -n '1,125p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.ts
printf '%s\n' '--- continuation implementation ---'
sed -n '165,245p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts
printf '%s\n' '--- hold/send bindings in native chat ---'
rg -n --glob '*.ts' 'hold:\s*(async\s*)?\(|hold\s*=\s*|release:\s*(async\s*)?\(|send:\s*(async\s*)?\(|createStructuredAgentSessionRestartResume\(' src/main
printf '%s\n' '--- candidate surface implementations ---'
rg -n --glob '*.ts' 'class .*Surface|type .*Surface|interface .*Surface|holdSession|sessionHolds|holderId|awaitSendSettlement' src/main/native-chat src/main | head -160Repository: stablyai/orca
Length of output: 42306
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- hold lifecycle ---'
sed -n '1,125p' src/main/native-chat/agent-session-wire/structured-agent-session-holds.ts
sed -n '130,190p' src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
printf '%s\n' '--- restart wiring ---'
sed -n '1,90p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-wiring.ts
printf '%s\n' '--- send route and dispatch admission ---'
rg -n --glob '*.ts' 'dispatchSafely|AgentSessionPreDispatchError|function.*send|send\s*=\s*async|async function.*send|resolveDispatch|holds\.(has|hold|release)|resumeCapable|may-be-held' src/main/native-chat/agent-session-wire
sed -n '1,180p' src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
sed -n '1,180p' src/main/native-chat/agent-session-wire/structured-agent-session-holds.tsRepository: stablyai/orca
Length of output: 37840
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- mutation admission and host mutation context ---'
sed -n '1,180p' src/main/native-chat/agent-session-wire/structured-agent-session-mutation-admission.ts
sed -n '1,285p' src/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.ts
printf '%s\n' '--- host serialization and task queue ---'
rg -n --glob '*.ts' 'serialize\s*=|serialize\(|class StructuredAgentSessionTaskQueue|mutationContext|sendStructuredAgentSessionTurn|structuredAgentSessionMutationDelegates' src/main/native-chat/agent-session-wire/structured-agent-session-host.ts src/main/native-chat/agent-session-wire/structured-agent-session-task-queue.ts
sed -n '180,360p' src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
sed -n '1,180p' src/main/native-chat/agent-session-wire/structured-agent-session-task-queue.ts
printf '%s\n' '--- continuation send and host send binding ---'
sed -n '220,330p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts
rg -n --glob '*.ts' 'sendStructuredAgentSessionTurn|mutationDelegates|send\(' src/main/native-chat/agent-session-wire/structured-agent-session-rpc.ts src/main/native-chat/agent-session-wire src/main/runtime/rpc/methods 2>/dev/null | head -120Repository: stablyai/orca
Length of output: 45070
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- continuation recheck and send-plan ordering ---'
sed -n '1,165p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts
sed -n '1,150p' src/main/native-chat/agent-session-wire/structured-agent-session-mutation-plans.ts
printf '%s\n' '--- keyed queue contract ---'
rg -n --glob '*.ts' 'function runKeyedSerializedOperation|export .*runKeyedSerializedOperation' src
sed -n '1,140p' src/main/cli/keyed-promise-queue.tsRepository: stablyai/orca
Length of output: 13479
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- send execution boundary ---'
sed -n '1,145p' src/main/native-chat/agent-session-wire/structured-agent-session-turns.ts
sed -n '145,245p' src/main/native-chat/agent-session-wire/structured-agent-session-turns.ts
printf '%s\n' '--- attempt implementation and relevant tests ---'
sed -n '215,250p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.ts
rg -n --glob '*.ts' 'attempts\(|latestUserItemId|consumeMarker|agent_session_restart_work_superseded|afterAcquire|unconfirmed' src/main/native-chat/agent-session-wire/structured-agent-session-restart-*.test.tsRepository: stablyai/orca
Length of output: 12685
Record the continuation attempt before waiting for settlement.
restartContinuationDeps runs stillResumable inside the serialized send. performSend then returns after it records an admitted submission, while continueStructuredAgentSessionAfterRestart waits separately in awaitSendSettlement. The keyed queue is free during that wait, so a user submission can append a newer user item.
The resume wrapper observes that newer item in finally. If the continuation settles as refused or unconfirmed, failures.settle files the failure against the newer submission ID. Failure listing then keeps the record because the live latest ID still matches. Fixing only the earlier consumeMarker observation does not remove this later overwrite.
Capture the continuation submission inside the serialized send, before that send operation returns and before settlement waits. Remove the post-settlement attempts.observe call. Keep surfaces.release as the unconditional finally action.
There was a problem hiding this comment.
ℹ️ No new issues — one scoping question inline about when a user's own send retires the record.
Reviewed changes
Reviewed 5c31f06, the delta since the prior pullfrog review at 5d0d433. It changes how a failed restart resume is filed, not what any surface shows.
- Filed against the chat's state at its own attempt's end. A new
StructuredAgentSessionRestartAttempts(observe/latestUserItemId) captures each chat's newest user item when that chat's attempt finishes — inconsumeMarkerand in theresumefinally— instead of reading the live journal once at settlement.settlefiles the observed id, falling back to the reserved marker when the chat was unreadable at its attempt. - Retires a failure the user answered mid-batch. In a multi-chat action, a send the user makes while other chats are still resuming now retires the failure it answers, rather than being stored as the failure's own baseline and keeping it current.
- Test. A new ownership case drives a send between the chat's attempt and settlement and asserts the record is pruned; the shared
supersededRefusalhelper gains anafterAttempthook.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in these commits — the two earlier suggestions remain open and unchanged.
Reviewed changes
Reviewed e36769f and 7517012, the delta since the prior pullfrog review at 5c31f06.
- A reply that made a chat ineligible now retires its failure. Removed the pre-attempt
observefromconsumeMarker; an ineligible chat keeps its reserved marker as the baseline, so the newer user message that caused the ineligibility prunes the record. The ownership test now covers a reply landing before or after the chat's own attempt. - Retry offered only where it would run. The host derives a
retryableflag per failure row from the same candidate predicate a retry applies; when it is false the guidance line and the modal's default tick drop Retry for Open/Dismiss, so a chat that already holds its refused continuation is not re-run.ResumeFailure.retryableis optional, so an older host leaves the reason to decide alone.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: cf276d89-8130-4d87-a84a-74c4391d8090
📒 Files selected for processing (7)
src/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.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/native-chat/agent-session-wire/structured-agent-session-restart-resume-set.tssrc/renderer/src/components/native-chat-resume-failure-guidance.test.tssrc/renderer/src/components/native-chat-resume-failure-guidance.tssrc/renderer/src/components/native-chat-resume-on-restart-grouping.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.
| secondary: 'dismiss' | ||
| } | ||
| } | ||
| return { text: manualContinuationText(), primary: 'open', secondary: 'retry' } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '95,135p' src/renderer/src/components/native-chat-resume-failure-guidance.ts
sed -n '20,50p' src/renderer/src/components/native-chat-resume-failure-guidance.test.ts
rg -n -C3 'retryable|readActionMarkers|beginResume' 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-failure-ledger.ts src/renderer/src/components/native-chat-resume-on-restart-store.tsRepository: stablyai/orca
Length of output: 8126
Do not offer Retry when retry eligibility is unknown.
If an older host omits retryable, an unknown refusal such as codex said no reaches the fallback and returns secondary: 'retry'. The explicit retry path only re-runs eligible markers, so this action can do nothing. Return a retry action only when failure.retryable === true, and update the absent-field expectation in src/renderer/src/components/native-chat-resume-failure-guidance.test.ts.
A chat that stopped being resumable between listing and acting (it finished on its own or is waiting on the user) was filed as a failure with no note in the chat. It now just spends the offer. A failed reattach now writes the same in-chat note as a refused continuation, so every filed failure explains itself in the chat. An unconfirmed continuation's failure retires once the chat shows the continuation's own message opened the newest turn. Co-Authored-By: Claude <[email protected]>
…chat moves on While a failed resume is listed, the restart store watches the host's status feed; when a failed chat's status or latest prompt changes after the list was read, it re-reads the host once. The host still decides whether the failure stands. Nothing is watched while nothing failed. The failure toast now counts only the requested chats the host still lists as failed, keeping the old count for a host that sends no list. Co-Authored-By: Claude <[email protected]>
… its unconfirmed failure Co-Authored-By: Claude <[email protected]>
… Orca couldn't reconnect A failed reattach, or a continuation refused because another window or terminal owns the session, now leaves a note saying Orca couldn't reconnect the chat instead of advising a send that would meet the same refusal. The restart list keeps the reason-specific advice. Co-Authored-By: Claude <[email protected]>
… or missing a reply The status-bar re-read no longer runs while a resume or dismiss is in flight, and its answer is dropped if one settled meanwhile, so a dismissed failure cannot come back. A change to a failed chat already seen always triggers it, whatever the host's timestamp says. A chat whose unconfirmed continuation the host already retired is now reported as resumed instead of saying nothing. Co-Authored-By: Claude <[email protected]>
…e in flight Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
ℹ️ No new issues in these commits — one comment-accuracy nitpick inline.
Reviewed changes
Reviewed 618fd9e and 1b151b9, the delta since the prior pullfrog review at 7517012.
- Files only the failures a user must act on.
settleno longer records anagent_session_resume_not_eligibleoutcome; a chat that stopped being resumable between listing and acting just spends its offer, and the now-unreachablenotEligibleguidance branch and string are removed. - Every filed failure explains itself in the chat. A reattach that fails before any continuation is attempted now writes the same in-chat
refusednote as a refused continuation, andnoteNotContinuedis narrowed to the two dependencies it uses. - An unconfirmed failure retires once its own message opens a turn.
failureAnsweredByChatreads the journal snapshot: a newer user message supersedes as before, and anunconfirmedrecord additionally retires when the newest root turn's user item resolves to the continuation's own submission (by submission key or provider key). - The status bar clears itself once the chat moves on. While a failure is listed, the renderer store watches the local status feed keyed on
status + latestPromptand does one debounced host re-read when a failed chat's summary is newer than the list. The host stays the judge, no stream opens while nothing failed, and the watch is released whenoffer.failedempties. - The failure toast counts only what the list can show.
announceRestartResultsfilters the not-continued ids to the host's own failure list, and a missing list (older host) keeps the old count with no Dismiss button. - Tests. New
failure-filingandfailed-chat-watchsuites; the ownership/interruption harness moves to a shared module; notification filtering is pinned. The five changed suites pass (69 tests).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| ) | ||
| for (const outcome of outcomes) { | ||
| const resumed = outcome.outcome === 'resumed' | ||
| // Ineligible means the chat moved on by itself (finished, or is waiting on the user), so there |
There was a problem hiding this comment.
not_eligible is broader than this comment claims: consumeMarker also returns false for a forked provider handle, an expired marker, or a record that is gone or unsupported by the adapter — not only "finished, or waiting on the user". Spending the offer and filing nothing is defensible for all of those, but the rationale here should name the general rule (the marker no longer describes resumable work) rather than one subset of it.
…t a nullable marker Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
ℹ️ No critical issues — one wording suggestion inline.
Reviewed changes
Reviewed 2662e8e, 48b99418, 449ce49f, b179005, and 5a18e95, the delta since the prior pullfrog review at 1b151b9.
- Ownership refusals no longer advise a send. A failed reattach and a continuation refused because another owner holds the session now write
AGENT_SESSION_RESTART_NOT_CONNECTED_NOTEinstead of the refused note;OWNERSHIP_REFUSALS(agent_session_conflict,agent_session_ownership_unknown,execution_owner_reconciling) selects which refusals get it, andnoteRestartRefusedis renamednoteRestartReattachFailed. - Failed-chat re-read is race-safe. The store's status-feed watch skips a re-read while a resume/dismiss is in flight (
actionsBegun/actionsSettled) and drops an in-flight read's answer if an action settled meanwhile, so a dismissed failure cannot be restored; a change to a chat already seen now triggers a re-read regardless of the host's timestamp. - Unconfirmed-but-retired chats reported as resumed.
announceRestartResultscountspending/unknownchats the host no longer lists as failed as resumed instead of saying nothing. - Tests. A new failure-filing case pins that an unjournaled continuation never retires its unconfirmed failure; new watch cases pin the in-flight guard and the stale-read drop; notifications pin the new count.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| /** For a chat Orca could not get hold of. Why decides the fix, which the restart list gives; advice | ||
| * to send a message would meet the same refusal. */ | ||
| export const AGENT_SESSION_RESTART_NOT_CONNECTED_NOTE = | ||
| "Orca couldn't reconnect this chat after the restart, so it didn't ask the agent to continue." |
There was a problem hiding this comment.
The stated cause is only true on the reattach-failure path. This note is also written for agent_session_conflict, agent_session_ownership_unknown, and execution_owner_reconciling, where the reattach succeeded and the send was refused because another process owns the session — so the chat tells the user it would not reconnect when it did.
Technical details
# Ownership refusals keep a note that names the wrong cause
## Affected sites
- `src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts:120-124` — `OWNERSHIP_REFUSALS` covers three codes whose fix is an existing owner process, not a failed reconnect.
- `src/main/native-chat/agent-session-wire/structured-agent-session-restart-continuation.ts:229-237` — selects `not-connected` for those reasons.
- `src/shared/agent-session-restart-continuation.ts:39-40` — the wording.
- `src/main/native-chat/agent-session-wire/structured-agent-session-refusal-message.ts:41-46` — canonical text for the same codes (an existing owner process / settlement in progress).
## Required outcome
- The chat note must not assert a reconnect failure for a refusal whose cause is a conflicting owner. Either reword the shared note so it is true on both paths, or let the ownership reasons carry their own message.
## Open questions for the human
- Is one generic note a deliberate trade for keeping the chat note reason-agnostic, with the restart list carrying the specific fix?…offer params The dismiss call now names sessions, so the older comment contradicted the schema below it. Co-Authored-By: Claude <[email protected]>
…n the action toast The post-action toast said "N chats couldn't be resumed" for chats whose continuation may well have gone out, while the list and the chat itself say Orca couldn't confirm it. That wording invites a duplicate "continue" send. Unconfirmed chats now get their own count, classified by the outcome the host filed, so the toast matches the row it points to. Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
ℹ️ No new issues in this commit — the failure toast now separates unconfirmed resumes from refusals, matching how the list already renders them. Earlier review threads remain open and unchanged.
Reviewed changes
Reviewed 32f357b, the delta since the prior pullfrog review at 5a18e95 (3c3db43 was a comment-only doc fix, recorded without a review).
- Unconfirmed resumes counted apart from refused ones.
announceRestartResultssplits the chats an action did not carry on into refused and unconfirmed: the host's filedoutcomedecides when the host still lists the chat, falling back to the continuation outcome (pending/unknown) otherwise. The toast titles the refused count with the unconfirmed count in its description, or titles the unconfirmed count when nothing was refused. - Host failure rows now reach the toast. The store forwards
result.failed(not just ids) intoannounceRestartResults, matching the newPick<ResumeFailure, 'sessionId' | 'outcome'>[]parameter. - Strings and tests.
notConfirmedOne/notConfirmedManyadded toen.json; the notifications suite gains a host-filed-unconfirmed case and an all-unconfirmed case, and the modal test's mixed case pins the split. Both changed suites pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…not retry A failed row the host marks unretryable could still be ticked, sending a resume that could only fail again; its checkbox is now disabled and it never joins the action. An older host that omits the flag keeps today's selectable row. The status bar no longer calls a chat "failed to resume" when the host only couldn't confirm the resume, matching the dialog's own wording, and the mixed toast's second line now says "other" so it cannot read as the same chat. Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
ℹ️ No new issues in this commit — the renderer stops offering Resume on a failure the host says cannot retry, and distinguishes an unconfirmed resume in the status bar and the mixed toast. Earlier review threads remain open and unchanged.
Reviewed changes
Reviewed f5040c2, the delta since the prior pullfrog review at 32f357b.
- Non-retryable failures are no longer resumable. A new
resumeFailureSelectable(failure)(retryable !== false) disables a failed row's checkbox and excludes it from the modal'schosen, so a tick made before the host marked the row unretryable cannot reach the action;resumeFailureGuidancenow reuses the same predicate for its Retry→Open/Dismiss override. An older host that omits the flag leaves the row selectable as before. - The status bar stops calling an unconfirmed resume failed. When any listed failure is
outcome: 'unconfirmed', the failure entry reads "N chats to check" (newcheckLabel*/checkTooltipstrings, worded to cover a refused and an unconfirmed row alike) instead of "N chats failed to resume". - The mixed toast no longer restates one chat. With both a refusal and an unconfirmed chat, the description is now "Couldn't confirm N other chat(s) was/were resumed" (
notConfirmedOtherOne/notConfirmedOtherMany). - Tests. The modal suite pins that an older host's row stays selectable, that a host-marked non-retryable row is disabled and dropped from
choseneven after a tick, and the footer's disabled state; the status-segment suite pins "2 chats to check" for a mixed list and the absence of "failed to resume".
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…g the capsule A failure record this build cannot parse (a newer outcome, say) made the whole recovery file unreadable, so a downgraded build listed no restart offers and could not record new teardowns. Failures are advisory: parse each one on its own and drop what does not parse. Co-Authored-By: Claude <[email protected]>
…r is skipped The skip-unreadable-failure test only covered an unknown outcome, so going back to the throwing marker parser for failure records still passed. A failure record usually outlives its offer entry, so a newer marker shape can appear only there. Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed 82f026d, the delta since the prior pullfrog review at f5040c2 — a hardening of the recovery capsule's read path.
- An unreadable failure record is skipped, not fatal.
capsuleSchema.failedbecomesz.unknown()(wasz.array(z.unknown())) andparseStatereads it through the newparseFailures, whichsafeParses each record and drops any whose shape this build cannot read — an unknown outcome, an out-of-range field, an unparseable marker — along with a non-arrayfailedvalue. Before this, a single bad record threw out ofparseState, costing every offer on the next read and failing every later teardown write; failures are advisory, so they now degrade one row at a time and are gone after the next write. Offers (parseEntry) still throw on invalid entries, which is the right asymmetry since an offer is not advisory. - Tests. Two capsule cases pin it: a file mixing a newer build's unknown-outcome record with a readable one keeps the offers and the readable failure, and a non-array
failedvalue reads as no failures. Both would throw against the prior parser, so they can genuinely fail.
The four earlier inline threads (the null-item ledger prune, the disabled "Resume 0 chats" footer, the not_eligible comment scope, and the ownership-refusal note wording) remain open and are unchanged by this commit.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed 327de43, the delta since the prior pullfrog review at 82f026d — a test-only addendum.
- A bad-marker fixture joins the unreadable-record case. The
skips a failure record it cannot read instead of rejecting the whole filecapsule case gains a second unreadable record whosemarker.triggeris'later'(only'quit'/'update'parse), so the marker branch ofparseFailuresis now exercised alongside the unknown-outcome branch. The assertions are unchanged and the readable record still survives, so the case genuinely pins the drop rather than absorbing whatever parses.
No production code changed in this commit. The four earlier inline threads remain open and are unchanged.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Review status: ready for merge review (head
|

ELI5
After Orca restarts it offers to resume the chats that were mid-turn. When one of those resumes did not work, the only sign was a four-second toast saying "1 chat could not be continued", with no name, and then the status bar entry vanished too. Now the failed chat stays named in the status bar and the resume dialog with one clear next step, the chat itself says what happened, and the entry clears on its own once the user replies in that chat.
What Changed
Before
After
Mechanism
agent-session-recovery.json, the agent carried on) or filed in a new optional top-levelfailedlist with the outcome (refused/unconfirmed), the reason code, the prompt the offer quoted, and the chat's newest user message at the moment that chat's own attempt ended.agentSession.restartResumable/restartContinuereturn a new optionalfailedlist (with an optionalretryableper row);agentSession.restartResumableDismissaccepts optionalsessionIds. All additive.status-warning*inmain.cssmirror thestatus-successfamily.Why
The failure was invisible because the outcome of the action was never stored anywhere: the reattach consumed the offer, the refusal lived only in a transient toast counter, and the chat recorded nothing. The common way to handle this is to record the failure on the chat itself so it clears naturally when the user's next turn starts; this PR does that (the in-chat note, and currency derived from the chat's own newest user message).
Deviation, stated plainly: Orca also keeps a small host-side index of failed chats in the recovery file, because nothing else can answer "which of my chats failed?" across another restart without reading every chat's journal. That index is deliberately not a second source of truth: whether each entry is current or retryable is re-derived from the chat on every read, and stale entries are pruned.
Alternatives considered:
While investigating the report I found the cause of the refusal in that case: on reattach, Claude Code replayed a queued background-task notification into the conversation, Orca journaled it as a new user turn, and the continuation was refused as
agent_session_restart_work_superseded. That guard treating a provider-injected item as newer user work is a separate bug and is not fixed here; this PR makes such a failure visible and actionable.Linked Issue
No issue was filed; reported directly by @BrennanKB5 after the 1.4.209 update restart.
Fixes #
Visual Proof
Before: a four-second toast reading "1 chat could not be continued. Open it to continue manually." and nothing in the status bar afterwards (the offer was spent by the reattach, so the "chats to resume" entry unmounted). Not captured live; the string and the vanishing entry are the code path this PR replaces.
After (hidden dev instance at
f5040c2f6d— later commits change only main-process parsing — on a throwaway profile, two real Claude chats that each completed a prompt, then one refused (agent_session_restart_work_superseded) and one unconfirmed failure recorded against them):Status bar with one refused and one unconfirmed failure:

Clicking it opens the resume dialog. Both rows name the chat and give one next step; neither can be retried here, so their checkboxes are disabled:

✕ on the unconfirmed row leaves only the refused chat, and the status bar reads "1 chat failed to resume":

Open chat, then reply in it. Before the reply:

After the reply is accepted, the status bar entry is gone with no click, and the host lists no failures:

Testing
Exercised on macOS in hidden Electron dev instances (
ORCA_BACKGROUND_LAUNCH=1, own profile and CDP port), driven through the real surfaces:failedlist within seconds, without clicking anything.Not exercised live: a real mid-turn restart followed by a refused continuation (the in-chat note and filing for that path are covered by host tests), and Retry against a real ownership conflict. SSH hosts: the restart-resume RPCs are local-only today, unchanged by this PR. Linux and Windows: no platform-specific code; not run.
Automated (each central mechanism was also checked by removing it and confirming the named test fails):
agent-session-recovery-capsule.test.ts: filing, retry-by-name only, a retried failure survives rollback and lease expiry, newer teardown supersedes a failure, dismiss by name, TTL expiry, and a file written by this build parsed with the older build's schema.structured-agent-session-restart-failure-filing.test.ts/-ownership.test.ts/-continuation.test.ts: the reported superseded case is filed, listed, and noted in the chat; a chat that finished on its own is not filed; a reply before or after the chat's own attempt retires its failure; unconfirmed failures retire once the continuation's turn opens, and not when it was never journaled; reattach and ownership refusals get the neutral note.native-chat-resume-failed-chat-watch.test.ts: the store re-reads when a failed chat moves on, coalesces, skips during an in-flight action, and never lets a slow read bring back a dismissed failure.NativeChatResumeOnRestartModal.test.tsx,NativeChatResumeStatusSegment.test.tsx,native-chat-restart-action-notifications.test.ts,native-chat-resume-failure-guidance.test.ts: dialog rows and selection, status-bar labels, toast counts and actions, reason → action table.tests/e2e/cross-version-wire: the stub host gains the failure listing the restart RPC now reaches.pnpm tc, oxlint on every changed file, and the surrounding test directories pass locally; CI is green.AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
failedkey, so its restart offers keep working; it drops the failure records the next time it rewrites the file.sessionIdsrequest field are optional. The client names sessions only for rows a host listed as failed, which an older host never does. Mobile does not call these methods.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)