Skip to content

Offer to resume chats after managed server updates - #28978

Merged
brennanb2025 merged 53 commits into
mainfrom
brennanb2025/wslchat-pr7
Oct 26, 2026
Merged

brennanb2025 merged 53 commits into
mainfrom
brennanb2025/wslchat-pr7

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1388 $\color{#cf222e}{\Huge{\mathbf{−}}}$​46 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1342
Prod 35 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1467 $\color{#cf222e}{\Huge{\mathbf{−}}}$​541 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​926

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:

  • Intended: an explicit per-desktop/all-server choice handles several desktops paired to one server. Creator history is local presentation data, never server authority or an update gate.
  • Intended: dismissing a remote offer snoozes it on that desktop; it does not remove another desktop's offer. The server desktop's existing local resume/dismiss behavior still acts on the shared markers.
  • Intended: clean-shutdown markers drive the offer. Older servers and the first upgrade from a server without those markers retain per-chat Continue. Chats created before this desktop recorded their origin appear under the all-server choice. A failed history save preserves current-process attribution but can lose that grouping after desktop restart.
  • Intended: existing eligibility, duplicate-action and provider-start rules remain on the host. Remote updates do not wait for native-chat work.
  • Intended: if a resume reply is lost, the summary says the result could not be confirmed and offers Review. A later host failure is not proof of that particular action. The unconfirmed summary remains until it has been viewed and closed; dismissing a local failure row does not erase that action history.
  • Intended: remote resume has a finite allowance for provider startup and dispatch. Already-sent work may continue after the client times out or the server connection changes; an uncertain result is not automatically retried.

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 commit fb2798924b18b8247d85eb1bd7267fd38fbc0c75 and main merges 3d2838d9b1ae71c720b0bbfdc798e6e3d6fe4d85 and 2596ee101bce05f1341d37459906b6b73fc69352; the real QA production artifact is e69b4478e7ab512bf80cb91e7f7e9b487cbc7338.

Title-only follow-up e8e53a0518d0418987b964f1f958f04e1cc1b6b5 changes 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.tsx passed 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 from e69b4478e7ab512bf80cb91e7f7e9b487cbc7338; 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.

remote-resume-full-window.png

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+b04883111e26 and source 8432e593d44926d4d5e8fc53b4d4ebdc879f0dc3, whose full tree equals reviewed merge 3d2838d9b1ae71c720b0bbfdc798e6e3d6fe4d85. The desktop is the accepted e69b4478e7ab512bf80cb91e7f7e9b487cbc7338 artifact. 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):

ssh-final-cycle1-b-offer.png
ssh-final-cycle2-a-offer-branch.png
ssh-final-cycle1-final-replies.png
ssh-final-cycle2-repeat-replies.png

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.

baseline-claude-reply.png
upgrade-resume-dialog.png
upgrade-claude-baseline-comparison.png
paired-resume-a-offer.png
compat-a-old-final.png
compat-b-final-replies.png

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.

Windows native resume offer
Windows native Codex retained reply
Windows native Claude retained and second reply

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-dismiss-offer.png
local-dismiss-codex-status.png
local-dismiss-claude-status.png
local-dismiss-claude-reply.png
local-dismiss-codex-continuation-reply.png

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.

local-explicit-offer-on.png
local-explicit-claude-reply.png
local-explicit-codex-reply.png
local-auto-claude-reply.png
local-auto-codex-reply.png

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.

after-update-before-touch.png
resume-summary.png
codex-metadata-final-reply.png
claude-final-reply.png

@brennanb2025

brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

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 e8e53a0518d0418987b964f1f958f04e1cc1b6b5 changes only the remote resume dialog title to “{{machine}} restarted,” following Brennan’s “Lead with the restart” ruling. The body and buttons are unchanged. Prior merge head 2596ee101bce05f1341d37459906b6b73fc69352 passed full CI. A new blocking GitHub conflict required another main merge; the required merge hook passed, and independent narrow review accepted all ten resolutions and automatic merges. Feature behavior, performance contracts, and 1,467 production additions are retained. Accepted QA on production artifact e69b4478e7ab512bf80cb91e7f7e9b487cbc7338 carries across test-only commit fb2798924b18b8247d85eb1bd7267fd38fbc0c75 and main merges 3d2838d9b1ae71c720b0bbfdc798e6e3d6fe4d85 and 2596ee101bce05f1341d37459906b6b73fc69352.

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 0.1.0+b04883111e26 and source 8432e593d44926d4d5e8fc53b4d4ebdc879f0dc3, whose full tree equals reviewed merge 3d2838d9b1ae71c720b0bbfdc798e6e3d6fe4d85. The desktop is the accepted e69b4478e7ab512bf80cb91e7f7e9b487cbc7338 artifact. 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. The invalid stock packaging experiment remains excluded and no packaging defect is attributed to main or this branch.

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.

ssh-final-cycle1-b-offer.png
ssh-final-cycle2-a-offer-branch.png
ssh-final-cycle1-final-replies.png
ssh-final-cycle2-repeat-replies.png

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.

baseline-claude-reply.png
upgrade-resume-dialog.png
upgrade-claude-baseline-comparison.png
paired-resume-a-offer.png
compat-a-old-final.png
compat-b-final-replies.png

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.

Windows native resume offer
Windows native Codex retained reply
Windows native Claude retained and second reply

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-dismiss-offer.png
local-dismiss-codex-status.png
local-dismiss-claude-status.png
local-dismiss-claude-reply.png
local-dismiss-codex-continuation-reply.png

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.

local-explicit-offer-on.png
local-explicit-claude-reply.png
local-explicit-codex-reply.png
local-auto-claude-reply.png
local-auto-codex-reply.png

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.

after-update-before-touch.png
resume-summary.png
codex-metadata-final-reply.png
claude-final-reply.png

Title-only follow-up e8e53a0518d0418987b964f1f958f04e1cc1b6b5 changes 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.tsx passed 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 from e69b4478e7ab512bf80cb91e7f7e9b487cbc7338; 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.

remote-resume-full-window.png

@OrcaWin

OrcaWin commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • B1 deferral wording on an older server PASS: the host row reads in plain words: "Update to 0.1.0+4c82c0604363 deferred. Not done: terminals on this server are still running. Close them and try again. On older servers that cannot check for running chats, Force update stops any running chat. Finish chats first; you can continue an interrupted chat after the update." It has Update, Force update and Remove buttons and no error codes.
  • B1 Force update during a real Claude turn PASS (with a caveat): Force update stopped the turn's running work, the server moved to the new version, and the same chat then continued and answered (CONTINUED=7854). Caveat: Claude Code had moved the long sleep into a background task, so what Force stopped was that background task rather than a foreground step.
  • B2 running-chat deferral on a current server PASS: the row reads "Update to 0.1.0+4c82c0604363 deferred. Chats on this server still have work to finish. Let them finish or respond to their prompts, then choose Update or reconnect to retry." There is no Force button. After the chat finished, Update applied and the same chat continued (CONT2=13075).
  • B3 new chat from the new-tab "+" menu PASS: opening the chat created no conversation; the first send created exactly one, and it answered "entry-1-ok".
  • B3 new chat from an empty workspace BLOCKED: that entry was not reachable, because closing the last tab deselects the workspace and reselecting it creates a terminal automatically. No other chat entry (context menu, app menu, command palette) was found.

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.

Older-server deferral row:
28978-B1-1-deferred-row.png

Same chat continuing after Force update:
28978-B1-5-chat-continued.png

Running-chat deferral row on a current server:
28978-B2-1-chat-deferral-row.png

Final head 580de376221ebed5fc2ae8498764e117eef3c05f = QA'd head 66c0c8cca4b plus main merges and one test-only fix; CI green on it.

# 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
@brennanb2025
brennanb2025 marked this pull request as ready for review October 19, 2026 05:59
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 59efcea9-e28e-4d0f-80d0-7b8665ecd9d3
📥 Commits

Reviewing files that changed from the base of the PR and between 0a801d4 and 1486d94.

📒 Files selected for processing: 1
  • src/main/managed-server/host-state/orcad-windows-host-lane.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

The changes add chat-work census data and restart admission for managed-server updates. The host tracks pending work, drains eligible providers, and reserves shutdown before an incumbent restart. Deployment paths use reservation outcomes when proceeding with updates. The CLI and settings UI add chat-specific deferral messages and older-host Force controls.

Priority: Normal

Merge Risk: Minimal · up to 1486d

No actionable merge-blocking risk is established by this test-only change.

Pre-merge checks: Passed 2 · Failed 3

Failed Failed checks: 3 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 42.55% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 58 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check Warning The title describes offering to resume chats, but the changes primarily prevent unsafe restarts by detecting chat work, deferring updates, and coordinating restart admission. No resume-chat offer is s… Use a title that describes the implemented change, such as "Defer managed-server updates while native chat work is active".
Description check Warning The pull request description is detailed but does not follow the required template and primarily describes a remote native-chat resume feature, not the restart-admission changes shown in the pull requ… Rewrite the description using every required template section. Describe the restart-admission, chat-work detection, update deferral, Force behavior, stop-request, SSH, WSL, and Windows changes that this pull request actually implements. Add…
Passed Passed checks: 2 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title describes offering to resume chats, but the changes primarily prevent unsafe restarts by detecting chat work, deferring updates, and coordinating restart admission. No resume-chat offer is shown in the changeset.

Resolution

Use a title that describes the implemented change, such as "Defer managed-server updates while native chat work is active".

Full details: Description check

Explanation

The pull request description is detailed but does not follow the required template and primarily describes a remote native-chat resume feature, not the restart-admission changes shown in the pull request objectives and file summary. It omits the required ELI5, What Changed, Why, Linked Issue, Testing checklist, AI Disclosure, Review, Notes, and Checklist sections.

Resolution

Rewrite the description using every required template section. Describe the restart-admission, chat-work detection, update deferral, Force behavior, stop-request, SSH, WSL, and Windows changes that this pull request actually implements. Add the linked issue, testing commands and platforms, visual proof or an explicit N/A, AI disclosure when applicable, review notes, cross-platform and compatibility considerations, and checklist status.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b582f44-e6c3-4a9c-a8e3-2fd8f044cb9e
📥 Commits

Reviewing files that changed from the base of the PR and between 2b07f0f and c74dac3.

⛔ Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing: 58
  • config/scripts/orcad-daemon-protocol-crossing.test.mjs
  • src/cli/command-scoped-flag-help.ts
  • src/cli/specs/managed-server.ts
  • src/main/daemon/daemon-pty-session-spawn.ts
  • src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts
  • src/main/managed-server/activation/orcad-activation-host-test-harness.ts
  • src/main/managed-server/activation/orcad-activation-readiness-fixture.ts
  • src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-auto-update.ts
  • src/main/managed-server/lifecycle/orcad-managed-runtime-context.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-attach-orchestration.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-create.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-entry-delegates.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-idle-sweep.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-idle-sweep.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-mutation-admission.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-restart-admission.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-task-queue.ts
  • src/main/orcad/orcad-entry.ts
  • src/main/orcad/orcad-restart-admission.test.ts
  • src/main/orcad/orcad-restart-admission.ts
  • src/main/orcad/orcad-restart-work-admission.ts
  • src/main/orcad/orcad-stop-request-listener.test.ts
  • src/main/orcad/orcad-stop-request-listener.ts
  • src/main/orcad/orcad-terminal-census.test.ts
  • src/main/orcad/orcad-terminal-census.ts
  • src/main/providers/local-pty-provider.ts
  • src/main/runtime/rpc/methods/orcad-terminal-census.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-restart-admission-activation.test.ts
  • src/main/ssh/orcad-restart-admission-client.test.ts
  • src/main/ssh/orcad-restart-admission-client.ts
  • src/main/ssh/orcad-runtime-maintenance.test.ts
  • src/main/ssh/orcad-runtime-maintenance.ts
  • src/main/ssh/orcad-snapshot-room.test.ts
  • src/main/ssh/orcad-terminal-census-client.test.ts
  • src/main/ssh/orcad-terminal-census-client.ts
  • src/main/ssh/orcad-transaction-incumbent.ts
  • src/main/ssh/orcad-update-plan.test.ts
  • src/main/ssh/orcad-update-plan.ts
  • src/main/wsl/wsl-orcad-deploy.test.ts
  • src/main/wsl/wsl-orcad-deploy.ts
  • src/main/wsl/wsl-orcad-incumbent.test.ts
  • src/main/wsl/wsl-orcad-incumbent.ts
  • src/main/wsl/wsl-orcad-real-distro-lane.test.ts
  • src/renderer/src/components/settings/ManagedServerRow.test.tsx
  • src/renderer/src/components/settings/ManagedServerRow.tsx
  • src/renderer/src/components/settings/WslHostsSection.tsx
  • src/renderer/src/components/settings/managed-server-copy.test.ts
  • src/renderer/src/components/settings/managed-server-copy.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/orcad-restart-admission.ts
  • src/shared/orcad-runtime-capabilities.ts
  • src/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.

Comment thread src/main/orcad/orcad-stop-request-listener.ts Outdated
…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.
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.
@brennanb2025 brennanb2025 changed the title Keep running chats safe during managed server updates Offer to resume chats after managed server updates Oct 22, 2026
@brennanb2025
brennanb2025 merged commit bfc633a into main Oct 26, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants