You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(notifications): hold "finished" until background subagents and worker waits are done - #36992
Orca told you "Claude finished" every time the agent stopped talking, even when it had left helpers running in the background and was about to wake itself up again. A coordinator waiting on workers got one "finished" per worker message. Now "finished" goes out once, when the agent and its helpers are actually done. Questions and permission prompts still alert straight away, and a dev server left running doesn't keep a turn you asked for from alerting.
What Changed
Before: a turn that ended while a background subagent or a background orca orchestration check --wait was still running raised "finished". Every turn the agent started by itself (a subagent or command reporting back) raised another. In Kelvin's three busiest coordinators, 158 of 220 turns were self-started, and each alerted.
After: "finished" fires when the combined status row is done. The exceptions:
A turn the user started still alerts if only monitoring work is left (dev servers, watch loops, Monitor tool, crons).
A failed turn alerts immediately.
A turn the agent started itself that ends with only a monitor still running stays quiet, because that monitor will wake it again.
Live subagents and a background orca orchestration check --wait hold the alert. Permission and question prompts are unchanged.
Mechanism, terminal lane (Claude hooks, OSC 7501 agents):
One shared predicate, heldTurnCountsAsFinished (agent-lead-status-fold.ts), decides whether a turn held open by live work counts as finished.
claude-events.ts stamps turnCompletedAt (the "announce now" stamp every consumer reads) only when that predicate says so, and the OSC 7501 projector does the same. Subagent-held turns therefore announce on the ordinary all-clear done, after the wake-up turn that consumes the last result. The existing owed-notification debt already keeps the row working until then.
A background orca orchestration check --wait is tagged on Claude's launch record, from PostToolUse tool_input.command or, after a listener restart, from Stop's background_tasks[].command. It counts as agent work, not monitoring.
External-conversation connectors still relay every lead turn's reply. TerminalAgentTurnNews gets an everyLeadTurn option that reads the row's own mainAgent done instead of the notification stamp.
Mechanism, chat lane (Claude SDK, Codex app-server):
The host completion feed holds a successful settled request while the same predicate says it isn't finished, using the status feed's child work. It re-checks whenever child work is published, so a Codex parent, which has no wake-up turns, is announced once when its children drain.
Claude chat opens the lead's wake-up turn at the task_notification of a task the lead launched, instead of seconds later at its first output. A subagent's ending is taken from that notification, not the task_updated a millisecond before it. A task's ending wakes the subagent that launched it, resolved through the translator's existing child-tool owner registry.
A background orca orchestration check --wait is reported with the canonical operation orca orchestration check --wait, which the shared liveness counts as agent work.
Why
Root cause: both completion owners announced the lead's turn end instead of the combined row.
Chat: the host feed announced every settled request without reading child work, and Claude chat only opened the wake turn at the lead's first output.
In both lanes, a background check --wait was classified as a plain shell (monitoring).
Design note (from a design challenge with Codex as blind designer and attacker, two rounds, then four review rounds):
Chosen: fix it at each owner of the "announce now" decision, the hook listener and OSC projector stamp, and the host chat feed. Notification consumers (renderer, headless phone push) need no change. One shared predicate keeps the lanes from drifting.
Ruled out:
Consumer-side suppression of stamps: misses the headless phone push and connectors, and leaves producers advertising "announce now".
Recognising the wait through the runtime's mailbox waiter: the CLI registers its waiter after the process starts, so it races the turn end.
A new persisted child-work field for the wait: the existing operation carries it.
A user setting: Kelvin decided the new default with no setting.
Wake-up-turn duplicate: settled by opening Claude chat's wake turn at the notification frame, ending children at their notification, and waking a subagent when a task it launched ends. Verified with real Claude chat, including a subagent that backgrounds its own shell.
Known edges (accepted):
A self-started final wake that ends with only an unrelated long-lived watcher still running stays silent until that watcher ends.
An old remote host paired with a new client keeps today's behaviour.
In Claude chat, a background subagent whose spawn call was evicted from the 512-entry tool registry, because the lead made 512 more top-level tool calls while it ran, can still alert twice.
Follow-ups (not here):
A terminal user turn held by an agent-teams teammate that then becomes monitoring-only with no new turn.
Codex goal turns are not marked self-started.
Mail-pointer-only terminal coordinators (out of scope by decision).
Linear: STA-9570. Related: #13245, #26329. Supersedes the open community PRs for these issues.
Visual Proof
N/A: nothing on screen changes; the change is when desktop and phone notifications fire. I counted real notifications in a hidden dev build of this branch, reading every alert recorded in mobile-notification-dismissals.json:
Scenario (real agent)
Turn ends
"finished" alerts
Claude terminal: background subagent
3 (LAUNCHED, mid-run wake, SUBAGENT DONE)
1, after SUBAGENT DONE
Claude terminal: coordinator, background check --wait ×2
3
1, at ALL WORKERS DONE
Claude terminal: background dev server
1
1, at turn end
Claude terminal: question with a subagent running
n/a
needs-input alert at +9 s
Claude chat: background subagent
2
1, at SUBAGENT DONE
Claude chat: subagent that backgrounds its own shell
3
1, at SUBAGENT DONE
Claude chat: coordinator, background check --wait ×2
3
1, at ALL WORKERS DONE
Claude chat: background dev server
1
1, at turn end
Claude chat: question with a subagent running
n/a
prompt alert at +5 s
Codex chat: subagent outlives the parent turn
1
1, when the subagent finished
Codex terminal: subagent
1
1, after the subagent finished
Before, on main, replaying the real Claude 2.1.287 hook captures through the listener and the renderer's notification path: one subagent gave 2 alerts, a coordinator with 2 wakes gave 3, and the Monitor capture gave 5. The same replays now give 1, 1 and 2. In the Monitor case, the user turn that left the monitor running alerts, and so does the final turn after it ended.
Testing
Real runs above: Claude Code 2.1.316 and Codex 0.166 in a hidden (ORCA_BACKGROUND_LAUNCH=1) dev build on macOS, driven with orca agent launch. A stand-in orca script that blocks like check --wait kept the coordinator runs off any real mailbox.
Regression tests at the owners:
The listener stamp rule (agent hold, failure, coordinator wait including after a listener restart, wake turn left with a monitor).
Renderer notification replays of five real Claude captures plus a coordinator flow.
A host-level replay of the captured "subagent wakes after its own shell" frames through the real Claude adapter, translator and feed.
The chat feed hold (Codex-style drain, wait, failure, dev server, steer).
The decoder's notification-timed ending and wait tagging.
The OSC failure stamp.
The connector relaying a held turn's reply.
Focused suites and every dependent test of the changed modules pass (899 tests). check:code-quality:changed and check:react-doctor:changed are clean. CI covers the full suite, typecheck and Linux/Windows.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Security: no new inputs trusted. Wait recognition parses command text Orca already reads, and only Orca's own CLI name matches.
Cross-platform: no platform code. The launcher matcher reuses the browser command scanner, which accepts orca, orca-dev, orca-ide, .cmd and .exe.
Remote SSH and mixed versions: terminal status is decided on the host that runs the hooks, and chat completion on the chat host. No wire field is added or required. An old host with a new client keeps today's alerts, and a new host with an old client gets the new timing.
Mobile: phone pushes come from the same host decisions (chat feed, headless turn news), so they follow automatically.
Folder workspaces: unaffected.
Performance: the wait check returns early unless a command contains orchestration. The chat feed re-check on child-work publishes reads cached projections.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Walkthrough
The changes recognize Orca orchestration-wait commands and track background task state, including tasks that wait on worker agents. Claude child-work tracking defers some agent completion updates until task notifications and can wake a launcher after successful worker completion. Held-turn rules and structured completion feeds use live child-work state when deciding whether to announce a turn. Terminal turn news can also derive lead-turn completion timestamps when configured to report every lead turn.
Severity of issue fixed: Low
Merge Risk: Moderate · previous review 72f67
Completion notifications may arrive early, be suppressed, or leave a turn open. Resolve the remaining lifecycle concerns before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 60.87% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: delaying finished notifications until background subagents and worker waits complete.
Description check
The description is complete and directly addresses the template. It includes the user impact, implementation details, rationale, linked issue, visual proof, testing evidence, AI disclosure section, co…
Linked Issues check
Issue [#25663] requires Claude chat to withhold the "finished" notification while launched subagents remain active. StructuredAgentSessionTurnCompletionFeed reads child-work liveness and does not ac…
Out of Scope Changes check
The changes remain connected to completion-notification timing. Terminal stamp and OSC projection changes apply the same shared heldTurnCountsAsFinished policy to the other notification owner. Wait …
Full details: Description check
Explanation
The description is complete and directly addresses the template. It includes the user impact, implementation details, rationale, linked issue, visual proof, testing evidence, AI disclosure section, compatibility notes, and checklist status. It also explains that full lint, typecheck, test, and build checks are delegated to CI.
Full details: Linked Issues check
Explanation
Issue [#25663] requires Claude chat to withhold the "finished" notification while launched subagents remain active. StructuredAgentSessionTurnCompletionFeed reads child-work liveness and does not account for a successful settled request while heldTurnCountsAsFinished returns false. Child-work publication triggers another observation, so the completion is announced after the child work drains. ClaudeChildWorkDecoder ends background agents at task_notification, not the earlier terminal update, and the Claude chat row opens the wake-up turn at that notification. Tests cover live subagents and one final completion announcement.
Full details: Out of Scope Changes check
Explanation
The changes remain connected to completion-notification timing. Terminal stamp and OSC projection changes apply the same shared heldTurnCountsAsFinished policy to the other notification owner. Wait recognition classifies orca orchestration check --wait as agent work so the combined row remains held. Connector changes preserve each lead reply while suppressing duplicate finish announcements. Decoder, status, and fixture tests verify these paths. The reviewed evidence shows no unrelated product change.
Full details: Docstring Coverage
Explanation
Docstring coverage is 60.87% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 23 functions across 37 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Supported by static analysis
Script executed:
#!/bin/bash# Compare captured task_notification frames with and without a following lead wake.
rg -n -C4 "status: '(killed|stopped)'" src/main/claude --glob '*fixture*' --glob '*.test.ts'
rg -n -C3 "claudeChildWorkOutcome" src/main/claude
Repository: stablyai/orca
Length of output: 16352
Script executed:
set -eu
printf'%s\n''--- translator ---'
nl -ba src/main/claude/claude-structured-journal-translation.ts | sed -n '190,275p'printf'%s\n''--- outcome mapping ---'
nl -ba src/main/claude/claude-child-work-evidence.ts | sed -n '1,65p'printf'%s\n''--- decoder end ---'
nl -ba src/main/claude/claude-child-work-decoder.ts | sed -n '285,355p'printf'%s\n''--- translator tests around task notifications ---'
rg -n -C8 --glob '*translation*.test.ts' -e 'task_notification' -e 'ensureOpen' src/main/claude ||test"$?" -eq 1
printf'%s\n''--- decoder tests around stopped/killed wake behavior ---'
nl -ba src/main/claude/claude-child-work-decoder.test.ts | sed -n '205,255p'
Repository: stablyai/orca
Length of output: 41880
Script executed:
set -eu
printf'%s\n''--- decoder wakeOwner and notification path ---'
rg -n -C8 -F -- 'wakeOwner' src/main/claude
rg -n -C12 -F -- "subtype === 'task_notification'" src/main/claude/claude-child-work-decoder.ts
printf'%s\n''--- turn API and settlement ---'
rg -n -C8 -e 'ensureOpen' -e 'class .*Turn' -e 'settle\\(' src/main/claude src/shared | head -240
printf'%s\n''--- session end predicate ---'
rg -n -C8 -F -- 'claudeSessionStateEndsTurn' src/main/claude
nl -ba src/main/claude/claude-open-turn.ts | sed -n '1,235p'
Repository: stablyai/orca
Length of output: 9101
Do not open a turn for cancelled task notifications.
claudeChildWorkOutcome classifies killed and stopped notifications as cancelled. ClaudeChildWorkDecoder.end skips the owner wake for that outcome, but the translator still calls turn.ensureOpen for every known-origin task_notification. This can leave the turn open until a later settlement event.
Reuse claudeChildWorkOutcome(status) !== 'cancelled' before calling ensureOpen.
Suggested fix
import { claudeSessionStateEndsTurn } from './claude-session-state-turn-over'
+import { claudeChildWorkOutcome } from './claude-child-work-evidence'
The reason will be displayed to describe this comment to others. Learn more.
@MetrixAiforAll The proposed guard addresses the concern. It prevents killed and stopped notifications from opening a turn because claudeChildWorkOutcome maps both to cancelled. Other outcomes retain the existing known-origin check.
I have not verified that this patch is applied to the PR branch.
A successful steer returns via: 'steer', but accepted dispatches cannot carry answeredInTurn, and journal rows store that field only for rejected dispatches. An accepted steer can therefore leave selfStarted: true. Completion handling then waits for monitoring work instead of treating the user-steered turn as finished. Store the steer linkage on accepted submissions or derive it from another persisted user-message signal. An accepted test fixture that includes answeredInTurn does not match the accepted dispatch contract.
The reason will be displayed to describe this comment to others. Learn more.
successful steer returns via: 'steer', but accepted dispatches cannot carry answeredInTurn, and journal rows store that field only for rejected dispatches. An accepted steer can therefore leave selfStarted: true. Completion handling then waits for monitoring work instead of treating the user-steered turn as finished. Store the steer linkage on accepted submissions or derive it from another persisted user-message signal. An accepted test fixture that includes answeredInTurn does not match the accepted dispatch contract.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h as running work
Publishing or watching a claude.ai artifact arms a live-updates watch that
Claude lists in background_tasks as a running monitor until the session
exits. Orca counted it as live work, so the pane sat in "monitoring" for
the rest of the session. The inventory now skips it, as Claude's own task
footer does (stablyai#26192).
The other half of the earlier local fix (announce a turn only when it is
not waiting on its own work) is dropped: upstream stablyai#36992 replaced it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
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.
ELI5
Orca told you "Claude finished" every time the agent stopped talking, even when it had left helpers running in the background and was about to wake itself up again. A coordinator waiting on workers got one "finished" per worker message. Now "finished" goes out once, when the agent and its helpers are actually done. Questions and permission prompts still alert straight away, and a dev server left running doesn't keep a turn you asked for from alerting.
What Changed
Before: a turn that ended while a background subagent or a background
orca orchestration check --waitwas still running raised "finished". Every turn the agent started by itself (a subagent or command reporting back) raised another. In Kelvin's three busiest coordinators, 158 of 220 turns were self-started, and each alerted.After: "finished" fires when the combined status row is done. The exceptions:
Live subagents and a background
orca orchestration check --waithold the alert. Permission and question prompts are unchanged.Mechanism, terminal lane (Claude hooks, OSC 7501 agents):
heldTurnCountsAsFinished(agent-lead-status-fold.ts), decides whether a turn held open by live work counts as finished.claude-events.tsstampsturnCompletedAt(the "announce now" stamp every consumer reads) only when that predicate says so, and the OSC 7501 projector does the same. Subagent-held turns therefore announce on the ordinary all-cleardone, after the wake-up turn that consumes the last result. The existing owed-notification debt already keeps the row working until then.orca orchestration check --waitis tagged on Claude's launch record, from PostToolUsetool_input.commandor, after a listener restart, from Stop'sbackground_tasks[].command. It counts as agent work, not monitoring.TerminalAgentTurnNewsgets aneveryLeadTurnoption that reads the row's ownmainAgentdone instead of the notification stamp.Mechanism, chat lane (Claude SDK, Codex app-server):
task_notificationof a task the lead launched, instead of seconds later at its first output. A subagent's ending is taken from that notification, not thetask_updateda millisecond before it. A task's ending wakes the subagent that launched it, resolved through the translator's existing child-tool owner registry.orca orchestration check --waitis reported with the canonical operationorca orchestration check --wait, which the shared liveness counts as agent work.Why
Root cause: both completion owners announced the lead's turn end instead of the combined row.
claude-events.tsstamped any Stop held open by running child work, and each self-started wake turn ended in a freshdone.check --waitwas classified as a plain shell (monitoring).Design note (from a design challenge with Codex as blind designer and attacker, two rounds, then four review rounds):
operationcarries it.Linked Issue
Fixes #25663
Linear: STA-9570. Related: #13245, #26329. Supersedes the open community PRs for these issues.
Visual Proof
N/A: nothing on screen changes; the change is when desktop and phone notifications fire. I counted real notifications in a hidden dev build of this branch, reading every alert recorded in
mobile-notification-dismissals.json:check --wait×2check --wait×2Before, on
main, replaying the real Claude 2.1.287 hook captures through the listener and the renderer's notification path: one subagent gave 2 alerts, a coordinator with 2 wakes gave 3, and the Monitor capture gave 5. The same replays now give 1, 1 and 2. In the Monitor case, the user turn that left the monitor running alerts, and so does the final turn after it ended.Testing
Real runs above: Claude Code 2.1.316 and Codex 0.166 in a hidden (
ORCA_BACKGROUND_LAUNCH=1) dev build on macOS, driven withorca agent launch. A stand-inorcascript that blocks likecheck --waitkept the coordinator runs off any real mailbox.Regression tests at the owners:
Focused suites and every dependent test of the changed modules pass (899 tests).
check:code-quality:changedandcheck:react-doctor:changedare clean. CI covers the full suite, typecheck and Linux/Windows.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
orca,orca-dev,orca-ide,.cmdand.exe.orchestration. The chat feed re-check on child-work publishes reads cached projections.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)