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
Preserve WSL Codex question and child completion status - #34724
A Codex question in a WSL terminal could show Working while it waited for an answer. A child that finished without its stop hook could also keep the pane Working after the guest reported completion. The receiver now preserves those guest status facts.
What Changed
Reuse the existing question-tool classification when reconciling relayed Codex events. Reconcile complete transcript rosters so finished children disappear, while retaining ambiguous rosters shed to fit a transport frame.
Why
The main process re-derived every PreToolUse event as working and only merged child additions. It could overwrite a guest question and retain a completed child indefinitely. Current production scope is the WSL hook relay; paired-host and SSH snapshot mirroring use a separate path.
Linked Issue
Separately discovered WSL parity defects while investigating the supplied remote-terminal status report.
Visual Proof
Question, before:
(screenshot removed: contained real product data)
Question, after:
(screenshot removed: contained real product data)
Completed child, before:
(screenshot removed: contained real product data)
Completed child, after:
(screenshot removed: contained real product data)
These are actual baseline/target normalization, relay-cache, envelope, and ingestion results delivered unchanged through the normal main-to-renderer IPC seam in hidden macOS Electron. They verify receiver behavior and presentation; they do not exercise native Windows/WSL transport.
Testing
Independent review passed 62 tests across 10 focused suites.
Red/green ingestion tests cover current/older payloads, approval and answer transitions, two children completing separately, relay restart, and a shed-roster safety control.
Separate reviewer exercised the rendered IPC path: one Electron test passed, all four screenshots visually inspected. Working becomes Waiting for input; completed child Working becomes Done.
Final-head CI: all 42 reported checks settled successfully, including Ubuntu, Debian, and Fedora WSL.
Required local ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: all 23 selected checks passed at the final commit.
Review
One bounded pass over the affected roster; no new timers, I/O, subprocesses, wire fields, or platform assumptions. Incomplete wire data cannot falsely end live work. Folder workspace identity is preserved. Desktop and mobile consumers receive the same existing status fields.
Agent skill upstream boundary
No upstream skill-installer source was copied.
Notes
Native Windows/WSL transport and physical mobile execution were not performed locally. Targets main after #34721 was merged. The original parent commit includes that already-merged one-line test-import repair.
Checklist
Focused receiver fix with independent review and rendered evidence.
Compatibility, failure handling, cleanup, and performance reviewed.
Required local affected checks and final-head CI complete.
Codex hook state inference now uses the tool name to identify ask-user-question events. Child roster reconciliation handles explicit rosters, done polls without a roster, and working polls with shed-subagents data. New tests cover remote question handling, child completion, and truncated snapshots. A Claude rewind transcript test import path also changed.
Priority: Normal
Merge Risk: Low · previous review cce61
Some WSL Codex sessions may briefly show the wrong question or child status. These are bounded display-state issues, but the roster case affects a behavior this change aims to fix.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description follows the template well. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Review, Agent skill upstream boundary, Notes, and Checklist sections. The Linked Issue s…
Add a real linked issue in the "Fixes #" line, or confirm the author is a stablyai maintainer who should attach a pre-existing issue. Fill in the AI Disclosure section or state that it does not apply. Confirm the Testing checkbox for manual…
Docstring Coverage
Docstring coverage is 50.00% 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: 3 passed
Check name
Status
Explanation
Title check
The title "Preserve WSL Codex question and child completion status" matches the main change. The diff makes the receiver keep Codex questions in a waiting state and clears completed child agents from …
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.
Full details: Title check
Explanation
The title "Preserve WSL Codex question and child completion status" matches the main change. The diff makes the receiver keep Codex questions in a waiting state and clears completed child agents from the roster for WSL relayed Codex events. The title is specific and concise, and a teammate scanning history would understand the primary change.
Full details: Description check
Explanation
The description follows the template well. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Review, Agent skill upstream boundary, Notes, and Checklist sections. The Linked Issue section lacks an actual issue reference ("Fixes #" is empty), and it says the work relates to separately discovered defects, not a linked issue. The AI Disclosure section is absent. The Testing section has detailed validation. The Checklist is filled in. The Visual Proof section has before/after images for the UI behavior change. The main gap is the missing issue link, which the template says must always exist for outside contributors.
Resolution
Add a real linked issue in the "Fixes #" line, or confirm the author is a stablyai maintainer who should attach a pre-existing issue. Fill in the AI Disclosure section or state that it does not apply. Confirm the Testing checkbox for manual local testing against the platforms actually tested (macOS was used; native Windows/WSL transport was not exercised).
Full details: Docstring Coverage
Explanation
Docstring coverage is 50.00% 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 2 functions across 4 files.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
set -o pipefail
printf'%s\n''--- envelope build ---'
sed -n '1,280p' src/wsl-guest/agent-hook-envelope-build.ts
printf'%s\n''--- envelope publication ---'
sed -n '1,340p' src/wsl-guest/agent-hook-envelope-publication.ts
printf'%s\n''--- WSL hook server path ---'
sed -n '1,280p' src/wsl-guest/agent-hook-server.ts
printf'%s\n''--- canonical status and cached status ---'
sed -n '1,240p' src/wsl-guest/agent-hook-canonical-status.ts
sed -n '1,240p' src/wsl-guest/agent-hook-cached-pane-status.ts
Repository: stablyai/orca
Length of output: 30246
Script executed:
set -o pipefail
printf'%s\n''--- canonical status event ---'
rg -n -F --glob '*.ts' -e 'tmuxCanonicalStatusEvent' -e 'AgentHookEventPayload' src/shared/tmux-selected-status.ts src/shared src/wsl-guest | head -160
sed -n '1,280p' src/shared/tmux-selected-status.ts
printf'%s\n''--- canonical status store and event mutation ---'
rg -n -F --glob '*.ts' -e 'createAgentStatusStore' -e 'hookEventName' src/shared/tmux-agent-hook-owner.ts src/shared/agent-status-store.ts src/shared/tmux-selected-status.ts | head -200
sed -n '1,280p' src/shared/tmux-agent-hook-owner.ts
Repository: stablyai/orca
Length of output: 32393
Preserve an authoritative empty Codex roster.
Transcript reconciliation can remove the last child while the root remains working. codexRosterToSnapshots then omits subagents. The relay forwards that omission without a shed marker. The receiver does not prune the cached child for named root events, so the stale child can keep the row working until a later clearing event.
Use an explicit empty roster for an existing host roster. Reconcile explicit rosters for named events. Preserve the empty-roster digest when transport shedding occurs.
--- a/src/shared/agent-hook-listener/providers/codex-state.ts+++ b/src/shared/agent-hook-listener/providers/codex-state.ts
@@
if (
- !eventName &&
payload.mainAgent &&
- (payload.subagents !== undefined || payload.state === 'done')+ (payload.subagents !== undefined || (!eventName && payload.state === 'done'))
) {
- // A working poll can shed its roster in transit; only explicit children or done prove removals.+ // Explicit rosters are authoritative; an unlabelled done payload also proves removals.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Do not classify a cached tool name as the current question.
If an unnamed PreToolUse follows a request_user_input response, resolveToolState can retain request_user_input as payload.toolName. The host classifies the new event as working, but this call changes the receiver’s lead state to waiting. Preserve the current event’s tool identity separately, or clear the cached name for an unnamed PreToolUse. (raw.githubusercontent.com)
…g relay session
- Unlabelled relayed polls retire only children the current relay link listed;
each WSL link starts a new session, so a restarted guest's partial roster
cannot delete children an earlier guest reported.
- One removal rule: an explicit list, a done aggregate, or an unshed absent
roster proves removals; a shed roster with live work keeps the children.
Drops the old done-main-agent clear that wiped shed rosters.
- An unshed poll with no roster now retires the last child while the root works.
- Share the Codex hook event-to-state rule between local and relayed paths.
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 Codex question in a WSL terminal could show Working while it waited for an answer. A child that finished without its stop hook could also keep the pane Working after the guest reported completion. The receiver now preserves those guest status facts.
What Changed
Reuse the existing question-tool classification when reconciling relayed Codex events. Reconcile complete transcript rosters so finished children disappear, while retaining ambiguous rosters shed to fit a transport frame.
Why
The main process re-derived every PreToolUse event as working and only merged child additions. It could overwrite a guest question and retain a completed child indefinitely. Current production scope is the WSL hook relay; paired-host and SSH snapshot mirroring use a separate path.
Linked Issue
Separately discovered WSL parity defects while investigating the supplied remote-terminal status report.
Visual Proof
Question, before:
(screenshot removed: contained real product data)
Question, after:
(screenshot removed: contained real product data)
Completed child, before:
(screenshot removed: contained real product data)
Completed child, after:
(screenshot removed: contained real product data)
These are actual baseline/target normalization, relay-cache, envelope, and ingestion results delivered unchanged through the normal main-to-renderer IPC seam in hidden macOS Electron. They verify receiver behavior and presentation; they do not exercise native Windows/WSL transport.
Testing
ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: all 23 selected checks passed at the final commit.Review
One bounded pass over the affected roster; no new timers, I/O, subprocesses, wire fields, or platform assumptions. Incomplete wire data cannot falsely end live work. Folder workspace identity is preserved. Desktop and mobile consumers receive the same existing status fields.
Agent skill upstream boundary
Notes
Native Windows/WSL transport and physical mobile execution were not performed locally. Targets
mainafter #34721 was merged. The original parent commit includes that already-merged one-line test-import repair.Checklist