Repository navigation
Offer to resume chats after managed server updates - #28978
Conversation
|
When a paired server restarted during native-chat work, each desktop had to reopen interrupted chats and press Continue individually. The server did not record interrupted work through the local desktop's shutdown path, and reconnecting desktops had no shared resume dialog. The change offers each desktop a choice to resume eligible chats it started or all eligible chats on the restarted server. Updates interrupt chats normally and do not wait for native-chat work. Ordinary paired desktop servers use the same offer after quitting and relaunching. Current status: review, required evidence and current-head CI complete. Current head Fixed and verified in review: four source-review rounds covered shared recovery state across server restarts, removed environments, failed reads, filtered selections, chunked requests, uncertain results, and shutdown ordering. The source changes total 1,467 added production lines. The final mechanism comparison is complete. Four repeatable performance contracts now exercise the actual history, discovery, status/resume, and shutdown triggers at two population sizes; all 31 named tests passed, and independent review accepted them. Accepted real QA: two independent SSH desktops survived actual managed updates that cut off real Claude and Codex work, reconnected with their own/all-chat choices, and resumed into real replies in the original chats. Dismissal stayed local to each desktop. Previous-build upgrade preserved saved Claude/Codex chats, choices and a local folder chat. Both mixed-version directions, ordinary paired-desktop restart, CLI recovery and orchestration completion have accepted evidence. Native Windows now passed the previous-build Git/folder upgrade, rendered Resume action, all four original provider IDs and real replies, with second ordinary replies in both Git chats. Accepted WSL QA: WSL evidence is accepted for a real feature-capable server update that interrupted active Claude and Codex tools, automatically reconnected, displayed both own/all two-chat choices, and resumed both original provider conversations into real replies. The installed server reported Claude and Codex represent the shared lifecycle code in required agent coverage. This PR changes no agent-specific folder or provider adapter, so additional agents are not required. Accepted earlier comparisons with other agents are retained as historical evidence. The unchanged phone reconnect/send consumer is covered by two named mobile test files (36 tests passed; unchanged-flow evidence carries across the later main merges). Full exact-head unit CI covers the unchanged headless quit, folder grouping/target activation, and main-process provenance contracts. These replace additional live permutations under the current QA rules; they are not claims that those live runs happened. The full desktop web targeted run found a pre-existing unsupported native-chat consumer, disclosed below. Deferred and known issues: creator history still serializes its whole retained snapshot, and a nonempty server discovery copies the creator-history union; these remain accepted performance follow-up work. Opening a recovery result in its current workspace can leave Activity visible, and an existing detail tooltip can expose a raw failure reason; these remain deferred. OpenCode and OpenCode2 can refuse their first ordinary message after relaunch on both main and this branch; one unchanged resend replies in the same chat (STA-11503). The separate existing model-switch issue is tracked in #31927; QA preserves the original model. For Brennan's review: the accepted SSH screenshots below show the per-desktop/all-chat offer and real resumed replies. The screenshots below show accepted flows; the WSL proof is appended after the local recovery proof. Additional accepted proof uses the production-identical final artifact. The first three images show a chat created by the previous build, the branch offering to resume it after upgrade, and a real reply in that retained chat. The fourth shows an ordinary paired desktop offering two chats started here or all five on the server. The last two show real replies across the mixed-version combinations; they are not additional update-cutoff claims. Native Windows retained-state upgrade: the rendered offer selected the two interrupted Git chats; Resume restored both. Claude and Codex kept their original provider IDs and returned real replies. Completed folder chats also retained their IDs and replied after upgrade. Baseline and final branch quit gracefully; a debugger-port setup failure required a relaunch before branch UI inspection. Isolated QA packages used disclosed unpacked runtime/resource adjustments; this is functional recovery evidence, with no stock release-packaging verdict. Local Dismiss and per-chat recovery were exercised after a genuine graceful restart interrupted foreground work in both retained conversations. Dismiss left both chats interrupted with Continue available across navigation. Claude continued in its original session, then a normal Stop and follow-up produced the real reply. Codex's original continuation completed naturally in its original thread after 20m19s; no Stop or repair message was sent to it. That delay and the setup harness refusal while preparing the next interruption are preserved in the QA report. Explicit preference-ON resume and the following automatic resume are accepted below. WSL is also accepted as described above. Local explicit Resume with “Don’t ask again” enabled and the following automatic resume both completed after genuine graceful restarts interrupted active work. Claude and Codex retained their original provider conversation IDs and returned direct real replies after each restart; no Stop or follow-up repair was needed. Expired preparation requests were repeated before the successful interruptions and are excluded from the result. The desktop web client can't resume native chats on main today (it doesn't support native chat sessions). This PR doesn't change that, and web shows no resume offer, as before. The targeted browser run reconnected after a real host restart but returned Accepted WSL proof: the automatic own/all offer, the completed two-chat Resume summary, and real replies in the original Codex and Claude conversations. The managed update used the disclosed production API fallback. Title-only follow-up Continued review accepted the production copy. Nonblocking P2 deferred: the changed renderer assertion searches document body text, which also contains “Server restarted” in the description; a heading-scoped assertion would pin the title. The screenshot directly verifies the heading. |
|
Windows QA for head 66c0c8c (Windows high spec, real signed-in Claude Code 2.1.302 inside a throwaway WSL2 distro, Codex driving the UI over CDP) Final head 65f151a = QA'd head 66c0c8c plus a main merge (and one test updated to main's helper-work reporting); CI green on it
Side notes (not this PR's change, but it shows up in this PR's row): after Force update or Update, the host row keeps saying "Update to … deferred." even after navigating away and back, although the host status no longer has a deferred update. The renderer's WSL host store ignores a status update when only the deferred update changed. Also, turning auto-name chats off on the desktop does not stop chats on a WSL host from running a separate Claude naming call inside the distro. Same chat continuing after Force update: Running-chat deferral row on a current server: Final head |
# Conflicts: # src/main/managed-server/activation/orcad-activation-host-test-harness.ts # src/main/native-chat/agent-session-wire/structured-agent-session-host.ts # src/main/ssh/orcad-remote-deploy.ts # src/main/ssh/orcad-runtime-maintenance.test.ts # src/main/ssh/orcad-runtime-maintenance.ts # src/main/ssh/orcad-terminal-census-client.ts # src/main/ssh/orcad-transaction-incumbent.ts # src/main/wsl/wsl-orcad-incumbent.test.ts # src/shared/rpc-contract/rpc-params-catalog.generated.ts
|
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:
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Priority: Merge Risk:
|
# Conflicts: # src/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.ts # src/main/native-chat/agent-session-wire/structured-agent-session-host.ts # src/main/runtime/rpc/methods/structured-agent-session-adoption-replay.test.ts
# Conflicts: # src/main/ssh/orcad-remote-deploy.test.ts
Main's room tests deployed over a serving incumbent with a census that has no chat work count and no restart admission, so the update deferred before the room probe ran. Give them the same idle census and slot admission as the other activation tests, and pin the probe before the reservation instead of before the recount it replaced.
# Conflicts: # src/main/native-chat/agent-session-wire/structured-agent-session-attach-orchestration.ts # src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
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:
3b582f44-e6c3-4a9c-a8e3-2fd8f044cb9e
⛔ Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing: 58
config/scripts/orcad-daemon-protocol-crossing.test.mjssrc/cli/command-scoped-flag-help.tssrc/cli/specs/managed-server.tssrc/main/daemon/daemon-pty-session-spawn.tssrc/main/managed-server/activation/orcad-activation-crash-recovery.test.tssrc/main/managed-server/activation/orcad-activation-host-test-harness.tssrc/main/managed-server/activation/orcad-activation-readiness-fixture.tssrc/main/managed-server/host-state/orcad-state-mutation-timeout.test.tssrc/main/managed-server/lifecycle/orcad-managed-auto-update.tssrc/main/managed-server/lifecycle/orcad-managed-runtime-context.tssrc/main/native-chat/agent-session-wire/structured-agent-session-attach-orchestration.tssrc/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.tssrc/main/native-chat/agent-session-wire/structured-agent-session-create.tssrc/main/native-chat/agent-session-wire/structured-agent-session-entry-delegates.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host.tssrc/main/native-chat/agent-session-wire/structured-agent-session-idle-sweep.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-idle-sweep.tssrc/main/native-chat/agent-session-wire/structured-agent-session-mutation-admission.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-admission.tssrc/main/native-chat/agent-session-wire/structured-agent-session-task-queue.tssrc/main/orcad/orcad-entry.tssrc/main/orcad/orcad-restart-admission.test.tssrc/main/orcad/orcad-restart-admission.tssrc/main/orcad/orcad-restart-work-admission.tssrc/main/orcad/orcad-stop-request-listener.test.tssrc/main/orcad/orcad-stop-request-listener.tssrc/main/orcad/orcad-terminal-census.test.tssrc/main/orcad/orcad-terminal-census.tssrc/main/providers/local-pty-provider.tssrc/main/runtime/rpc/methods/orcad-terminal-census.tssrc/main/ssh/orcad-installed-activation.tssrc/main/ssh/orcad-remote-deploy.test.tssrc/main/ssh/orcad-remote-deploy.tssrc/main/ssh/orcad-restart-admission-activation.test.tssrc/main/ssh/orcad-restart-admission-client.test.tssrc/main/ssh/orcad-restart-admission-client.tssrc/main/ssh/orcad-runtime-maintenance.test.tssrc/main/ssh/orcad-runtime-maintenance.tssrc/main/ssh/orcad-snapshot-room.test.tssrc/main/ssh/orcad-terminal-census-client.test.tssrc/main/ssh/orcad-terminal-census-client.tssrc/main/ssh/orcad-transaction-incumbent.tssrc/main/ssh/orcad-update-plan.test.tssrc/main/ssh/orcad-update-plan.tssrc/main/wsl/wsl-orcad-deploy.test.tssrc/main/wsl/wsl-orcad-deploy.tssrc/main/wsl/wsl-orcad-incumbent.test.tssrc/main/wsl/wsl-orcad-incumbent.tssrc/main/wsl/wsl-orcad-real-distro-lane.test.tssrc/renderer/src/components/settings/ManagedServerRow.test.tsxsrc/renderer/src/components/settings/ManagedServerRow.tsxsrc/renderer/src/components/settings/WslHostsSection.tsxsrc/renderer/src/components/settings/managed-server-copy.test.tssrc/renderer/src/components/settings/managed-server-copy.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/orcad-restart-admission.tssrc/shared/orcad-runtime-capabilities.tssrc/shared/orcad-terminal-census.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
…onversation is closed The restart check counted a start only while its conversation stayed open, so an idle close during a stalled start let a managed update through. Every tracked attach, create, start and open now counts as restart work in the same tracker that counts the session queue.
# Conflicts: # src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts # src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts # src/main/ssh/orcad-installed-activation.ts # src/main/ssh/orcad-remote-deploy.test.ts # src/main/ssh/orcad-remote-deploy.ts # src/main/ssh/orcad-runtime-maintenance.ts # src/main/ssh/orcad-snapshot-room.test.ts # src/main/wsl/wsl-orcad-deploy.ts # src/main/wsl/wsl-orcad-incumbent.test.ts # src/main/wsl/wsl-orcad-incumbent.ts
…mit once formatted Main's copy sat at 400 lines only because one line was left unformatted; the merge's formatter pushed it to 401. Inlining the one-use question list keeps it at 400 with identical behavior.
…lient's empty request waits for idle Stopping a slot and restarting it for an older client's update were both an empty .orcad-stop-request file, so routing that file through restart admission let a crash recovery, stranded-setup release or rejected-candidate rollback leave the server running. New clients now write "stop-now" into the request (renamed in whole), which stops at once as before; an empty or unrecognized request takes the chat-safe restart, and a deferred restart logs why. Also gives the restart admission activation fixtures the now-required recount.
… holds the new file Renaming the just-written stop-now request can briefly fail with EPERM, EACCES or EBUSY on Windows; the stop now retries those with the same bounded delays as record-publish instead of answering SIGNAL_FAILED and leaving the server up.
# Conflicts: # src/renderer/src/components/settings/ManagedServerRow.tsx # src/renderer/src/components/settings/WslHostsSection.tsx # src/renderer/src/i18n/locales/en.json
# Conflicts: # src/main/ssh/hostile-host-test-support/ssh-hostile-host-managed-orcad.ts
Main's #29834 terminal-admission fence and this PR's restart reservation are kept side by side (three-model panel, unanimous): a capable host ends itself through reserve/commit with no fenced recount; an explicit Force of a host older than restart admission recounts with the fence, reopens it after every abandoned attempt and when no stop was sent, and keeps main's 45s stop deadline.
… calls its own method
Brennan ruled on 10-21 that a managed server update never waits for, counts or refuses native chat work: it restarts and cuts agents off like a local update, and each desktop is offered a resume afterwards. This merge takes current main for every file, so the restart reservation, chat-work counting, refusal gates, deferral and Force UI, and the stop-now stop-file contract are gone, and terminal behavior on update is exactly main's. The resume offer follows.
The dialog can appear out of nowhere when another desktop updates a shared server, so its title now says what happened: "<machine> restarted".































