Repository navigation
fix(agent-status): stop nested reviews from collapsing Claude children - #29264
Conversation
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
30757c82-f9a8-4e81-82dc-60f1b767f83c
📒 Files selected for processing: 10
config/reliability-gates.jsoncsrc/main/agent-hooks/server-ingest-remote.test.tssrc/main/agent-hooks/server-nested-agent-model.test.tssrc/main/agent-hooks/server-nested-agent-roster.test.tssrc/main/agent-hooks/server/server-status-update.tssrc/renderer/src/hooks/ipc-events/agent-status-event-applicator.tssrc/renderer/src/store/slices/agent-status-live-entry-builder.tssrc/renderer/src/store/slices/agent-status-tool-assistant-fields.test.tssrc/shared/agent-hook-listener.tssrc/shared/agent-status-identity.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
ELI5
Claude's sidebar kept expanding and collapsing because Codex reviews launched inside Claude inherited its terminal identity. Each review could replace Claude's status, including its list of 32 children. This keeps the owning Claude status intact while those reviews run.
What Changed
Why
The existing guard preserved the parent's agent name and model but still accepted the nested provider's working payload. That payload had no Claude children, so the next Claude update restored the list and moved everything below it again. Enforcing ownership in the host's status store fixes every reader; a sidebar debounce would only conceal the corrupted status.
Regression history: #8211 (
31cff75a7ba0, “show Claude subagent child rows and gate premature done”) introduced the child rows involved in the visible collapse/reappear symptom. The underlying incomplete ownership rule came from #3990 (2e1ffe0ad96b): it suppressed inheriteddoneevents but admitted inherited working events with the parent's name. These are source-history findings; an end-to-end historical bisect was not run.Linked Issue
User-reported incident in
nwparker/SSH, terminalterm_a8f6fd07-eeb3-480f-9626-9a5ba11a8320.Related: #10105 and #22767. These remain open: active-parent corruption is fixed, but completed-parent background hooks still reproduce the broader ownership problem.
Visual Proof
Before — the user's two reported alternating states:
After — hidden macOS Electron reproduction: actual
WorktreeCardAgents, store and hook IPC in a temporary harness. Sent a synthetic Claude 32-child roster through the real authenticated hook endpoint, then 60 nested Codex lifecycle/tool/approval/completion hooks. All 32 children remained; the observed rows had zero DOM mutations and constant scroll height. This is synthetic hook reproduction, not a new model-backed SSH run. Screenshot cropped to the rendered status list.Testing
ORCA_BACKGROUND_LAUNCH=1 pnpm tc.pnpm run check:code-quality:changed, changed-file oxlint, reliability manifest validation (147 gates), andgit diff --check.Final focused command:
ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/agent-hooks/server-nested-agent-roster.test.ts src/main/agent-hooks/server-nested-agent-boundaries.test.ts src/main/agent-hooks/server-nested-agent-consumers.test.ts src/main/agent-hooks/server-nested-agent-model.test.ts src/main/agent-hooks/server-ingest-remote.test.ts src/main/agent-hooks/server-hook-http-ingest.test.ts src/main/agent-hooks/server-turn-started-at.test.ts src/main/agent-hooks/server-status-listener-fanout.test.ts src/main/agent-hooks/terminal-handle-row-identity.test.ts src/renderer/src/store/slices/agent-status-tool-assistant-fields.test.ts src/renderer/src/store/slices/agent-status-provider-session.test.ts src/renderer/src/store/slices/agent-status-nested-resume.test.ts src/wsl-guest/agent-hook-provider-normalization.test.ts --maxWorkers=2Live SSH/WSL, Linux, Windows and physical mobile validation remain for follow-up. Relay contracts ran over loopback. The full PR workflow passed on
da2fefd6bc2cb569804073abc4578d3b7086c43c, including all five test shards, relay integration, static analysis/typecheck, managed hooks, both package builds and thePR checks passedaggregate. SSH Windows hosts, Headless Node server, Mobile Checks and test-size workflows also passed. CI run.Review
Final sub-agent review found no remaining blockers after corrections. Sub-agent review identified a relay handoff risk; corrected it with provider-specific normalization caches and HTTP/spool/replay/teardown regression tests. Also corrected monotonic clock ordering and added explicit Pi identity-only replacement controls. CI exposed a cross-host pane-key collision regression; the guard now uses the existing host/workspace owner check, with local HTTP, SSH, WSL transport and legacy unstamped-renderer controls. Reviewed ownership before cache mutation, unchanged parent freshness, legitimate replacement, child completion, and mixed-version relay ingestion. The new experimental gate
agent-status.nested-provider-rosterrecords the invariant, evidence, budget, and coverage gaps.Agent skill upstream boundary
Related report verification
claude --resume claude-parentthrough nested Codex working/waiting/done updates. Main HTTP and relay tests separately assert the complete parent snapshot remains unchanged.codex execin its pane #25686: already closed by fix(agent-status): keep nested models off parent panes #26846; existing nested model-preservation tests pass with this broader ownership fix.Completed-parent follow-up: Temporary negative checks on this PR commit confirmed that
Claude UserPromptSubmit → Claude Stop (no live children) → nested Codex UserPromptSubmitstill selects the Codex session in the mobile builder. The equivalent renderer sequence captures a sleeping resume record withagent: codexand the child session. This follows the pre-existing rule permitting provider replacement afterdone; distinguishing a foreground idle process from its nested child needs process/session ownership beyond this PR. The negative checks are diagnostic, not part of the passing regression suite. #10105 and #22767 are therefore left open.Notes
No wire format changes, polling, timers or subprocesses added. Reuses the existing constant-time identity decision. Relay caches are bounded by the existing pane limit per finite provider and cleared on teardown/stop. A nested CLI observed before its owner can still establish initial identity; same-provider nesting retains existing session/process rules.
Checklist