Skip to content

fix(orchestration): worker-start settles readiness on observed turn start, not write acceptance - #19423

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/fix-worker-start-wedge
Sep 9, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/fix-worker-start-wedge

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​255 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​243
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​291 $\color{#cf222e}{\Huge{\mathbf{−}}}$​51 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​240

What happened

Six orca orchestration worker-start dispatches (2026-09-07, all --worktree new-child --setup run --agent codex --model ...) returned ok: true, state: ready, stage: input_accepted for workers that never did any work. The agent terminals held a codex in one of three end states: a network-reconnect loop, MCP startup frozen, or the task spec sitting unsent in the composer as [Pasted Content].

Root cause, with the evidence

Why those specific dispatches wedged (environmental trigger, not fixed here). A still-live corpse (rc-a1-latch-settle, dispatch ctx_f5241043314e) was caught in the act: its codex TUI (pid 7528) sat in SYN_SENT to 208.111.34.11:2455 — a garbage public IP. lsof -i TCP:2455 showed 16 codex TUIs in the same state. The codex LB (openclaw.orca-procyon.ts.net:2455) lives on a tailnet reachable on this machine only through the userspace-tailscaled proxy at 127.0.0.1:1055 or the local bridge at 127.0.0.1:2455; system DNS (NordVPN resolver on utun5) resolves *.ts.net to hijack IPs. Healthy codexes (structured app-server sessions) carry HTTP(S)_PROXY/ALL_PROXY=…127.0.0.1:1055 inherited from the app process; daemon-spawned PTY terminals carry none. That is machine setup, not an Orca defect — but it exposed two real Orca defects:

Defect 1 — readiness was a write receipt, not evidence. deliverWorkerDispatchPreamble sent the preamble with acceptQueued: true, observationTimeoutMs: 0, so stage: input_accepted meant only "bytes written + Enter written". No code ever checked that a turn began, and worker-start-prompt-contract.test.ts pinned the lie: its "swallowed Enter" case asserted state: 'ready' with startedTurns() === 0. A corpse and a healthy worker were indistinguishable by design. (The tui-idle gate upstream is banner-based for codex — OpenAI Codex + model: + directory: — which a mid-boot codex prints before MCP/network come up, so it never catches this either.)

Defect 2 — the effect verb lied. On the new-worktree path the agent terminal is created by that same call's agent-first worktree creation, but the receipt said action: 'reused_agent_terminal' (worker-topology.ts, duplicated in federation-effects.ts) — a role test picking a lifecycle verb. This misdirected the first diagnosis of the incident toward terminal reuse.

The setup correlation held but was not causal. DB history: codex+new-child+setup run → abandoned corpses; codex+new-child+setup skip → succeeded; claude/opencode+setup run → succeeded; codex existing-worktree → succeeded (those ran structured — --model/--effort forces terminal mode, and every wedged dispatch passed --model). The path split is PTY-vs-structured (proxy env present only on the structured side), with DNS flakiness explaining occasional PTY successes. Setup rode along; its receipts all said succeeded.

The fix

Readiness now settles on the strongest available evidence (worker-start-readiness-settlement.ts, worker-start-turn-observation.ts). After the accepted write, worker-start runs the existing second-stage observer (observeTerminalAgentPrompt — the same one terminal.send receipts replay through), inside the 30s window orchestration-worker-start-prompt-budget.ts already reserves in the client RPC grace (that budget's comment says "plus effect settlement"; the server just never used it):

Evidence Result
Turn started (lifecycle edge or provider hook), or structured provider ack ready, turnStart: 'observed'
Permission prompt rendered ready, turnStart: 'permission' (positive liveness)
Provider exposes no turn-start signal (e.g. grok) ready, turnStart: 'unsupported' — acceptance is the best receipt that can exist
Observation supported, nothing started worker start_unknown, response state: 'outcome_unknown' + nextCommands (worker-show / terminal read / worker-abandon); CLI exits non-zero

Execution-boundary compliance: the unobserved verdict is unverifiable, never a death claim. The dispatch capability and terminal are kept, the task goes blocked (the existing start_unknown convention), and nothing is torn down — worker-report-settlement.ts already reconnects a start_unknown worker through ready if it recovers and reports. Providers that cannot prove a turn are never punished for it.

Verb fix: agent-first-created agent terminals now say created on both the local and federation paths; readers keep accepting the retired reused_agent_terminal for pre-rename persisted rows.

local-worker-start.ts crossed max-lines from the new logic, so the delivery/settlement tail moved verbatim into worker-start-readiness-settlement.ts (no disable, no ratchet bump).

Repro and demonstration

  • The underlying wedge was reproduced by production itself and diagnosed live (socket state, env diff, DNS) — see evidence above.
  • The readiness lie is reproduced mechanically by the existing worker-start-prompt-contract.test.ts harness: real prompt pipeline, codex accepts the paste, swallows Enter, never starts a turn. Before this PR that test asserted the shipped behavior (ready); it now proves the fix (outcome_unknown, start_unknown, capability retained, exactly one submit, no blind retry).
  • Not run: an end-to-end dispatch against a dev build on the affected machine (would require launching a second Orca instance against the user's live session).

Out of scope (flagged, not half-done)

  • --model/--effort silently downgrading a structured-preferring worker to a PTY terminal agent (mode reason launch_preferences) — that routing put codex on the unproxied path; supporting launch preferences in structured sessions is its own change.
  • The codex tui-idle banner heuristic accepting a mid-boot codex as idle — the new gate makes its false positive loud instead.
  • worker-stop was checked for coherence: it already accepts start_unknown workers; no change needed.

Verification (verbatim tails)

  • pnpm test src/main/runtime/rpc/methods/orchestration/ → Test Files 67 passed (67) / Tests 614 passed (614)
  • pnpm test src/main/runtime/orchestration/ → Test Files 94 passed (94) / Tests 757 passed (757)
  • pnpm tc:node → clean (tsc --noEmit -p config/tsconfig.node.json); @pnpm/exe lockfile drift reverted, lockfiles absent from this diff
  • pnpm run audit:code-quality:native, pnpm run audit:code-quality:type-aware → clean
  • npx oxlint --config config/oxlint-react-doctor.json <changed files as explicit argv> → clean; node config/scripts/check-react-doctor-changed.mjs "$(git merge-base HEAD origin/main)" → exit 0
  • pnpm run check:max-lines-ratchet → OK, no new bypasses

Wire compatibility: response gains optional fields (turnStart, nextCommands, lastError) and reuses the existing outcome_unknown state string already produced by failWorkerStartWithReceipt; no new stream opcodes, no RPC param changes.

…tart, not write acceptance

A dispatched PTY worker whose agent wedged at startup (six codex workers on
2026-09-07) was reported 'ok: true, state: ready, stage: input_accepted': the
preamble write was acknowledged with observationTimeoutMs: 0 and nothing ever
verified a turn began. The corpse and the healthy worker produced identical
receipts.

worker-start now runs the existing second-stage prompt observer
(observeTerminalAgentPrompt) after acceptance, inside the 30s window the
client RPC grace already budgets for (orchestration-worker-start-prompt-budget):

- turn observed (or provider ack for structured sessions) -> ready
- permission prompt -> ready; positive liveness, surfaced in the receipt
- provider without a turn-start signal -> ready; observation: unsupported
- observation supported and nothing started -> worker state start_unknown,
  response state outcome_unknown with nextCommands. Honest 'unverifiable',
  never a death claim: the capability and terminal are kept, and
  worker-report settlement already reconnects a start_unknown worker that
  recovers and reports.

Also fixes the effect-verb lie that misdirected the first diagnosis of this
incident: agent-first worktree creation labeled its own brand-new agent
terminal 'reused_agent_terminal' (a role test picking a lifecycle verb) on
both the local and federation paths. It now says 'created'; readers keep
accepting the retired verb for rows persisted before the rename.
@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

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: 1b5dbd8b-7823-4f0f-857d-076b528af13c

📥 Commits

Reviewing files that changed from the base of the PR and between 685c428 and 8b0d79a.

📒 Files selected for processing (3)
  • config/reliability-gates.jsonc
  • src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds structured worker turn-start observation and centralizes worker readiness settlement. Early worker reports can settle normally, while unobserved starts preserve dispatch authority and outstanding questions. Unknown-start effects can be persisted. Worker report settlement now accepts starting workers. Terminal creation effects consistently use created, including agent terminals. Tests and reliability contracts cover these behaviors.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 8b0d7

Worker startup now verifies turn-start evidence and retains recoverable unknown-start state when observation cannot confirm progress. The prior incarnation-replacement readiness concern is covered by the current behavior, with no active merge-blocking risk remaining.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description gives detailed context, root cause, implementation details, testing results, and scope. However, it omits the required Linked Issue entry, the required Visual Proof section or an expli… Add a Linked Issue entry with the issue number, add the Visual Proof section with before/after evidence or exactly N/A plus a reason, and complete the required Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checkl…
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 15 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: worker-start readiness now settles on observed turn-start evidence instead of write acceptance.
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 gives detailed context, root cause, implementation details, testing results, and scope. However, it omits the required Linked Issue entry, the required Visual Proof section or an explicit N/A explanation, and the template checklist sections.

Resolution

Add a Linked Issue entry with the issue number, add the Visual Proof section with before/after evidence or exactly N/A plus a reason, and complete the required Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.

Full details: Docstring Coverage

Explanation

Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 15 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@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: Team

Run ID: c92b0f88-90b4-468c-8aa1-814bf91012b8

📥 Commits

Reviewing files that changed from the base of the PR and between cbc7bb4 and 325fa88.

📒 Files selected for processing (12)
  • src/main/runtime/orchestration/db/worker-dispatch/worker-dispatch-authority.ts
  • src/main/runtime/orchestration/db/worker-dispatch/worker-dispatch-outcome.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-effects.ts
  • src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-setup-gate.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-prompt-contract.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-readiness-settlement.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-turn-observation.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-turn-observation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts
  • src/main/runtime/rpc/methods/orchestration/worker/workers-new-worktree.test.ts

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

Comment on lines +34 to +35
// 'unsupported' (and an old host's missing observation) leaves acceptance as the best receipt.
return 'unsupported'

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Classify initial incarnation_replaced deliveries as unobserved.

When an initial delivery has observation: 'incarnation_replaced', classifyPromptDelivery falls through to 'unsupported'. observeWorkerTurnStart then skips observation, and readiness settlement calls markWorkerDispatchReady without evidence from the current PTY incarnation. Handle this observation before the unsupported fallback.

Proposed fix
 function classifyPromptDelivery(prompt: RuntimeTerminalPromptDelivery): WorkerTurnStartVerdict {
+  if (prompt.observation === 'incarnation_replaced') {
+    return 'unobserved'
+  }
   if (prompt.stages.includes('turn_started')) {
     return 'observed'
   }

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Readiness settles on observed turn start: deliverAndSettleWorkerStartReadiness replaces the inline preamble-delivery + markWorkerDispatchReady tail in local-worker-start.ts; after the accepted write it runs the second-stage observer and only reports ready on a positive turn-start (or permission/unsupported), otherwise start_unknown with state: 'outcome_unknown' plus recovery nextCommands.
  • Turn-start observation: worker-start-turn-observation.ts classifies the prompt delivery and reuses observeTerminalAgentPrompt inside the AGENT_PROMPT_EFFECT_TIMEOUT_MS window already reserved in the client RPC grace.
  • Unknown-start effects persistence: markWorkerStartUnknown gains an optional effects param so the turn_unobserved evidence is durable alongside the accepted receipt.
  • Agent-terminal effect verb correction: worker-topology.ts and federation-effects.ts now emit action: 'created' for agent-first-created agent terminals; readers retain the retired reused_agent_terminal for pre-rename persisted rows.
  • Tests: the swallowed-Enter contract test now proves the wedge (outcome_unknown / blocked / start_unknown, capability retained, exactly one submit), and new unit tests cover the full verdict matrix.

I verified the load-bearing claims against the code: the unobserved path leaves dispatch pending + task blocked + worker start_unknown with the capability intact, and the pre-existing reconnectingStart branch in worker-report-settlement.ts already reconnects that exact combination through ready on a later success report; the lifecycle graph permits start_unknown -> ready; and the preamble send's observationTimeoutMs: 0 returns observation: 'supported' for codex/claude so the gate actually runs for them while unsupported providers (grok) skip the wait entirely. The only noteworthy design tradeoff is that the 30s observation window is fixed and not bounded by --timeout, which is consistent with the reserved client grace rather than a defect.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Preserved authority through unobserved starts: markWorkerStartUnknown no longer calls closeQuestionsForDispatch, so an unverifiable worker's outstanding questions stay answerable until it reports, is abandoned, or fails — consistent with the execution-boundary vocabulary the first commit established.
  • Settled reports that land mid-observation: settleWorkerReport gained a reportingStart branch (pending + dispatched + starting) so a worker that finishes during the 30s window transitions starting -> ready -> succeeded (or starting -> failed) instead of being rejected as inactive_dispatch.
  • Observation failure no longer tears down the worker: observeWorkerTurnStart catches a stale terminal binding and returns unobserved instead of throwing into startLocalWorker's teardown path, which would have revoked capability and closed the terminal.
  • Readiness settlement tolerates a concurrent report: deliverAndSettleWorkerStartReadiness re-reads the worker after observation and returns an already-settled outcome as ready + workerOutcome rather than re-marking it ready or recording a conflicting start_unknown.
  • Tests and reliability gate: three new contract tests pin each fix (early succeeded/failed report with and without turn evidence, stale binding, answerable questions after timeout), and the invariant/assertions were updated to match.

I traced the load-bearing paths: the lifecycle transitions the new branch reuses are all pre-existing (starting -> ready via markWorkerDispatchReady, starting -> failed via failWorkerStart, pending/dispatched -> completed/failed via the existing report path); worker-abandon/worker-stop/settleWorkerReport all still close questions, so removing the close from markWorkerStartUnknown leaks nothing; and the initial preamble delivery only ever carries supported/unsupported/permission, so incarnation_replaced remains reachable solely in the second-stage result where it is already handled. The new tests are exact and would fail without the corresponding fix.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Supplemental real-runtime QA on ba6a5f0318ff73254ed8bb49421bbefc3efde961, using a unique hidden Electron profile and disposable folder workspace.

  • A real Codex worker returned ready / turnStart: observed with supported turn_started evidence, then reported success and wrote one completion marker.
  • Reusing its settled terminal while its verified test-owned process was suspended returned CLI exit 1, outcome_unknown / turnStart: unobserved, with only input_accepted. The terminal effect was reused, and the dispatch retained capability and resource ownership.
  • After guaranteed process resume, the original submission completed on that same dispatch with one recovery marker and no resend. Both successful worker reports were accepted; cleanup released the worker and closed the test terminals.

These uncropped hidden-renderer screenshots show actual saved CLI JSON filtered with the visible jq commands, then the authority/settlement transition and file checks. No mock runtime was used. The initial unsupported model selection was stopped before the successful run.

Actual supported and unobserved start receipts
Actual retained authority, completed recovery, and marker checks

SSH remains unverified: both Docker daemon sockets were absent, Docker Desktop reported not running, and no existing Colima/OrbStack command was available. No production target was used. This local evidence does not establish SSH/federation correctness or a blanket land verdict; new-worktree creation, permission, observation-exception, and incarnation-replacement paths were not exercised in this runtime pass.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status — ba6a5f0

Scoped code review: clean after fixes. Landing recommendation: do not land yet; real SSH validation remains blocked and has not been waived.

Changes pushed

Three same-model/same-effort review rounds produced commit ba6a5f0318:

  • Accept authenticated early success/failure reports while turn observation is pending, without overwriting their settled outcome.
  • Preserve accepted dispatch authority when observation errors, and preserve outstanding worker questions during uncertainty.
  • Keep start receipts compatible with existing CLI consumers; an additive workerOutcome carries an already completed task result.

No unrelated transport rewrite, product expansion, dependency change, or screenshot/report files were committed.

Separate judgments

  • Functional correctness: initial and final eight-section readiness audits completed. Initial candidates were validated as P2 by three available counsel seats plus blind peer ratings; the final independent audit found no remaining proven in-scope candidates.
  • Architectural fit: delivery acceptance and execution evidence remain distinct; lifecycle repairs live at the existing observation and transactional settlement owners. No blind resubmission or parallel transport was added.
  • Mechanism limits: PTY hook/title observation is weaker than request-scoped provider acknowledgement. Unsupported providers intentionally retain acceptance-only readiness with turnStart: unsupported. The pre-existing federated-peer attachment readiness path is not fixed by this PR; only its terminal-effect verb is corrected.
  • Performance/validation: final targeted run: 11 suites, 1,454 passed / 1 skipped; node typecheck passed. Changed-code quality and earlier lifecycle/CLI regressions passed. Observation remains bounded and targeted; tests cover one submission and timer cleanup. Current CI checks all completed successfully or were skipped; skipped jobs are not validation.

Live evidence and remaining gates

Full-context screenshots and runtime evidence show the exact-SHA hidden Electron app in a disposable folder workspace:

  1. Real supported worker start returned ready / observed, then completed.
  2. A test-owned suspended worker returned CLI exit 1 and outcome_unknown / unobserved, retaining its authority.
  3. After resumption, the same dispatch completed with one recovery marker and no resubmission.

Supplemental Codex performed this QA because the requested Grok worker hit its weekly usage limit; this is not Grok validation. SSH could not run: both Docker daemon endpoints were unavailable, Docker Desktop was stopped, and no existing Colima/Orb alternative was installed. No real SSH/network-drop, Windows/WSL runtime, or mobile journey is claimed. No mobile-facing UI changed.

Test-owned app/process/profile/folder resources were cleaned up; evidence was preserved outside the PR diff. Complete real SSH validation (or obtain explicit acceptance of that gap), and resolve the requested Grok QA quota, before treating this review session as fully complete. No merge was performed.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

SSH real-runtime QA on ba6a5f0318ff73254ed8bb49421bbefc3efde961 (model under test: this worker ran OpenCode opencode/muse-spark-1.3-contributor-free; remote agent provider: Codex gpt-5.6-sol), via disposable Linux Docker SSH target (node:22-bookworm, linux-arm64) with remote demo-project cloned from a local git bundle after a genuine https clone attempt failed with could not read Username (private repo, no container credentials), relay built with pnpm build:relay, exact PR worktree launched hidden with a unique profile (ORCA_DEV_USER_DATA_PATH), CDP 9361 / renderer 127.0.0.1:5199, ORCA_BACKGROUND_LAUNCH=1, identity verified (fix-orchestration-worker-start-settles-readiness-2 @ brennanb2025/fix-worker-start-wedge-2).

  • Healthy turn over SSH: worker-start on existing remote worktree id:479d339a…::/work/demo-project (reused, setup not_applicable) returned exit 0, ready / turnStart: observed, stages input_accepted,turn_started, observation supported; dispatch ctx_15d439ad2076 completed with worker succeeded, and remote /tmp/qa-19423-sshworker/completion.txt held exactly one QA_SSH_TURN_COMPLETED line with remote git status clean.
  • Unobserved path over SSH: reusing the settled terminal while its verified test-owned remote agent process (PID 6850, codex cmd, cwd /work/demo-project, ppid chain to relay daemon 6039) was SIGSTOPed returned exit 1, outcome_unknown / turnStart: unobserved, stage turn_start_unobserved, stages input_accepted only, effects terminal reused + dispatch_input accepted/turn_unobserved. The dispatch stayed pending/start_unknown with capabilityRevokedAt: null (authority retained). Guaranteed SIGCONT ran in finally; the original submission then completed on the same dispatch (completed/succeeded) with exactly one QA_SSH_RECOVERED_ONCE line, one completion.txt line total, no resend, git still clean.
  • Disconnect/recovery: ssh.disconnect + ssh.connect through real Orca reattached (new provider epoch); remote agent PIDs stayed live across the detach and the worker terminal read back running afterward, consistent with detach-not-dispose.

Uncropped hidden-renderer screenshots show the actual saved CLI JSON filtered with the visible jq commands, plus marker counts and git status, rendered in the real remote PTY. No mock runtime, no secrets in receipts or images.

SSH healthy start receipt and completion marker
SSH unobserved receipt, retained authority, recovery marker, clean git

Remaining gaps: permission/approval, observation-exception, incarnation-replacement, structured-worker, and known-unsupported-provider paths were not exercised over SSH in this pass; federation excluded per scope; no mobile UI changed or exercised. Full command transcripts and receipts are retained in the QA run directory outside the repo.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

SSH QA passed using OpenCode opencode/muse-spark-1.3-contributor-free on exact SHA ba6a5f0318ff73254ed8bb49421bbefc3efde961.

  • Real worker-start ran over a disposable Linux Docker SSH target.
  • Healthy remote worker returned ready / observed and produced one completion marker.
  • SIGSTOP recovery returned outcome_unknown / unobserved, retained authority, then completed on the same dispatch after reconnect/resume with one recovery marker and no resubmission.
  • Remote disconnect/reconnect preserved the remote work.
  • Secret-free screenshots and receipts: fix(orchestration): worker-start settles readiness on observed turn start, not write acceptance #19423 (comment)
  • Owned Docker container, SSH key, profiles, processes, and test artifacts were cleaned; Docker remains running.
  • Remaining untested niche paths: permission prompt, incarnation replacement, structured worker, and unsupported-provider behavior over SSH. No mobile UI changed.
  • Code review, readiness audits, precedent/performance review, Electron validation, and CI remain clean. Grok was unavailable due to quota; this QA used the requested Muse Spark 1.3 Free model instead.

…er-start-wedge-2

# Conflicts:
#	src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes (since the prior review at ba6a5f0)

  • Merged origin/main: 685c428 merges main (2ba2c90) into the branch and resolves its one conflict in local-worker-start.ts. The reconciliation correctly rails this PR's deliverAndSettleWorkerStartReadiness settlement onto main's custody-at-creation path from #19608.
  • Adopted custody-at-creation: recordCreatedWorkerTerminalCustody (imported from the new created-worker-terminal-custody.ts) is invoked before the boot wait, owning the agent terminal from creation — closing the same early-window gap the 30s observation window otherwise holds open.
  • Dropped the residual-terminal teardown path: tearDownFailedWorkerStart now takes the post-#19608 three-arg void signature, so the obsolete residualAgentTerminal binding and its failWorkerStartWithReceipt spread were removed; the deleted residual-terminal mechanism is subsumed by custody-at-creation.

I confirmed the reconciliation compiles and the merge-affected suites pass (worker-start-prompt-contract, worker-start-turn-observation, composed-workers, workers-new-worktree, and #19608's worker-terminal-custody-at-creation — 63 tests). prepareStartingWorkerAuthority still accepts the retired reused_agent_terminal verb, and both custody writers are guarded by getWorkerTerminalResourceByOwner, so the two features coexist without double ownership rows.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes (since the prior review at 685c428)

  • Merged origin/main (210ac1f): 8b0d79a is a merge-up whose only PR-authored delta is the conflict reconciliation. Main extracted createWorkerWorktree out of worker-topology.ts into the new worker-worktree-creation.ts (via #19431), which relocated this PR's agent-terminal effect-verb fix.
  • Verb fix relocated cleanly: reused_agent_terminal → created now lives in worker-worktree-creation.ts, still emitting action: 'created' for every listed terminal (the agent terminal included), with the misdiagnosis rationale preserved in the comment; worker-start-agent-placement.ts imports it from the new path.
  • Import surface reconciled: local-worker-start.ts dropped the symbols main removed (createWorkerWorktree, createExistingWorktreeWorkerTerminal, createStructuredWorkerSessionForWorktree, deliverWorkerDispatchPreamble, monitorWorkerSetup, WorkerSetupReceipt) and now imports requireWorkerAuthority, type WorkerEffect; monitorWorkerSetup moved into deliverAndSettleWorkerStartReadiness, and the reveal warning now reads placed.warning from WorkerAgentPlacement.

Verified the reconciliation compiles (pnpm tc:node clean) and the affected suites pass (38 tests across workers-new-worktree, worker-start-prompt-contract, and worker-start-turn-observation). No behavioral change beyond the merge reconciliation.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 merged commit 3a801d2 into main Sep 9, 2026
33 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.

1 participant