When a paired server restarted during native-chat work, each desktop had to reopen interrupted chats and press Continue individually. The server process did not run the same shutdown snapshot path as the local desktop, and the reconnecting desktop had no aggregate recovery offer.
This change offers the existing resume dialog after a paired server reconnects. The remote dialog leads with “{{machine}} restarted,” then offers the existing resume choices. Each desktop can resume the eligible chats it started, or all eligible chats on that server. Updates and restarts interrupt active chats as usual; native chats do not add a wait or admission check. Ordinary paired desktop servers use the same offer after quitting and relaunching, alongside managed SSH and WSL servers.
The server reuses the local shutdown markers and continuation runner. Desktop creation history supplies the “started here” grouping, shared across its windows, and saves in the background without holding chat creation. Recovery presentation belongs to one server occurrence, so a later restart gets a fresh offer and retired reads or actions cannot affect its successor. Large selections use sequential requests through the existing API, with one result summary.
Differences from the common pattern:
The full workflow previously passed on merge head
2596ee101bce05f1341d37459906b6b73fc69352: https://github.com/stablyai/orca/actions/runs/40219312491. GitHub reported a blocking conflict again, so main was merged under the conflict exception. The required merge hook passed, and an independent narrow review confirmed that the accepted feature behavior and performance contracts survived. Production additions remain 1,467. Accepted unchanged-flow QA carries across the test-only commitfb2798924b18b8247d85eb1bd7267fd38fbc0c75and main merges3d2838d9b1ae71c720b0bbfdc798e6e3d6fe4d85and2596ee101bce05f1341d37459906b6b73fc69352; the real QA production artifact ise69b4478e7ab512bf80cb91e7f7e9b487cbc7338.Title-only follow-up
e8e53a0518d0418987b964f1f958f04e1cc1b6b5changes the remote resume dialog title to “{{machine}} restarted” under Brennan’s “Lead with the restart” ruling. The body/buttons, local title and lifecycle behavior are unchanged. This flow is the QA table’s light UI/copy tests row (qa=tests):NativeChatRemoteResume.test.tsxpassed 25/25 as reported by the author, exact-head CI passed (https://github.com/stablyai/orca/actions/runs/40235414636), and one accepted branch screenshot shows the actual remote dialog with fixture state and no agents. The first capture hit a temporary dev-harness HTTP404; the launch config was repaired and the same screenshot scenario passed. All copies, drivers and helpers stopped; real-config hashes were unchanged. Existing lifecycle and reference evidence carries frome69b4478e7ab512bf80cb91e7f7e9b487cbc7338; no lifecycle replay was performed.Continued review accepted the production copy. Nonblocking P2 deferred: the changed renderer assertion searches document body text, which also contains “Server restarted” in the description; a heading-scoped assertion would pin the title. The screenshot directly verifies the heading.
Real QA has accepted evidence for two desktops using a managed SSH server: updates interrupted real Claude and Codex work, both desktops reconnected with their own/all-chat choices, dismissal stayed local, and resuming produced real replies in the same chats. The real previous-build upgrade preserved Claude/Codex chats, choices and a local folder chat through explicit resume. Both mixed-version directions and an ordinary paired-desktop restart also produced real same-chat replies. Native Windows now also passed retained-state upgrade: baseline-created Git and folder chats kept all four provider IDs and replied on the branch, and the rendered two-chat Resume action worked. Local Dismiss, explicit Resume with the saved preference enabled, and the next automatic resume also have accepted evidence. WSL evidence is accepted for a real feature-capable server update that interrupted active Claude and Codex tools, automatically reconnected, displayed both own/all two-chat choices, and resumed both original provider conversations into real replies. The installed server reported
0.1.0+b04883111e26and source8432e593d44926d4d5e8fc53b4d4ebdc879f0dc3, whose full tree equals reviewed merge3d2838d9b1ae71c720b0bbfdc798e6e3d6fe4d85. The desktop is the acceptede69b4478e7ab512bf80cb91e7f7e9b487cbc7338artifact. The update used the explicitly authorized production API fallback because the ready host had no rendered Update action; this is not rendered-Update coverage. The first markerless-to-feature transition was setup only. The copy quit gracefully, all recorded drivers exited, the idle distro never started, and real config hashes were unchanged. Final records were recovered after remote control failed; the old checkout’s full lead report was missing, so acceptance uses the preserved driver report, histories, phase result, launcher log, cleanup records and screenshots. Historical preparation failures and a provider-selected process-list command are recorded; no extra update or replay was performed. Desktop web is disclosed below as an unsupported existing consumer.Claude and Codex represent the shared lifecycle code in required agent coverage. This PR changes no agent-specific folder or provider adapter, so additional agents are not required. Accepted earlier comparisons with other agents are retained as historical evidence. All required changed-flow coverage is complete.
The unchanged phone reconnect/send consumer is covered by two named mobile test files (36 tests passed; unchanged-flow evidence carries across the later main merges). Full exact-head unit CI covers the unchanged headless quit, folder grouping/target activation, and main-process provenance contracts. These replace additional live permutations under the current QA rules; they are not claims that those live runs happened. The full desktop web targeted run found a pre-existing unsupported native-chat consumer, disclosed below.
Known main issue, tracked in STA-11503: the first message after relaunch can be refused in OpenCode and OpenCode2; one unchanged resend then replies in the same chat. The local comparison reproduced the same first-send refusal and unchanged-resend recovery on both main and this branch. This PR does not change the provider startup mechanism. A separate existing model-change issue is tracked in #31927; QA preserves the original model when exercising its restart/resume flow.
Accepted SSH proof (final production head):
Additional accepted proof uses the production-identical final artifact. The first three images show a chat created by the previous build, the branch offering to resume it after upgrade, and a real reply in that retained chat. The fourth shows an ordinary paired desktop offering two chats started here or all five on the server. The last two show real replies across the mixed-version combinations; they are not additional update-cutoff claims.
Native Windows retained-state upgrade: the rendered offer selected the two interrupted Git chats; Resume restored both. Claude and Codex kept their original provider IDs and returned real replies. Completed folder chats also retained their IDs and replied after upgrade. Baseline and final branch quit gracefully; a debugger-port setup failure required a relaunch before branch UI inspection. Isolated QA packages used disclosed unpacked runtime/resource adjustments; this is functional recovery evidence, with no stock release-packaging verdict.
Local Dismiss and per-chat recovery were exercised after a genuine graceful restart interrupted foreground work in both retained conversations. Dismiss left both chats interrupted with Continue available across navigation. Claude continued in its original session, then a normal Stop and follow-up produced the real reply. Codex's original continuation completed naturally in its original thread after 20m19s; no Stop or repair message was sent to it. That delay and the setup harness refusal while preparing the next interruption are preserved in the QA report. Explicit preference-ON resume and the following automatic resume are accepted below. WSL is also accepted as described above.
Local explicit Resume with “Don’t ask again” enabled and the following automatic resume both completed after genuine graceful restarts interrupted active work. Claude and Codex retained their original provider conversation IDs and returned direct real replies after each restart; no Stop or follow-up repair was needed. Expired preparation requests were repeated before the successful interruptions and are excluded from the result.
The desktop web client can't resume native chats on main today (it doesn't support native chat sessions). This PR doesn't change that, and web shows no resume offer, as before. The targeted browser run reconnected after a real host restart but returned
structured_agent_session_unsupported; Resume All and web replies were not exercised and are not reported as passing. The deciding capability and refusal code is identical to main.Accepted WSL proof: the automatic own/all offer, the completed two-chat Resume summary, and real replies in the original Codex and Claude conversations. The managed update used the disclosed production API fallback.