Skip to content

fix: show a confirmed subagent stop once in chat - #208533

Merged
vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/subagent-stop-activity
Nov 30, 2026
Merged

vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/subagent-stop-activity

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

When the assistant stops a subagent and the same turn receives that run's terminal notice, Chat can show both “Stopped Release notes search” and “Release notes search stopped”. They describe the same stop twice.

User Impact

The confirmed stop appears once, on the action row whose details can still be expanded. It keeps the child's name before and after history catches up, including when other stops are nearby. Chat still shows outcomes for other subagents in the same notice.

Why This Change Was Made

Pair the stop call with its successful result, then match the parent run, child run, and child session against the actual displayed operations. Fold the repeated notice into the visible stop row, keeping its name. Leave notices that also mark resumed work in place.

Risk and coverage

Control UI display only. 135 focused tests passed, including live and persisted stops, grouped operations, Tool Search dispatches, and history replay. UI typecheck, lint, and formatting passed.

Local review of earlier revisions found name loss in live and grouped activity and duplicate Tool Search rows. The final focused tests cover those cases. The repeat local review of the final commit reached its time limit without a verdict.

Evidence

Same chat turn rendered in Chromium from synthetic transcript records on f881447c05c and 9e182cd3eda. The assistant stops one subagent, launches its replacement, and replies. The production chat renderer was exercised; this was not a live Gateway run.

Annotated comparison

Before: the same stop appears twice. After: one stop action remains above the replacement launch.

Clean comparison

The same turn before and after the stop notice is deduplicated.

@clawsweeper

clawsweeper Bot commented Nov 29, 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.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S labels Nov 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 29, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review November 29, 2026 19:23
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR folds a repeated subagent stop notice into its confirmed stop action while preserving the child’s name.

Example: The assistant stops “Release notes search” and receives that execution’s terminal notice in the same turn.

  • Before: Chat shows both “Stopped Release notes search” and “Release notes search stopped”.
  • After: Chat shows one expandable “Stopped Release notes search” row.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, focused presentation repair with inspected renderer evidence, but the assertion-safety and paired startup-size checks expose concrete merge blockers.
Proof confidence 🦐 gold shrimp (3/6) The contributor proof gate is exempt; inspected Chromium comparisons exercise the production renderer with synthetic stop and completion records, while the reported focused tests support direct, grouped, live, and Tool Search cases.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Chat repeats one confirmed subagent stop as two adjacent lifecycle rows.
Reason: The maintainer-authored direction removes concrete transcript noise while retaining expandable action details and unrelated child outcomes.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this PR open: it addresses a concrete display bug still present on main, but two patch-caused CI failures need repair.

Reviewed head: 9e182cd3eda95ffce989e1280a5bfe7ae3d283a4

Before merge

  • [P2] Remove the additional unchecked metadata assertion (P2) - The cast on this line adds a second uncommented production assertion to tool-cards.ts, whose assertion-safety allowance is one. The existing extraction cast still remains, so checks-fast-baseline-ratchets fails on this head with an assertion-safety annotation. Type the helper parameter as ProjectedToolMessage, whose symbol field is optional, so the metadata can be read without adding an assertion or expanding the baseline.
  • [P2] Fit the stop projection within the chat startup budget (P2) - This adds the stop-folding implementation to chat’s existing startup path. The exact-head paired performance check reports 1320.9 KiB of chat boot JavaScript against its 1320.4 KiB allowance. Although the base already exceeds the fixed ceiling, the check explicitly distinguishes that inherited excess from this head’s additional growth beyond build variance. Reduce the added startup payload while preserving the matching behavior and verify the paired comparison without raising the budget.

Findings

  • [P2] [P2] Remove the additional unchecked metadata assertion — ui/src/lib/chat/tool-cards.ts:47
  • [P2] [P2] Fit the stop projection within the chat startup budget — ui/src/pages/chat/chat-subagent-completions.ts:45-46
Agent review details

How this fits together

The Control UI projects recorded and live tool calls, results, and subagent completion receipts into grouped chat activity.

