Skip to content

Keep running chats safe during managed server updates - #28978

Open
brennanb2025 wants to merge 32 commits into
mainfrom
brennanb2025/wslchat-pr7
Open

brennanb2025 wants to merge 32 commits into
mainfrom
brennanb2025/wslchat-pr7

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​715 $\color{#cf222e}{\Huge{\mathbf{−}}}$​91 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​624
Prod 48 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1226 $\color{#cf222e}{\Huge{\mathbf{−}}}$​179 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1047

ELI5

A managed Orca server could restart during a running native chat when an automatic update found no open terminals. Counting terminals separately from accepting chat work left a gap where the update could interrupt a turn.

Automatic SSH and WSL server updates now defer while chats have work left, and the serving server stays usable. Once that work finishes, choose Update or reconnect to retry; a deferral does not schedule a retry.

What Changed

The serving host derives outstanding work from existing provider lifetime rules: running turns, unanswered prompts, queued sends, orchestration workers and background work. It releases idle providers through their existing stop path with a five-second deadline, then reserves a restart for at most thirty seconds. No busy flag is saved.

The updater writes its recovery journal before asking the host to commit. The host checks current work and closes admission for new work synchronously before normal shutdown. New work cancels an uncommitted reservation. The updater requires confirmed exit before taking a snapshot; an expired reservation or lost answer never authorizes an external stop of a server that supports this check.

Already-installed older SSH and WSL servers cannot prove that chats are idle, so they need one manual Force update to install this protection. Settings offers the older-server SSH action as well as the existing WSL actions, with a warning that Force stops running chats on those older servers. Finish chats first; an interrupted chat can be continued after the update. CLI help explains the same consequence. On servers that can check chat work, Force still cannot override unfinished chats.

New servers protect older desktops' slot-file update requests through the same admission check. Newer desktops write stop-now into the slot stop file when they stop a server for recovery: crash recovery of an interrupted update, release of a stranded setup, and Windows rollback of a rejected new version. That request still stops the server at once. Only an empty or unrecognized request waits for chats to be idle, and a request that waits logs why. Explicit instance-bound Stop/Forget and operating-system stop signals keep their existing behavior. Terminal daemon preservation, protocol compatibility checks and protection for terminals running inside the server remain in place.

Why

The host that owns the providers must own the restart decision. Another client-side count leaves a gap between counting and accepting work. Reusing provider lifetime rules gives updates the existing definition of outstanding work without storing a second busy state.

Intended differences from the common pattern: Orca defers automatic managed updates over outstanding work, and independently updated remote hosts use bounded restart reservations. Explicit older-server upgrades retain the existing stop-and-continue behavior after repeated successful proof that the host lacks restart admission. Lost contact never proves that a server is old or idle. Orca uses the existing inline warning and Force action rather than a new dialog. Automatic update defaults, explicit Stop/Forget and operating-system signals are unchanged.

Linked Issue

Follow-up to #28458 and #26473.

Visual Proof

Pending coordinator-owned final-head Windows/WSL and SSH QA, with before/after screenshots. Settings now exposes the missing older-server SSH action and warns about older-server chat interruption on every Force path.

Testing

  • Added host reservation race/expiry, idle-provider release and older-client stop-file contracts.
  • Added client capability/lost-answer and activation/recovery contracts, including explicit older-server Force upgrades.
  • Extended the real WSL update lane to prove new work invalidates a stale reservation.
  • Added focused Settings contracts for older-server SSH Force dispatch, ordinary Update without Force, absence of a new Force action on capable/unverified SSH hosts, and a single shared interruption warning.
  • Normal staged precommit checks passed on correction commit ba7c4527402.
  • Exact-head full PR workflow and aggregate gate are pending at ba7c4527402648523a8e2db2a1e93259794f0555; CI runs tests, full lint and typecheck.
  • Final-head Windows/WSL and SSH live QA and screenshots remain coordinator-owned. No local test suite or app was launched.

The staged hook unexpectedly caused pnpm to populate dependencies and run package postinstall steps before checking files; its incidental lockfile changes were reverted. No standalone local checks or builds were requested.

Review

Review corrections restore the missing older-server SSH upgrade, disclose the older-server chat interruption on terminal and policy Force paths, and replace an unscheduled automatic-retry promise with an explicit retry/reconnect instruction. Fresh correction review and final readiness remain pending.

Files touched along Neil's update path: src/shared/orcad-terminal-census.ts, src/main/orcad/orcad-terminal-census.ts, src/main/runtime/rpc/methods/orcad-terminal-census.ts; the SSH files orcad-installed-activation.ts, orcad-transaction-incumbent.ts, orcad-update-plan.ts, orcad-remote-deploy.ts, orcad-terminal-census-client.ts, orcad-managed-runtime-context.ts, orcad-runtime-maintenance.ts and orcad-managed-auto-update.ts; and the WSL files wsl-orcad-incumbent.ts and wsl-orcad-deploy.ts, with their affected tests and activation fixtures. No mover internals changed.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer source is copied or translated.

Notes

SSH and WSL use the same host admission contract; WSL opens a short bridge for each request. Optional census fields and an advertised capability preserve communication with older peers. Folder workspaces use the same provider/session checks as git worktrees. Very old clients that unconditionally send an operating-system stop signal cannot be distinguished from an explicit stop.

Accepted limitation (older desktops only): an older desktop writes the same empty slot stop file for a recovery stop as for an update, so a newer server can't tell them apart and both wait for idle chats. As a result, an older desktop releasing a stranded setup on a newer server can release its lock while that server keeps running. Newer desktops are not affected. The update path that still writes the slot file for a stop (Force on a host proven to lack restart admission) only reaches older servers, and those ignore the file's contents. When an older desktop updates a newer server while a chat is running, the server keeps serving. The older desktop then reports the server as still running and keeps its update lock until the chat finishes. That is the intended older-desktop experience: the chat is never cut off.

Checklist

  • Focused on managed-server update safety.
  • Problem, user-facing change, mechanism and alternatives explained.
  • Cross-platform, SSH, folder workspaces and mixed versions considered.
  • Self-reviewed reservation, journal, shutdown and correction boundaries.
  • Final-head CI, fresh review/readiness and live QA/screenshots complete.

@brennanb2025

brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

The problem: managed SSH and WSL servers could restart for an update in the middle of a chat turn, even with no terminals open. Update safety counted only terminals, so it didn't see chat work that was still running, and losing contact with the server could still count as permission to stop it.

What changes for users: the server that would restart now reserves and commits its own restart. Automatic updates wait while chats still have work to do, and losing contact never authorizes stopping a chat. Older servers that can't check for running chats keep the explicit Force update action, and every Force button warns that it can interrupt a chat. Retry text asks the user to update or reconnect once the work is done, instead of promising a retry that is never scheduled.

Fixed in review (two rounds, plus a three-model design panel after round 1):

  • Older SSH servers get the existing Force update action only when the server is confirmed to be an older version.
  • Every Force action that's offered now carries the chat-interruption warning.
  • Retry copy no longer promises an automatic retry.
  • A mechanical extraction keeps conversation creation under the file-length limit. Its entry points are unchanged.

Deferred (not caused by this PR, owned separately): the WSL host row can keep showing "Update … deferred." after an update applies, because the renderer's WSL host store ignores a status change when only the deferred update changed. Turning off auto-naming on the desktop doesn't stop WSL-hosted chats from running their own naming call.

Final head: aea74ce7572b53c483f743cf96f5d84634fb48fd. Since 580de376221 the PR took two more main merges, one fix found in review of the first of them, one new production change (the stop request below), and two new real-host tests (Windows, and Linux plus macOS).

Third main merge (c74dac3ad30): main's start flights (#28046) and attach changes met this PR's restart drain in the chat attach and session-host files. The merge keeps both: main's start, attach and Sleep behavior, and this PR's refusal of new chat work while a restart is committed. An independent review (Codex gpt-6.1-sol high) found one real gap: main's idle sweep can close a conversation whose start is still in flight, and the restart count then missed that start. Fixed in cf4d0c82dee by counting every tracked attach operation itself, not conversation-cache membership (2 production lines plus a regression test). The re-check answered AGREE.

Fourth main merge (0d3ba242c84): main's #30874 made an SSH update re-count terminals just before stopping the server. For servers that support this PR's restart reservation, the reservation's own count, taken by the server after the upload, is that re-count. Only an explicit Force on an older server still re-counts from the client, and a failed re-count defers instead of reading as zero. Main's new test cases were carried over to this PR's mechanism. The review's only finding (test fixtures missing the now-required re-count option) was fixed. The commit hook re-wrapped 22 of main's unformatted files (formatting only). Later main merges (acfd335de9b) were clean.

New in this round: an explicit "stop now" request (48b11979abd, 21ce74cfff1, 0a801d43aa9). Review (CodeRabbit) found that this PR had made the plain slot stop file, which recovery uses to stop a server it must replace, wait behind the restart check. So recovery of an interrupted update, a stranded setup, or a rejected Windows candidate could be deferred indefinitely. A three-model design panel, asked neutrally, chose unanimously to keep the one stop file and give it explicit contents. Newer desktops write stop-now (temp file plus atomic rename), which stops at once. An empty file, which is what older desktops write for an update, takes the chat-safe restart path and logs why it waited. Any other contents do the same and log "unrecognized stop request". The Windows host script retries the rename briefly while antivirus holds the new file. The combined review of the merge and this change raised only a wording concern, which was fixed.

What was verified:

  • CI is green on the final head (all required checks), including the real-Windows SSH host jobs below.

  • Earlier Windows QA on 66c0c8cca4b (B1 to B3 below, unchanged): the older-server deferral row with Force update, current-server deferral without Force, and chat creation from the "+" menu. PASS (QA comment).

  • Windows QA of the update and stop path on 46b8e8c19fb (Windows high spec, real Claude Code 2.1.302 inside a throwaway WSL2 distro, Codex driving the app). 0a801d43aa9 changes only the Windows SSH host script, which WSL does not use.

    • S1: an update while a real chat is mid-turn is deferred with the chat-specific copy, and the server keeps its process. PASS.
    • S2: once the chat is idle, the update applies (new server process and version) and the same chat replies from the new server. PASS.
    • S3b: the stop request on the real server while a real turn is running. stop-now is consumed and the server exits in about 0.5 s; the desktop relaunches it and the chat shows an interrupted reply. PASS. An empty request is consumed and the server keeps running, logging "a plain-slot restart request was deferred: Chats still have work to finish." PASS. bogus is consumed and the server keeps running, logging "unrecognized stop request". PASS.
  • Native Windows host (real Windows OpenSSH plus a real server, in CI on every push): the Windows host lane test now stops the deployed server through the same call recovery uses (the host script's stop op writes stop-now). It expects the stop to be confirmed, proves the process is gone, relaunches the same server, proves it serves again, and then decommissions as before. It passed on x64 Windows Server 2022 and Windows 11 Arm, each with the built-in and preview OpenSSH (run 39379744238 on the final head).

  • R1: crash recovery stops a server whose restart check is refusing for a reason other than chats (the case the "stop now" change fixes). This runs in CI on every push against real servers over real SSH: 6 Linux hosts in Docker, plus macOS arm64 and Intel with their own sshd (run 39379744185; each cell logs [recovery-stop cell] <os>: restart refused, recovery stop exited). Each cell deploys a real server, then:

    1. holds a restart reservation through the product's own connection, as another desktop mid-update would; a second reservation is refused with "admitting work";
    2. writes an empty stop request (what older desktops send for an update), which the server consumes while it keeps running;
    3. calls recovery's own stop step (quiesceInterruptedOrcadSlot, which writes stop-now); it reports the server exited, and the process is gone;
    4. relaunches the server and proves it serves before the existing teardown.

    Without this PR's fix, step 3 is deferred and fails. What is simulated: the interrupted update itself. The test calls recovery's stop step directly on the deployed server rather than leaving a real half-finished update for recovery to find. A test can't stop a real update partway without hooks added to the product (the update checks for cancellation only before it starts), and recovery reaches this same stop step only when it declines the interrupted candidate. So the step under test is the real one, against a real server that is really refusing, but the path that leads recovery to it is not driven end to end.

What was not verified:

  • B3 from an empty workspace stays blocked as before (that entry point can't be reached).

For Brennan's review:

  • Screenshots from the stop-path QA on 46b8e8c19fb:

    Update deferred while a real chat is running (S1):

    28978-S1-deferred.png

    The same chat replying from the updated server (S2):

    28978-S2-continued.png

    stop-now stops the busy server at once (S3b):

    28978-S3b-stop-now.png

    An empty request is deferred while the chat works (S3b):

    28978-S3b-empty-deferred.png

  • Screenshots from the Windows QA on 66c0c8cca4b:

    Older-server deferral row with Force update and its warning:

    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, with no Force button:

    28978-B2-1-chat-deferral-row.png

  • src/main/orcad/orcad-stop-request-listener.ts: how the server reads the stop request (stop-now stops; anything else waits for idle chats).

  • src/main/ssh/orcad-transaction-incumbent.ts: how an incumbent server is reserved before it's stopped, including the older-server path.

  • src/main/ssh/orcad-update-plan.ts: when Force is offered (only for a confirmed older server, never on lost contact).

  • src/renderer/src/components/settings/managed-server-copy.ts: the deferral and Force-warning copy users see.

Earlier rounds (through 580de376221). The first main merge (65f151a14b4): main had moved the managed-server, remote-exec and port-forwarding modules to new folders. The merge only updated import and test-mock paths for those moves and moved the PR's test readiness fixture next to the test harness that re-exports it. The PR's logic is unchanged. One PR test was updated to report helper work the way main now does, since main replaced the old way in #29905. The commit hook's formatter also re-wrapped lines in 11 files that main had left unformatted (whitespace only, no code change). A separate review of the merge found no lost PR or main changes, and every moved import and test mock resolves. CI was green on that head.

Second main merge (4232ea1b8b0): main landed "Sleep stops a workspace's native chat agents" (#28445) and "Refuse chat resume until terminal writers have exited" (#29242), which touched the same chat host files. The merge keeps both: Sleep still stops a workspace's chats, a resume is still refused while a terminal is writing, and the restart drain and restart reservation are unchanged. While Sleep is stopping a chat it counts as work, so an update waits for it. The commit hook's formatter re-wrapped 6 of main's files (formatting only): server-status-application.ts, server-status-update.ts, pty-subprocess-spawn-file-foreground.test.ts, terminal-host-process-inspection.test.ts, local-pty-child-process-verdict.test.ts, local-pty-provider-foreground-process.test.ts. An independent review of this merge (Codex gpt-6.1-sol high) answered AGREE: no PR or main behavior lost. CI was green on that head.

Later main merges (282975f90e9, 580de376221): main landed "make room for the pre-activation snapshot on remote hosts" (#30618), which now checks disk space just before this PR reserves the server's restart, so a slow disk scan never holds a reservation. One test conflict was resolved by keeping main's new error message and this PR's restart steps. Main's new snapshot-room tests were updated to run through the restart reservation (same idle chat count and admission as this PR's other update tests), and the ordering test now checks the disk check happens before the reservation (485c34ba37f). An independent review (Codex gpt-6.1-sol high) found the production merge correct and flagged only those tests, now fixed. CI was green on that head.

Status: review loop done on the final head, CI green, QA done (R1 proven in CI against real servers; its interrupted-update setup is simulated, as described above).

@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 4 · Failed 1

Failed Failed checks: 1 warning

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.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: protecting active chats during managed server updates.
Description check Passed The description is detailed and covers the required sections, user impact, implementation, rationale, testing, compatibility, and limitations. It clearly discloses pending CI, QA, and visual proof ite…
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: Description check

Explanation

The description is detailed and covers the required sections, user impact, implementation, rationale, testing, compatibility, and limitations. It clearly discloses pending CI, QA, and visual proof items.

✨ 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.

@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: 0ef76e9d-44a4-4afa-ae18-828d46dab827
📥 Commits

Reviewing files that changed from the base of the PR and between cf4d0c8 and bcc8f72.

⛔ Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing: 30
  • 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/managed-server/host-state/orcad-windows-host-script.ts
  • src/main/managed-server/install/orcad-remote-process-control.ts
  • src/main/managed-server/install/orcad-remote-shell-commands.integration.test.ts
  • src/main/managed-server/install/orcad-remote-windows-scripts.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-runtime-context.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-restart-admission.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.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-runtime-maintenance.ts
  • src/main/ssh/orcad-snapshot-room.test.ts
  • src/main/ssh/orcad-transaction-incumbent.ts
  • src/main/wsl/wsl-orcad-deploy.ts
  • src/main/wsl/wsl-orcad-incumbent.test.ts
  • src/main/wsl/wsl-orcad-incumbent.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/orcad-restart-admission.ts
  • src/shared/orcad-runtime-capabilities.ts
  • src/shared/orcad-stop-request.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

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

Comment thread src/main/managed-server/host-state/orcad-windows-host-script.ts
… 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

This branch has not been deployed

No deployments
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