Repository navigation
fix(agent-status): keep a nested child hook's model off the fenced parent row - #13602
brennanb2025 wants to merge 2 commits into
Conversation
…rent row A nested child CLI (claude running codex exec) inherits the pane key, and its hook events already have their agentType fenced to the parent identity — but the child's model rode through and relabeled the parent row (e.g. gpt-5.6-sol on a Claude session), persisting after the child exited because parent Stop events carry no model. Fence the model beside the agentType at both merge points: the main hook server (authoritative path) and the renderer slice (protects paired clients receiving payloads from an older host). STA-3754
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe change preserves the active parent agent model when nested agent events inherit the parent identity. Server normalization and renderer status updates now retain the existing model for inherited events. Tests cover active and completed parent sessions, including cases where the parent has no model. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
|
Review + QA gates complete at head 9a6ebd2. Live repro (before, dev Electron @ main): real Claude session ran Review: same-model Codex loop (gpt-5.5 xhigh) via Orca orchestration — round 1 found the parent-completion path could still drop the preserved model in the main cache and pushed 9a6ebd2 (main-side carry-forward + test); round 2 returned clean. Verification:
Linear STA-3754 moved to In Review with this PR attached. Known limit (from the clean pass): same-agent nested CLIs (claude inside claude) remain indistinguishable without a scoped signal — out of scope here. |
Records the retained adapted contribution from #13602 in replacement PR #26846. Co-authored-by: Brennan Benson <[email protected]>
Records the retained adapted contribution from #13602 in replacement PR #26846. Co-authored-by: Brennan Benson <[email protected]>
* fix(agent-status): keep nested models off the parent pane Preserve the parent's model when the existing identity fence retains an active parent for a nested CLI hook. Exercise native SessionStart and Stop bodies alongside model updates and legitimate pane takeovers. Adapted from PR #25687, with real native-hook and hidden renderer proof. Co-authored-by: Regis <[email protected]> * chore: record original authorship for Parent-pane model ownership Records the retained adapted contribution from #13602 in replacement PR #26846. Co-authored-by: Brennan Benson <[email protected]> * test: drop redundant single-agent model case --------- Co-authored-by: Regis <[email protected]> Co-authored-by: Brennan Benson <[email protected]> Co-authored-by: m4air <[email protected]>
|
Running another agent inside a session no longer changes the outer agent's displayed model. The replacement, including the contribution from this PR, landed in #26846. |
Summary
When Claude runs `codex exec` (or any agent CLI nests another), the child's hooks fire on the inherited pane key. The identity fence already keeps the parent's `agentType`, but the child's model rode through the fenced payload and relabeled the parent row — a Claude session showing `gpt-5.6-sol` in the sidebar model chip — and it persisted after the child exited, because parent Claude Stop events carry no model to overwrite it back.
Fix: fence `model` beside `agentType` at both merge points —
Fixes STA-3754 (parent session identity contaminated by nested delegation). The reported full icon flip is already fenced for hook agents on current main; the model chip was the remaining leak, reproduced live.
Screenshots
No visual change beyond removing the wrong model label. Live before/after evidence (dev Electron, real Claude session running real `codex exec`):
Testing
AI Review Report
Reviewed by the automation loop that authored it; an independent same-model Codex review round is being dispatched and its outcome will be posted as a PR comment. Risks checked: nested-hook identity fence semantics (working vs done suppression), SSH-relay root-model preservation interplay (`preservedRootModel` path is upstream of the fence and unaffected when identity is not inherited), mixed-version wire compatibility (renderer fence retained for old-host payloads), cross-platform: pure TypeScript state logic, no platform-specific behavior, no shortcuts/paths/shell involvement.
Security Audit
No input handling, command execution, path handling, auth, secrets, dependency, or IPC surface changes; the change narrows which fields of an already-accepted hook payload are merged into displayed state.
Notes