flowchart TD
  A[Recorded and live messages] --> B[Completion projection]
  B --> C[Tool invocation reconciliation]
  C --> D[Match confirmed stops]
  D --> E[Activity grouping]
  E --> F[Chat rows and details]
Loading

Technical review

Best possible solution:

Keep execution-specific deduplication in the existing chat projection while repairing the assertion and startup-size regressions.

Do we have a high-confidence way to reproduce the issue?

Main independently renders confirmed stop actions and killed completion receipts, and the inspected before screenshot shows both for the same child; no live reproduction was run during this review.

Is this the best way to solve the issue?

Matching parent run, child run, and child session after invocation reconciliation is appropriately scoped, and retaining continuation notices preserves resumed-turn placement.

Full review comments:

  • [P2] [P2] Remove the additional unchecked metadata assertion — ui/src/lib/chat/tool-cards.ts:47
    The cast on this line adds a second uncommented production assertion to tool-cards.ts, whose assertion-safety allowance is one. The existing extraction cast still remains, so checks-fast-baseline-ratchets fails on this head with an assertion-safety annotation. Type the helper parameter as ProjectedToolMessage, whose symbol field is optional, so the metadata can be read without adding an assertion or expanding the baseline.
    Confidence: 0.99
  • [P2] [P2] Fit the stop projection within the chat startup budget — ui/src/pages/chat/chat-subagent-completions.ts:45-46
    This adds the stop-folding implementation to chat’s existing startup path. The exact-head paired performance check reports 1320.9 KiB of chat boot JavaScript against its 1320.4 KiB allowance. Although the base already exceeds the fixed ceiling, the check explicitly distinguishes that inherited excess from this head’s additional growth beyond build variance. Reduce the added startup payload while preserving the matching behavior and verify the paired comparison without raising the budget.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ebb8d9827234.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:assertion-safety
  • pnpm test ui/src/pages/chat/components/chat-message.tools.test.tsx ui/src/pages/chat/chat-spawned-subagent.test.ts ui/src/pages/chat/chat-tool-activity-coalesce.test.ts --maxWorkers=1
  • pnpm tsgo:ui
  • pnpm ui:build
  • node --import ./scripts/tsx.mjs scripts/check-control-ui-performance.mts

What I checked:

  • Verified patch scope: The introduced diff adds stop-notice matching to the existing completion projection and invokes it after tool reconciliation; unrelated base-branch changes are outside this PR. (ui/src/pages/chat/chat-subagent-completions.ts:46, 9e182cd3eda9)
  • Current main still needs the fix: Fetched main retains the original completion projection without matching confirmed stop actions against terminal notices. (ui/src/pages/chat/chat-subagent-completions.ts:39, ebb8d9827234)
  • Inspected visual evidence: Both downloaded comparisons show the duplicate disappearing and the named stop remaining above the replacement launch; the body identifies synthetic transcript records rendered in Chromium, without a live Gateway. (9e182cd3eda9)
  • Diff-caused assertion-safety failure: The new helper adds an uncommented type assertion, taking tool-cards.ts from one to two against its allowance of one; the exact-head baseline check reports assertion-safety failure. (ui/src/lib/chat/tool-cards.ts:47, 9e182cd3eda9)
  • Diff-caused startup-size failure: The paired performance check reports chat boot JavaScript at 1320.9 KiB against a 1320.4 KiB limit; it explicitly accounts for the already-over-budget base and permits only 64 bytes of build variance. (scripts/check-control-ui-performance.mts:525, 9e182cd3eda9)
  • Browser failure remains unattributed: The browser annotation reports a timeout opening Details in the session-companion-clear scenario; no matching base failure was established, and detailed job logs redirect to a blocked productionresultssa10.blob.core.windows.net host, so this is neither an attributed patch defect nor a proven external failure. (ui/src/e2e/chat-details.test-support.ts:42, 9e182cd3eda9)

