Skip to content

fix(ui): make subagent sessions view-only - #139381

Merged
steipete merged 2 commits into
mainfrom
codex/team-subagent-view-only
Sep 5, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/team-subagent-view-only

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

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.send retains 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.ts governs 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.abort or sessions.abort; exact recovered embedded runs resolve their captured owner through sessions-abort.ts. Tasks uses tasks.cancel and 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

  • Regression proof: the new subagent composer cases fail on the original code because canSend is true.
  • Mock browser proof: the existing Reading receipts child opens in the main view, has no textarea after the change, and Open parent session returns to an editable Tax filing research conversation. Captures use synthetic fixture data, viewport 1100×720, device scale 2, light mode.
  • Gateway proof: 43 tests passed across sessions.abort-agent-scope.test.ts and sessions.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.
  • Autoreview: default Codex engine/model, P0–P2 scope; scoped-clean, no accepted/actionable findings.
  • Production LOC: +93 −93 against the task merge base; funded by removing the availability forwarding helper and one-use temporaries.
Before After
Subagent with the normal composer Subagent with parent navigation and no composer

Release-note: Make subagent sessions view-only in the Control UI, with clear parent navigation and Stop for abortable runs.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 5, 2026, 7:15 PM ET / 23:15 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 997c0fa1e25888fe1b2f3fde5f95abdb96f74088

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable patch with useful regression coverage and no supported blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored exemption applies. The captured body maps mock-browser evidence to the changed composer banner and parent navigation, with focused tests supplementing Stop and send guards; attachment retrieval failed, and no independent live execution is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored exemption applies. The captured body maps mock-browser evidence to the changed composer banner and parent navigation, with focused tests supplementing Stop and send guards; attachment retrieval failed, and no independent live execution is claimed.
Evidence reviewed 7 items Pinned introduced behavior: The merge-base-to-head diff adds the subagent replacement banner, blocks composer send dispatch, suppresses pending question forms, and reuses the existing abort button. Unrelated base-branch changes were excluded.
Still absent from current main: Current main handles catalog, restart-recovery, archived-session, and model-setup banners without the proposed subagent restriction.
Latest-release comparison: The supplied v2026.9.2 release revision likewise lacks the subagent composer banner; this is not an already-shipped implementation.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Resolve merge risk (P1) - Attachment retrieval failed, so the supplied before/after visual captures could not be independently inspected.
Agent review details

Security

None.

PR surface

Source 0, Tests +116, Docs +5. Total +121 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 7 93 93 0
Tests 3 133 17 +116
Docs 2 6 1 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 232 111 +121

Review metrics

Metric Value Why it matters
Production versus test growth Production net 0 lines; tests net +116 lines Removing the single-caller forwarding helper funds the production change while coverage targets observable composer behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep subagent transcripts inspectable with a clear route to the parent conversation, while preserving existing session-scoped Stop handling.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This is a bounded Control UI correction for interacting with parent-owned subagent sessions.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored exemption applies. The captured body maps mock-browser evidence to the changed composer banner and parent navigation, with focused tests supplementing Stop and send guards; attachment retrieval failed, and no independent live execution is claimed.

Evidence

What I checked:

  • Pinned introduced behavior: The merge-base-to-head diff adds the subagent replacement banner, blocks composer send dispatch, suppresses pending question forms, and reuses the existing abort button. Unrelated base-branch changes were excluded. (ui/src/pages/chat/chat-pane-session-creation.ts:44, 997c0fa1e258)
  • Still absent from current main: Current main handles catalog, restart-recovery, archived-session, and model-setup banners without the proposed subagent restriction. (ui/src/pages/chat/chat-pane-session-creation.ts:30, 3f946f93da4e)
  • Latest-release comparison: The supplied v2026.9.2 release revision likewise lacks the subagent composer banner; this is not an already-shipped implementation. (ui/src/pages/chat/chat-pane-session-creation.ts:30, 3928bad9badf)
  • Behavior-focused regression coverage: The added tests exercise the real pane's blocked send callback, parent navigation, retained-draft Stop behavior, unresolved subagent metadata, ordinary editable nested sessions, and model setup without disabled-reason text. These tests were inspected, not executed during this read-only review. (ui/src/pages/chat/chat-composer-subagent.test.ts:16, 997c0fa1e258)
  • Existing cancellation boundary preserved: The composer continues through its existing abort callback. The UI lifecycle owner chooses sessions.abort for recovered embedded runs and chat.abort for browser-owned runs; the patch does not introduce a new cancellation or authorization protocol. (ui/src/pages/chat/run-lifecycle.ts:255, 997c0fa1e258)
  • Captured discussion and proof scope: The supplied body snapshot, sourceRevision e8eb5dd3865bf533ca6c5618ce26ec145b9a9a035c28858210061339d0972a2a, explicitly limits this PR to Control UI behavior, describes synthetic mock-browser before/after captures and focused passing checks, and leaves Gateway enforcement separate. Both attachment retrieval attempts failed, so the images were not independently inspected. The previous completed review at this same head records no findings.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-05T20:53:06.217Z sha 8fef79f :: blocked before merge. :: none
  • reviewed 2026-09-05T20:58:47.915Z sha 8fef79f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T21:17:13.607Z sha d000bb8 :: blocked before merge. :: none
  • reviewed 2026-09-05T21:48:39.170Z sha d000bb8 :: blocked before merge. :: none
  • reviewed 2026-09-05T22:53:14.782Z sha 997c0fa :: needs maintainer review before merge. :: none

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper approve

@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete
steipete force-pushed the codex/team-subagent-view-only branch from d000bb8 to 997c0fa Compare September 5, 2026 22:48
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 67e8e2d into main Sep 5, 2026
225 of 228 checks passed
@steipete
steipete deleted the codex/team-subagent-view-only branch September 5, 2026 23:30
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 5, 2026
* 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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
* fix(ui): make subagent sessions view-only

* fix(ui): retain explicit composer send guards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant