Repository navigation
Conversation
OrcaWin
force-pushed
the
OrcaWin/jinwoo-sta-4756-remote-stale-agent-status
branch
from
August 20, 2026 10:23
9ca211d to
621b34c
Compare
5 tasks done
5 of 7 tasks
7 of 8 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #15317 / STA-4756.
idle_promptboundarySubagentStopthrough the same exact task-id evidencedonepayload without adding a wire field or opcodeRoot cause
Claude can emit
Stopwhilebackground_tasksstill contains running work, append a structured<task-notification>when that work terminates, resume internally withoutUserPromptSubmit, and then miss the finalStop/SubagentStophook. Orca consequently retains the last working tool event in authoritative relay state. Reconnect and client restart faithfully replay that stale host state; replay is propagation, not the source.An
idle_promptnotification alone is not a completion signal: Claude 2.1.237 also emits it while a background shell is still running. This change only clears task IDs that Orca previously observed as running in the same transcript and whose terminal notification was appended at or after Orca observed that ownership. The transcript scan is bounded to 4 MiB and fails active if evidence is unavailable.Real paired candidate validation
Fresh candidate server on Windows 2 (
6aae67d0-9e72-4bb7-b1ac-f5b21f09cb43):sleep 12; provider output reachedFINISHEDand the TUI was idleworktree pstransitioned from agentworkingwhile the shell ran todoneafter the provider-authored task deliveryDoneDoneCODEX_LB_API_KEY; no Codex product conclusion is drawn from that environment failureThis covers provider/session state, execution-host authority, client mirror/rendering, reconnect/client restart, and hidden workspace switching. Parking was not involved in the reproduced failure or the authoritative fix.
Reviewer hardening
Three independent
gpt-5.6-lunareviewers challenged the lifecycle and compatibility boundary. Valid findings were fixed before this update:idle_promptwithout an exact owned terminal task record emits no completionpromptSource: system/origin.kind: task-notificationdelivery record and rejects queue, user-authored, and malformed shapes; the view-only AI Vault scanner retains historical queue-record supportThe 4 MiB transcript scan and in-memory ownership are deliberately fail-active: missing evidence preserves
workingrather than fabricatingdone.Windows 2 evidence
Installed Orca 1.4.185, paired remote workspace:
C:/Users/neil/orca/workspaces/orca/fix-windows-enumerate-the-process-table-throughf02245b1-f3fb-46e9-8b51-5f2fa1dfdd76:204ffd75-ce36-4a11-9c2b-c9a74695d68fterm_e89c6c93-24c5-4b1a-a379-bfd6f0fcda73e6a90aa2-d59a-4ce3-b084-76f19153b7b7Independent signals at failure:
orca terminal wait --for tui-idlesucceeded and the prompt/title was idleorca worktree ps --jsonand persisted Orca state remainedworking, with last hookPostToolUse:Bashworkingwhile the remote server survivedThis excludes process death, terminal parking, and renderer-only projection staleness for the reproduced failure.
Deterministic proof
src/relay/agent-hook-server.test.tsreproduces the exact host transition and reconnect replay. Mutation proof:expected done, receivedworkingdoneAdditional coverage pins exact-id matching, multiple tasks, repeated-inventory ownership retention, provider-authored notification provenance, malformed/unidentified tasks, missed
SubagentStop, cron isolation, hook preservation, partial JSONL records, and the bounded scan boundary.Validation
expected done, received working; restoring it passes and reconnect replay returnsdonepnpm run typecheckoxlint --deny-warningspnpm run check:max-lines-ratchetgit diff --checksh/tar -Cnative-path handling; CI's cross-version job passedResidual risks
workingCompatibility
The execution host/relay owns reconciliation. There is no RPC, stream-frame, or status-payload schema change; mixed-version clients receive the existing
donepayload. Native, WSL, SSH, and folder-workspace authority remains at the execution host. Parked/hidden renderer paths are not modified.Open PR #15558 independently filters Claude settings to schema-supported hook events.
Notificationis a Claude-supported event, but that PR's allowlist must retain it if both changes land.