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 stale Working status for completed Codex subagents - #32937
A paused Codex session could keep spinning yellow in Orca because one of its already-finished subagents still appeared to be working. Orca now checks that child's transcript and settles the pane when the child finishes, even if its stop hook never arrives.
What Changed
Enroll hook-discovered and restored Codex children in the existing bounded transcript reconciler, including when the child is absent from the root rollout's retained tail. Reconcile child starts using the known root transcript, recover that path from retained session metadata after restart, and remove the tracked cursor on an explicit child stop.
Four regression cases cover a live child completing without a stop hook, a delayed start for a completed child, restart recovery, and explicit stop before the transcript completion is flushed. Added experimental reliability gate agent-status.codex-hook-child-transcript-completion.
Why
The reported pane correctly had a done main agent but retained a working catalog_tests child whose transcript already recorded completion. Hook-only children were never enrolled in transcript polling. Reusing the existing reconciler preserves live-child aggregation and the existing read limits and cadence.
Linked Issue
Internal maintainer report from a live Orca session; no separate issue.
Visual Proof
Before/after verification in this PR worktree used separate hidden Electron instances and fresh profiles with a non-git folder workspace. Replayed hook events against copies of the actual affected root and child rollout tails through each test app's authenticated hook endpoint; no fresh provider turn was started.
The parent implementation stayed visibly yellow Working for the already-completed child (main agent done) throughout a 3.5-second observation. Identical input on the PR implementation settled to green Done. Screenshots and renderer/main status snapshots agree.
The fixed app also kept a live child Working, then settled through the real server poll scheduler after only appending transcript completion. An active root stayed Working after its child completed, and explicit child stop settled before transcript completion flushed. All test windows stayed hidden; owned test apps/tabs were closed and the worktree was restored clean.
Testing
Reproduced the stuck yellow state on the parent implementation and verified rendered completion on the PR code in hidden Electron via CDP.
The committed regression suite fails three cases on the parent implementation; all four cases pass with the fix.
Added automated regression tests; 131 tests passed across 17 focused Codex suites on the PR branch.
ORCA_BACKGROUND_LAUNCH=1 pnpm tc:node passed.
pnpm run check:code-quality:changed, reliability-manifest validation, and git diff --check passed.
The actual 146 MB root rollout reconciled its completed phantom child in about 10 ms using the existing 1 MB read cap.
CI passed: full PR aggregate gate, all five Node test shards, relay integration, static/typecheck, packaging including Windows, mobile verification, WSL Ubuntu/Debian/Fedora, persistence, and managed hooks on Node 18.
Review
Invariant: a completed hook-only child must not keep a done lead working; a live child must still hold the combined state open. Root-session ownership and the child transcript are the oracle. Explicit child stop must also retire its cursor and end polling.
Agent skill upstream boundary
Not applicable; no upstream skill-installer material copied.
Notes
macOS local normalization and hidden UI are covered. Non-git folder workspace status was exercised end to end; local/daemon PTY lifecycle and routing are unchanged. SSH and WSL share the normalizer; their transport integration, Windows/Linux execution, and mobile UI are unverified. No wire-format change, new timer, subprocess, or global scan. A child with no known root transcript still relies on hook completion. Launch-before-transcript-flush races and cross-day resumed-child discovery remain outside this gate.
Checklist
Small and focused; behavior and mechanism explained.
Working/Done screenshots attached.
Self-reviewed for correctness and performance.
Cross-platform, remote, mobile, folder-workspace, and compatibility impact considered.
Focused tests, node typecheck, changed-code quality, full CI, and baseline/fixed hidden UI checks passed.
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
Codex lifecycle hooks now reconcile child transcripts using the parent transcript path when available. Transcript reconciliation seeds missing child tracking entries from the roster. Tests cover completion through transcript polling, delayed hooks, restart reconciliation, and explicit stops. The reliability-gate configuration records the experimental gate’s verification details and criteria.
Priority: Normal
Merge Risk: Minimal · up to f59b7
The change appears mergeable after normal checks. The remaining platform and transport scenarios have not been verified, but no concrete failure is established.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 …
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 describes the primary change: correcting stale Working status for completed Codex subagents.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the repository template well. It has an ELI5, What Changed, Why, Testing, Review, Notes, and Checklist. Its Testing section gives specific platforms and commands. It also state…
Full details: Description check
Explanation
The description follows the repository template well. It has an ELI5, What Changed, Why, Testing, Review, Notes, and Checklist. Its Testing section gives specific platforms and commands. It also states macOS-only coverage and the remaining gaps for SSH, WSL, Windows, Linux, and mobile. Three gaps remain. The Linked Issue section says there is no separate issue and gives only an internal maintainer report, so it does not follow the template's 'Fixes #' format. The AI Disclosure section is empty. The Visual Proof section gives before/after screenshots and a hidden Electron verification method, so it meets the UI requirement. The Agent skill upstream boundary box is checked.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
✨ 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.
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
A paused Codex session could keep spinning yellow in Orca because one of its already-finished subagents still appeared to be working. Orca now checks that child's transcript and settles the pane when the child finishes, even if its stop hook never arrives.
What Changed
Enroll hook-discovered and restored Codex children in the existing bounded transcript reconciler, including when the child is absent from the root rollout's retained tail. Reconcile child starts using the known root transcript, recover that path from retained session metadata after restart, and remove the tracked cursor on an explicit child stop.
Four regression cases cover a live child completing without a stop hook, a delayed start for a completed child, restart recovery, and explicit stop before the transcript completion is flushed. Added experimental reliability gate
agent-status.codex-hook-child-transcript-completion.Why
The reported pane correctly had a done main agent but retained a working
catalog_testschild whose transcript already recorded completion. Hook-only children were never enrolled in transcript polling. Reusing the existing reconciler preserves live-child aggregation and the existing read limits and cadence.Linked Issue
Internal maintainer report from a live Orca session; no separate issue.
Visual Proof
Before/after verification in this PR worktree used separate hidden Electron instances and fresh profiles with a non-git folder workspace. Replayed hook events against copies of the actual affected root and child rollout tails through each test app's authenticated hook endpoint; no fresh provider turn was started.
The parent implementation stayed visibly yellow Working for the already-completed child (main agent done) throughout a 3.5-second observation. Identical input on the PR implementation settled to green Done. Screenshots and renderer/main status snapshots agree.
The fixed app also kept a live child Working, then settled through the real server poll scheduler after only appending transcript completion. An active root stayed Working after its child completed, and explicit child stop settled before transcript completion flushed. All test windows stayed hidden; owned test apps/tabs were closed and the worktree was restored clean.
Testing
ORCA_BACKGROUND_LAUNCH=1 pnpm tc:nodepassed.pnpm run check:code-quality:changed, reliability-manifest validation, andgit diff --checkpassed.Review
Invariant: a completed hook-only child must not keep a done lead working; a live child must still hold the combined state open. Root-session ownership and the child transcript are the oracle. Explicit child stop must also retire its cursor and end polling.
Agent skill upstream boundary
Notes
macOS local normalization and hidden UI are covered. Non-git folder workspace status was exercised end to end; local/daemon PTY lifecycle and routing are unchanged. SSH and WSL share the normalizer; their transport integration, Windows/Linux execution, and mobile UI are unverified. No wire-format change, new timer, subprocess, or global scan. A child with no known root transcript still relies on hook completion. Launch-before-transcript-flush races and cross-day resumed-child discovery remain outside this gate.
Checklist