Likely related people:

  • Vyctor H. Brzezowski: Raw commit 18136c9 adds ui/src/pages/chat/chat-subagent-completions.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 18136c960eaf; files: ui/src/pages/chat/chat-subagent-completions.ts)
  • Ayaan Zaidi: Raw commit 3370acf adds ui/src/pages/chat/chat-spawned-subagent.ts:94 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3370acfc7477; files: ui/src/pages/chat/chat-spawned-subagent.ts)
  • Peter Steinberger: Raw commit 1d7e5b0 adds ui/src/pages/chat/chat-tool-activity-coalesce.ts:488 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1d7e5b0813d5; files: ui/src/pages/chat/chat-tool-activity-coalesce.ts)

PR surface

Source +128, Tests +125, Docs +1. Total +254 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 137 9 +128
Tests 1 126 1 +125
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 266 12 +254

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 29, 2026, 2:40 PM ET / 19:40 UTC.

@vyctorbrzezowski
vyctorbrzezowski merged commit bb48fa2 into main Nov 30, 2026
60 of 63 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/subagent-stop-activity branch November 30, 2026 06:25
vincentkoc added a commit that referenced this pull request Nov 30, 2026
* commit 'c5c1dc278a6f789d739d70afe192c4d1e37058f5':
  fix(ci): include provider rejection text in PR tooling (#208891)
  feat: let plugins bring their own sidebar icon (#208885)
  docs: clarify node pairing and credentials on PostgreSQL gateways (#208850)
  fix(ui): show a confirmed subagent stop once in chat (#208533)
  fix(ui): keep collapsed work close to the reply in long chats (#207843)
  fix(update): finish failed recovery startup records (#208794)
  chore(ci): inventory media worker lifecycles (#208888)
  fix: use the same clock icon for Automations (#208539)
  improve(ci): reduce compiler round trips in database checks (#208878)
  fix(ci): preserve complete adaptive test observations (#208874)
  test(gateway): isolate usage context database fixtures (#208304)
  fix: avoid false worker cleanup failures (#208861)
  fix: let Git upgrade acceptance fetch its missing baseline (#208746)
  fix: isolate scheduled Processes reads in the Control UI config-change test (#208205)
  fix: make plugin hash worker tests independent of runner memory (#208860)
  fix(update): preserve serving state during candidate plugin maintenance (#208776)
  test(ui): preserve exact session keys in older chat links (#208873)
  docs(cli): say what bounds a yielded agent turn's subagent wait without --timeout (#208858)
vincentkoc added a commit that referenced this pull request Nov 30, 2026
* fix: restore managed worktrees from bare primary repositories

Managed worktrees created from a linked checkout record its primary repository. Resolve that registration during inspection, removal, and snapshot restore while keeping new checkout creation strict.

* Merge verified upstream CI repairs into managed worktree recovery

* commit 'c5c1dc278a6f789d739d70afe192c4d1e37058f5': (64 commits)
  fix(ci): include provider rejection text in PR tooling (#208891)
  feat: let plugins bring their own sidebar icon (#208885)
  docs: clarify node pairing and credentials on PostgreSQL gateways (#208850)
  fix(ui): show a confirmed subagent stop once in chat (#208533)
  fix(ui): keep collapsed work close to the reply in long chats (#207843)
  fix(update): finish failed recovery startup records (#208794)
  chore(ci): inventory media worker lifecycles (#208888)
  fix: use the same clock icon for Automations (#208539)
  improve(ci): reduce compiler round trips in database checks (#208878)
  fix(ci): preserve complete adaptive test observations (#208874)
  test(gateway): isolate usage context database fixtures (#208304)
  fix: avoid false worker cleanup failures (#208861)
  fix: let Git upgrade acceptance fetch its missing baseline (#208746)
  fix: isolate scheduled Processes reads in the Control UI config-change test (#208205)
  fix: make plugin hash worker tests independent of runner memory (#208860)
  fix(update): preserve serving state during candidate plugin maintenance (#208776)
  test(ui): preserve exact session keys in older chat links (#208873)
  docs(cli): say what bounds a yielded agent turn's subagent wait without --timeout (#208858)
  test(ui): keep real exports in the channel settings distribution mock (#208855)
  test(normalization): preserve inline code in quoted previews (#208857)
  ...

Co-authored-by: Vincent Koc <[email protected]>
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 impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant