Repository navigation
fix(ui): make subagent sessions view-only - #139381
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 5, 2026, 7:15 PM ET / 23:15 UTC. ClawSweeper reviewWhat this changesThe Control UI replaces subagent message controls with parent-session navigation, preserves Stop for abortable runs, and adds regression coverage and documentation. Merge readiness⛔ Blocked before merge - 1 item remains This PR remains useful: current main and v2026.9.2 lack the subagent composer restriction. No blocking introduced defect was found, and the maintainer-authored scope is explicit. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI uses Gateway session metadata to display conversations and their parent-child relationships. Its composer determines whether users can send messages, navigate to the parent, or stop an active run. flowchart TD
A[Gateway session metadata] --> B[Chat pane]
B --> C{Subagent session?}
C -->|Yes| D[View-only banner]
C -->|No| E[Normal composer availability]
D --> F[Open parent conversation]
D --> G[Stop abortable run]
E --> H[Send permitted message]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +116, Docs +5. Total +121 across 12 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep subagent transcripts inspectable with a clear route to the parent conversation, while preserving existing session-scoped Stop handling. Do we have a high-confidence way to reproduce the issue? Yes, from source: opening a spawned session on current main reaches composer availability without a subagent restriction. This review did not execute the UI. Is this the best way to solve the issue? Yes. Reusing the replacement banner and existing parent-lineage resolver is a narrow solution, with explicit send guards and ordinary nested-session coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f946f93da4e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper approve |
|
🦞👀 Command router queued. I will update this comment with the next step. |
d000bb8 to
997c0fa
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: (95 commits) perf(build): avoid unrelated gateway artifact scans (#127757) fix(update): deliver terminal progress after long updates (#139289) fix(ui): show session hover cards for local chat URLs (#139384) perf(ui): reuse unchanged transcript key snapshots (#139400) fix(ui): make subagent sessions view-only (#139381) fix: open agent state on SQLite builds without extensions (#139487) perf(skills): detach cached metadata from source strings (#139478) fix(ui): show primary user in multi-agent profile hero (#136736) perf(sessions): stop decoding the session row four times per SQLite entry patch (#136361) refactor(exec): share package-manager option scans (#139482) fix(ci): authorize frozen mobile release candidates (#139441) fix: avoid session deletion slowdown in large session stores (#139467) perf(gateway): reuse node invocation idle timers (#139354) fix(auth): preserve selected profiles across plugin scopes (#139413) fix(discord): retain voice input until transcription completes (#139484) fix(agents): name Gateway storage failures in run-failure copy (#139409) fix: keep subagent checks responsive in large session stores (#139450) fix(memory): index notes when optional embeddings cannot start (#139463) fix: refresh pending approvals when reopening chat (#139457) fix(tooling): preserve Git hook choices during install (#139461) ...
* fix(ui): make subagent sessions view-only * fix(ui): retain explicit composer send guards
Problem
Opening a subagent session in the main chat view showed the normal message composer, model/access pickers, microphone, and attachment controls. The parent breadcrumb knew the lineage, but composer availability did not use it. Subagent runs belong to their parent; direct human conversations in these sessions are not a supported Control UI flow.
Solution
Use the existing composer-replacement banner for spawned sessions and subagent session keys. The banner identifies the parent using the same navigation lineage and display name as the breadcrumb and offers Open parent session. Unresolved metadata leaves the child view-only; ordinary nested sessions without subagent ownership remain editable.
The pane owns availability directly instead of forwarding it through a single-caller helper. Model setup, archived sessions, and restart-recovery tombstones keep explicit send guards independent of disabled-reason text. Replacement banners render only the shared Stop action, so retained drafts cannot replace it with a disabled Send button. They also suppress pending question answer forms.
Impact
The main subagent view remains readable, with parent navigation and Stop when an abortable run is available. The normal message composer and send controls are hidden. No Gateway acceptance rules change.
Gateway audit:
chat.sendretains ordinary session authorization, send-policy, and lifecycle admission; it has no blanket rejection based on spawned-session lineage (chat-send-setup.ts,chat-send-session.ts,chat-send-pre-admission.ts).subagent-control-scope.tsgoverns which child runs a controller owns, not human chat admission. Gateway enforcement is a coordinator follow-up.Composer Stop and Tasks Stop are different RPC paths. The composer uses
chat.abortorsessions.abort; exact recovered embedded runs resolve their captured owner throughsessions-abort.ts. Tasks usestasks.canceland its task-owned cancellation/ownership checks. This change preserves the composer path. Focused tests cover native embedded cancellation; universal ACP/harness-mirrored Stop equivalence was not established.Evidence
canSendis true.sessions.abort-agent-scope.test.tsandsessions.abort-embedded.test.ts.node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-composer*.test.ts ui/src/pages/chat/chat-composer*.test.ts ui/src/pages/chat/chat-pane-placement-composer.test.ts ui/src/pages/chat/run-lifecycle.test.ts— 18 files, 268 tests passed, including browser checks.node scripts/check-changed.mjs— passed (exit 0), including formatting, i18n, both typecheck lanes, declaration/dead-export guards, core lint, and changed UI style checks.node scripts/run-vitest.mjs ui/src/pages/chat/chat-composer-subagent.test.ts ui/src/pages/chat/chat-composer.test.ts ui/src/pages/chat/chat-model-setup.test.ts ui/src/pages/chat/chat-pane-placement-composer.test.ts— 4 files, 59 tests passed after the availability-guard follow-up. The real-pane model-setup test pins required setup with null disabled-reason text and no send dispatch; the existing replacement banner already blocked this case before the explicit terms were restored.pnpm ui:i18n:baseline— passed, no generated-file changes.git diff --check— passed.scoped-clean, no accepted/actionable findings.Release-note: Make subagent sessions view-only in the Control UI, with clear parent navigation and Stop for abortable runs.