Skip to content

Transcript: background task ends weighed from the event; silent ones go onto their call - #33283

Merged
teamleaderleo merged 8 commits into
feat-cmux-nextfrom
leo/bg-event-weights
Nov 3, 2026
Merged

teamleaderleo merged 8 commits into
feat-cmux-nextfrom
leo/bg-event-weights

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Background task ends are weighed from the task's own event, not from the reply's text. One worth no response no longer gets a transcript row.

Leo, on the "Background task finished" rows with lone "·" replies under them: "i mean can these possibly be more graceful? im not really sure", then "there's like... background tasks worth responding to and not worth responding to", and on the punctuation rule from #32884: "well there are cases (rare) that you would want to see it".

What changes

acpmux (hub/background_cause.rs, new): one table, WEIGHTS, keyed by task kind and notification status. Kinds are subagent, subagent_step (a call a subagent made), monitor, shell and unknown. The kind comes from Claude Code's task_started line; the status comes from task_notification, plus interim when the notification says the agent "is waiting on its own background work" or that its result "may be interim". The background turn's started record now carries cause: {kind, status, weight, origin?, summary?}. When several notifications arrive before one turn, the heaviest one names the cause. Each kind has its own test, and a further test checks that every kind × status pair resolves (only failed is a failure).

kind completed interim stopped / killed failed
subagent result silent silent failure
subagent_step silent silent silent failure
monitor silent silent silent failure
shell result silent silent failure
unknown result silent result failure

Pane:

  • silent: the turn draws no row. The call that started the task updates in place, as before, with no new mark, and the agent's reply goes inside the call: it opens under the output, and Find still reaches it.
  • result: the call, or the subagent's done line, gets a small accent dot that stays until the person's next prompt. A reply with something to say still draws as a message.
  • failure: always keeps its line, named by the notification's own summary.

Logs written before acpmux recorded cause draw exactly as they did after #32884.

This reverts #32884's punctuation widening of isBareAgentText, back to #32726's lone ".". That covers the narrowing follow-up too: "·" now draws when it is a real reply, and is hidden only as part of a silent background turn.

Variants

Gallery agent-pane.background-reactions, compare view, background-reaction-look experiment:

Picked On the call: it removes the row entirely for what isn't worth a response, and still says "something new finished here" where the work started. That matches how Codex marks a finished agent on its own row and how Claude's task list updates in place, with nothing appended to the chat.

Cost

No new O(rows) work per token. The reply text is gathered once per background turn, when it ends, from that turn's own reply ids. Seeing results on a prompt walks only the fresh reactions. No timers, observers or animation loops are added.

Spec: leo-workspace design/chat-transcript.md (merged). Tests: acpmux hub::background_cause and hub::background_turn; webviews test/agent-pane-background-turns.test.ts (interim, result, failure, silent with no call, subagent report, record parsing), backgroundRuns.test.tsx, visibleMessage.test.ts.

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Background task ends are now weighed from the task's own event instead of the reply's text, so silent ones (a subagent's step, an interim stop, a monitor tick, a stop) draw no transcript row and go onto the call that started them.

  • acpmux records a cause on each background turn's started record, keyed by task kind and status, with the heaviest notification naming the turn.
  • A result marks its call with a small accent dot until the person's next prompt; a failure always keeps a line, named by the notification's summary; a reply with something to say still draws as a message.
  • Reverts Transcript: a run of background-task notifications folds into one line; a reply of only punctuation draws no row #32884's punctuation widening of isBareAgentText back to a lone ..
  • Adds a background-reaction-look experiment with the folded-run arm as the previous look; logs written before acpmux recorded cause draw exactly as before.

Written for commit 425401a. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits November 2, 2026 23:41
…go onto their call

acpmux weighs each background task end in one table keyed by kind and
status (hub/background_cause.rs) and puts it on the background_turn
started record as cause. The pane draws no row for a silent end, marks a
result new on its call until the next prompt, and always shows a failure.
Reverts the punctuation-only widening of isBareAgentText to a lone period.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 9aa7dbc: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr33283 -f ref=leo/bg-event-weights -f platform=macos -f backend_mode=local

Gallery before/after for 425401a: 16 states rendered, 3 images differ, 3215 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41619574840 -R manaflow-ai/cmux -n gallery-advisory-33283-425401a1b6aaf6724dbc2a69e6b9a51bb8b0d06e (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.access-offer/turn-no-credits Apple System Colors Light unchanged 0% own conversation.css
agent-pane.access-offer/turn-no-credits Apple System Colors unchanged 0% own conversation.css
agent-pane.access-offer/turn-low-credits Apple System Colors Light unchanged 0% own conversation.css
agent-pane.access-offer/turn-low-credits Apple System Colors unchanged 0% own conversation.css
agent-pane.access-offer/turn-no-offer Apple System Colors Light unchanged 0% own conversation.css
agent-pane.access-offer/turn-no-offer Apple System Colors unchanged 0% own conversation.css
agent-pane.activity-line-looks/none Apple System Colors Light unchanged 0% own conversation.css
agent-pane.activity-line-looks/none Apple System Colors unchanged 0% own conversation.css
agent-pane.activity-line-looks/spinner Apple System Colors changed 0.0291% own conversation.css
agent-pane.activity-line-looks/spinner Apple System Colors Light changed 0.0139% own conversation.css
agent-pane.activity-line-looks/kind Apple System Colors Light changed 0.0274% own conversation.css
agent-pane.activity-line-looks/kind Apple System Colors unchanged 0% own conversation.css
agent-pane.activity-line-looks/aligned Apple System Colors Light unchanged 0% own conversation.css
agent-pane.activity-line-looks/aligned Apple System Colors unchanged 0% own conversation.css
agent-pane.approval-edits/single Apple System Colors Light unchanged 0% own conversation.css
agent-pane.approval-edits/single Apple System Colors unchanged 0% own conversation.css
agent-pane.approval-edits/grouped Apple System Colors Light unchanged 0% own conversation.css
agent-pane.approval-edits/grouped Apple System Colors unchanged 0% own conversation.css
agent-pane.approval-edits/single-multiedit Apple System Colors Light unchanged 0% own conversation.css
agent-pane.approval-edits/single-multiedit Apple System Colors unchanged 0% own conversation.css
agent-pane.approval-edits/grouped-multiedit Apple System Colors Light unchanged 0% own conversation.css
agent-pane.approval-edits/grouped-multiedit Apple System Colors unchanged 0% own conversation.css
agent-pane.approval-edits/single-long Apple System Colors Light unchanged 0% own conversation.css
agent-pane.approval-edits/single-long Apple System Colors unchanged 0% own conversation.css
agent-pane.approval-edits/grouped-long Apple System Colors Light unchanged 0% own conversation.css
agent-pane.approval-edits/grouped-long Apple System Colors unchanged 0% own conversation.css
agent-pane.approved-tool-row/ask-mode-approved Apple System Colors Light unchanged 0% own CommandRow.tsx
agent-pane.approved-tool-row/ask-mode-approved Apple System Colors unchanged 0% own CommandRow.tsx
agent-pane.approved-tool-row/run-one-approved Apple System Colors Light unchanged 0% own CommandRow.tsx
agent-pane.approved-tool-row/run-one-approved Apple System Colors unchanged 0% own CommandRow.tsx
agent-pane.approved-tool-row/mcp-approved Apple System Colors Light unchanged 0% own CommandRow.tsx
agent-pane.approved-tool-row/mcp-approved Apple System Colors unchanged 0% own CommandRow.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

Shipped in:

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 3, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 72c7087

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

Follow-ups: 4. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at 72c7087
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] subagentFold.ts:394: Invalidate the done-line cache when reactions change. Its key excludes reactions, so an already rendered completion misses the new dot/reply, or retains its dot after the next prompt. Reproduced with a reused cache.

  2. [P2] [follow-up] direct.ts:5342: Preserve earlier replies when the same task notifies again. Settlement replaces the carried text, leaving only the latest reply inside the call while both background rows remain hidden.

  3. [P2] [follow-up] backgroundTurns.ts:83: Keep the failure line when quiet is false. The early folding check returns false before reaching the failure branch, dropping the notification’s summary despite the promised “always keeps its line” behavior.

Follow-ups:

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 72c7087: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

teamleaderleo and others added 2 commits November 2, 2026 23:55
… cache key, keep earlier replies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 08645a7

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

Follow-ups: 5. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at 08645a7
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] direct.ts:5352: Find the originating call across prompts. A new prompt clears toolRows; if the task’s first completion arrives afterward, neither lookup finds the loaded call. Its mark and embedded reply never attach.

  2. [P2] [follow-up] direct.ts:5358: Preserve reaction through mergeToolItem. A subsequent tool_call_update rebuilds the tool without this field, removing its mark and reply while the background turn remains attached and hidden. Reproduced with the extracted methods.

  3. [P2] [follow-up] background_cause.rs:102: Recognize Claude’s task_type: "local_monitor" (documented in background-processes.md). Without tool_name, it falls through to shell, so completed monitor ticks receive result weight instead of silent weight.

  4. [P2] [follow-up] background_cause.rs:123: Give failed precedence over interim detection. Currently a failed notification containing “may be interim,” or carrying interim: true, becomes silent and loses the promised failure visibility.

  5. [P2] [follow-up] BackgroundReactions.gallery.ts:134: Capture the gallery states at this head; no images were available to verify the rendered changes.

Follow-ups:

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 08645a7: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

teamleaderleo and others added 2 commits November 3, 2026 00:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at b9cdc18

Reviewer: codex gpt-6-astra high, fast tier.

Follow-ups: 4. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at b9cdc18
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] direct.ts:5317: History paging drops subsequent replies from the call’s reaction. Older events replay chronologically, but this guard treats any existing reaction as newer. Two notifications for one call on the same page retain only the first reply while marking both turns attached. Compare event order before skipping attachment.

  2. [P2] [follow-up] direct.ts:5352: A task’s first result cannot attach after an intervening user prompt clears toolRows. The fallback exists only after a previous reaction. Preserve or recover the original call’s location so long-running tasks receive their reply and result mark.

  3. [P2] [follow-up] backgroundTurns.ts:83: A failure with quiet: false loses its named failure line because this early return precedes the failure branch. Keep the notification’s failure line independently of whether the assistant’s reply draws expanded.

  4. [P2] [follow-up] BackgroundReactions.gallery.ts:143: No after images were available; verify the gallery variants in the build.

Focused source probes reproduced findings 1–3. TypeScript syntax checks passed; full tests were unavailable without Bun/Cargo.

Follow-ups:

  • Preserve successive reactions during history paging.
  • Resolve originating calls across prompts.
  • Keep failure lines for nonquiet replies.
  • Verify the rendered gallery variants.

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves b9cdc18: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 9aa7dbc

Reviewer: codex gpt-6-astra high, fast tier.

Follow-ups: 4. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at 9aa7dbc
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] webviews/src/agent-session/acpmux/conversation/backgroundTurns.ts:83: A failure with quiet: false returns before the failure branch, removing its notification summary line. Reproduced with the actual function. Keep failure-line visibility independent of folding so the summary and substantive reply both remain visible.

  2. [P2] [follow-up] webviews/src/agent-session/acpmux/direct.ts:5355: A task’s first completion after another user prompt cannot attach to its shell call: the prompt cleared toolRows, and no prior reaction exists for the fallback lookup. The call remains in the transcript but gets no result dot or attached reply. Preserve a lookup for background calls across prompts.

  3. [P2] [follow-up] webviews/src/agent-session/acpmux/subagents/SubagentDoneLine.tsx:162: The attached parent reply appears only in a hover tooltip. Clicking opens the child’s transcript, which does not render that reply. Render the reaction in the opened view so the promised reply access works without hovering or searching.

  4. [P2] [follow-up] webviews/src/agent-session/acpmux/conversation/BackgroundReactions.gallery.ts:143: No after images were supplied. Visually check the gallery variants in the build.

Five visibility tests passed. Integration tests could not start because dependencies are absent.

Follow-ups:

  • Keep failure summaries visible with non-quiet replies.
  • Attach first completions across intervening prompts.
  • Render subagent reactions in the opened view.
  • Verify the gallery variants visually.

cmux-bot[bot]
cmux-bot Bot previously approved these changes Nov 3, 2026

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 9aa7dbc: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 3, 2026 10:28 Inactive
@cmux-bot
cmux-bot Bot dismissed their stale review November 3, 2026 10:36

A newer verdict blocks 425401a (no independent SHIP at the head).

@teamleaderleo
teamleaderleo merged commit 0ea8dbd into feat-cmux-next Nov 3, 2026
236 of 253 checks passed
@teamleaderleo
teamleaderleo deleted the leo/bg-event-weights branch November 3, 2026 11:39
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, sweep, via the review router; full diff from merge base e8fc118 to this head): BLOCK at 425401a

[P2] [blocking] webviews/src/agent-session/acpmux/conversation/ToolRow.tsx:226 - Attaching a reply to a Monitor call with no command, output, or diffs makes the reply inaccessible: the background line disappears, but the call’s disclosure and body-render conditions ignore tool.reaction.text. Previously, users could expand the background line to read it. - Include reaction text in both disclosure eligibility and the body-render condition.

teamleaderleo added a commit that referenced this pull request Nov 3, 2026
…eir named line; done-line replies are findable (#33758)

* Transcript: background reactions keep through call updates and newer prompts; failures beat interim; local_monitor is a monitor

Fixes #33375 and #33376 (follow-ups from the review of #33283).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5

* Transcript: a failure with a long reply keeps its named line; a subagent done line's reply is text Find reads

Fixes #33319 and #33538.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

3 inactive deployments
ci-routing-agent — 425401a1 Deployed Nov 3, 2026 by github-actions[bot] via cmux-next macOS placement #65800
artifacts — 425401a1 Deployed Nov 3, 2026 by cmux-bot[bot] via publish tree-addressed cmux-tui #105488
sentry-dsyms — 425401a1 Deployed Nov 3, 2026 by cmux-bot[bot] via upload cmux-tui dSYMs to Sentry #105488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant