Skip to content

Agent pane: messages from other sessions draw as received lines - #21747

Closed
teamleaderleo wants to merge 20 commits into
feat-cmux-nextfrom
claude-polish/received-messages
Closed

teamleaderleo wants to merge 20 commits into
feat-cmux-nextfrom
claude-polish/received-messages

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A message from another session reached the agent pane as an ordinary prompt and drew as the person's own bubble. It showed the whole envelope the cmux-tui pump writes: "[cmux agent message] from …", the message id, the safety line and the reply hint, and then the words. The prompt carries _meta.provenance.kind: "agent_message" with the sender (acpmux prompt_provenance.rs, cx-55d27), but the pane never read it.

Now the message draws as Claude desktop does (refs transcript-received-messages-group.png, transcript-received-message-expanded.png and transcript-peer-session-message.png in cmux-design-references; "Messages and actions" in #21604):

  • One muted line, "Received message from ". The sender is underlined and opens that session's chat when it is a chat acpmux runs (from is acp:<id>). Any other sender is plain text.
  • The chevron, or a click on the line, opens the sender's own words under it in muted body type. The envelope is stripped at its --- line and its closing line, which repeats the message id so a body cannot fake it. Text in any other shape is kept whole.
  • A message waiting behind a busy turn stays in the composer queue, where it can be removed or sent now, as before. It draws as a received line once it lands.
  • Find searches the sender's words, not the envelope, and opens the line (and its group) to show a match. Copy copies the words. A received prompt offers no Retry or Edit, which would resend the envelope as the person's own.
  • Two or more received lines in a row fold into one "Received N messages" line, which opens to them.
  • This draws for everyone. A started task's result (offer_result) still draws as before, behind its toggle.

Out of scope, and listed in #21604:

  • Delivering a message at the agent's next step rather than after the turn. acpmux queues agent messages with steer: false.
  • The queued/submitted/done state from prompt_accepted and turn_started.

Testing

  • bun test test/received-messages.test.tsx. It drives the real AcpmuxDirectClient over a fake daemon, then shapes and renders the rows.
    • Red on 0542edc, the test commit alone: the module didn't exist.
    • Green on 0896598 and a1a20e6: 3 pass.
    • After an independent review: a new test commit went red with 4 fail and 1 pass, then green on cc686da. It covers five things:
      • The row kind that redraws on open.
      • The queue keeping waiting messages.
      • Find, copy and retry/Edit using the body.
      • The group listing its lines.
      • The review found a misplaced memo comparator, so a landed message never opened. This is now fixed. The test checks four things:
      • The parsed sender, link and body, with no envelope text in the closed or open line.
      • A queued message is not in the composer queue and draws one line before and after it lands.
      • Three lines fold, and the fold opens to them.
      • A lone line stays a line.
  • bun test on chat-find (4 files), transcript-copy, gallery-coverage, transcript-newest-last and transcript-worked-fold, with the test above: 37 pass, 1 browser test skipped.
  • bun run typecheck passes.
  • Not run: the browser tests (agent-pane-suggested-tasks). Host load was 160 to 350 today and the dev server kept timing out. The offer_result path is unchanged.
  • No app build. The change is webview only, and the screenshots come from the new gallery entry agent-pane.received-messages in headless Chromium.
  • Localization: two new strings, received.group (plural, {n}) and received.show, in all 21 locales, marked needs_review outside English. The line reuses offer.received. gen-strings.mjs agentPane reports nothing missing.

Changelog

Changed: A message from another session shows as "Received message from" its sender, which opens to the message, instead of as your own prompt

Proof

Gallery agent-pane.received-messages, dark, normal width.

One message Opened
Three in a row Folded line opened

Before, each of these was a right-aligned user bubble holding the full envelope text.

Checklist

  • Failing test committed before the fix
  • Gallery coverage for the new components
  • Strings in every locale
  • Browser lane run (blocked by host load, see Testing)

🤖 Generated with Claude Code

teamleaderleo and others added 3 commits October 18, 2026 08:55
A prompt with agent_message provenance draws as a plain bubble of the
raw envelope today. The pane should show "Received message from" the
sender, open to the sender's words, draw a queued message's line once,
and fold lines in a row into "Received N messages".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A prompt that carries agent_message provenance (cx-55d27) drew as the
person's bubble of the raw envelope. It now draws as "Received message
from <sender>", the sender a link to its chat, and its chevron opens the
sender's own words in muted body type. A message waiting behind a busy
turn draws its line at once instead of a queued prompt, and a withdrawn
one's line goes. Two or more lines in a row fold into "Received N
messages". This draws for everyone, with no Debug toggle.

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

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: be5a8cdb-333f-4db1-b56c-ace4685d747a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 8137a78: 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=pr21747 -f ref=claude-polish/received-messages -f platform=macos -f backend_mode=local

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards.

CI failed on 8137a78aea (run 39373744465 attempt 1): 4 code, 1 unknown.

Job Verdict Why
web / react-apps-check (3) code a web test failed
web / react-apps-check (4) code a web test failed
web / react-apps-check (1) code a web test failed
web / react-apps-check (2) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs markdown-table-keys.test.ts markdown table keys > Cmd-A selects the cell's text, then the whole table, then lets the document ta...: failed (job)
  • seen on other PRs new-tab-warm-first-frame.test.ts chromium: Cmd-T paints its final chats and project on its first frame: failed (job)
  • seen on other PRs new-tab-warm-first-frame.test.ts webkit: Cmd-T paints its final chats and project on its first frame: failed (job)
  • seen on other PRs new-tab-warm-first-frame.test.ts chromium: the + button paints its final chats and project on its first frame: failed (job)
  • seen on other PRs new-tab-warm-first-frame.test.ts webkit: the + button paints its final chats and project on its first frame: failed (job)
  • seen on other PRs new-tab-warm-first-frame.test.ts chromium: a new workspace paints its final chats and project on its first frame: failed (job)
  • seen on other PRs new-tab-warm-first-frame.test.ts webkit: a new workspace paints its final chats and project on its first frame: failed (job)
  • seen on other PRs new-tab-warm-first-frame.test.ts chromium: a split paints its final chats and project on its first frame: failed (job)
  • seen on other PRs composer-location-strip.test.ts the New Tab composer at 420 px: the strip heads the card, one controls row inside: failed (job)
  • seen on other PRs composer-location-strip.test.ts the New Tab composer at 720 px: the strip heads the card, one controls row inside: failed (job)
  • ... 17 more in the job logs
Matched log lines
web / react-apps-check (3): (fail) markdown table keys > Cmd-A selects the cell's text, then the whole table, then lets the document take it [29.11ms]
web / react-apps-check (4): (fail) the New Tab composer at 420 px: the strip heads the card, one controls row inside [1577.23ms]
web / react-apps-check (1): (fail) every page row has exactly one home [1.14ms]
web / react-apps-check (2): (fail) New Tab strip, default, 760 px [1730.06ms]

Not re-run automatically: web / react-apps-check (3), web / react-apps-check (4), web / react-apps-check (1), web / react-apps-check (2), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 16f36fe to compare; do not merge until green; see lane-rules
red: web / Web status; no finished base run on 16f36fe to compare; do not merge until green; see lane-rules
red: web / react-apps-check; no finished base run on 16f36fe to compare; do not merge until green; see lane-rules
red: web / react-apps-check (1); no finished base run on 16f36fe to compare; do not merge until green; see lane-rules
red: web / react-apps-check (2); no finished base run on 16f36fe to compare; do not merge until green; see lane-rules
red: web / react-apps-check (3); no finished base run on 16f36fe to compare; do not merge until green; see lane-rules
red: web / react-apps-check (4); no finished base run on 16f36fe to compare; do not merge until green; see lane-rules

CI fast guards failed on 8137a78aea (https://github.com/manaflow-ai/cmux/actions/runs/39373744465). It does not block the merge; a red guard merged into main breaks it for every open PR.
The log named no failed step; see the run.

Agents: python3 scripts/ci/guard_attribution.py fix applies the mechanical fixes locally.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

CI fast guards failed on 86e1f3a74e (https://github.com/manaflow-ai/cmux/actions/runs/39192026193). It does not block the merge; a red guard merged into main breaks it for every open PR.
The log named no failed step; see the run.

Agents: python3 scripts/ci/guard_attribution.py fix applies the mechanical fixes locally. This comment is updated in place on each push.

@blacksmith-sh

This comment has been minimized.

teamleaderleo and others added 4 commits October 18, 2026 14:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A landed message's row must redraw when opened, and a waiting message
must stay in the composer queue. Find, copy, retry and Edit must use the
sender's words, never the envelope or the person's prompt. A group lists
its lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review: a landed message now draws through its own row kind, whose
memo redraws when the line opens (the comparator had landed on the
render card). A message waiting behind a turn stays in the composer
queue, where it can be removed or sent now; drawing it in the thread
duplicated on a lag resync and folded into Worked for. Find searches the
sender's words and opens the line and its group; copy copies the words;
a received prompt offers no Retry or Edit, which would resend the
envelope as the person's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo and others added 2 commits October 18, 2026 19:46
…lish/received-messages

# Conflicts:
#	webviews/src/agent-session/acpmux/direct.ts
Base now takes the queue order from the session detail on attach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo and others added 2 commits October 19, 2026 00:10
…sh/received-messages

# Conflicts:
#	webviews/src/agent-session/acpmux/Localizable.xcstrings
#	webviews/src/agent-session/acpmux/generated/strings.json
… two keys

The merge had kept the branch's older key order and an old placeholder string.

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

cursor Bot commented Oct 19, 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.

- vp fmt webviews/src/agent-session/acpmux/replyHref.ts
- vp fmt webviews/src/pages/markdown/README.md
- vp fmt webviews/src/pages/markdown/links.ts
- vp fmt webviews/test/markdown-cmux-app-links.test.ts

Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/39214563304
@blacksmith-sh

blacksmith-sh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Found 28 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp29kp7dgj/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmp469p7mz9/summary-fail.json (live):/summary-fail.json (live): View Logs
src/pages/settings/categories.test.ts/categories.test View Logs
src/pages/settings/categories.test.ts/categories.test View Logs
test/agent-pane-history-paging.test.ts/agent-pane-history-paging.test View Logs
test/agent-pane-history-paging.test.ts/agent-pane-history-paging.test View Logs
test/agent-pane-no-capsules.test.ts/agent-pane-no-capsules.test View Logs
test/agent-pane-no-capsules.test.ts/agent-pane-no-capsules.test View Logs
test/chat-find.test.ts/chat-find.test View Logs
test/chat-find.test.ts/chat-find.test View Logs

...and 18 more test failures. View all on Blacksmith: run 39373744465, run 39373744392

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

@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with three non-blocking issues from the previous reviews still open.

Findings

  1. P2 Find selects the heading ▶
  2. P2 Copied messages go missing ▶
  3. P2 Right-click still uses the envelope ▶

Summary

Messages from other sessions now draw as expandable received lines instead of user bubbles.

  • Messages from other sessions appear as received lines with their own words.
  • Find and copy use message words instead of the envelope.

Reviews (7) · Last reviewed commit: "Merge branch 'feat-cmux-next' into claud..." · Reviewed by Greptile

return (
<div className="cv-received" data-open={open || undefined}>
{/* The line toggles too; the sender link and the chevron are its keyboard stops. */}
<div className="cv-received__line" onClick={onToggle}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Find selects the heading

When the sender's name contains the search query, Find can select that name instead of the matching body text. rowText counts matches only in message.body, but paintFindHighlights also counts the heading. Searching “build” in a message from “Build agent” therefore selects the heading first and shifts later matches. Add data-find-skip to the heading so both paths count the same text.

Suggested change
<div className="cv-received__line" onClick={onToggle}>
<div className="cv-received__line" data-find-skip onClick={onToggle}>

Comment on lines +69 to +72
count: run.length,
lines: run.map((row) => row.id),
});
if (open) out.push(...run);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Copied messages go missing

Copying a row selection across a closed received group silently skips every message in that group. groupReceived replaces the messages with a row containing only their IDs. copyRows reads this grouped list, and transcriptCopyText returns nothing for the group. Opening the group changes the copied result. Keep the grouped messages available to the copy path and include their bodies once.

teamleaderleo and others added 2 commits October 19, 2026 12:43
…sh/received-messages

# Conflicts:
#	webviews/src/agent-session/acpmux/model.ts
build-agent-pane-web.sh concatenates every sheet the pane imports; receivedMessages.css was missing, so the received lines would draw unstyled in the app (react-apps-check caught it).

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

cursor Bot commented Oct 19, 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.

Comment on lines 1822 to +1824
text: String(msg.text ?? ""),
...(received ? { received } : {}),
...(message ? { message } : {}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Right-click still uses the envelope

Right-clicking a received message still offers Copy Message and Edit and Resend for the full envelope. The new message field changes how the row draws, but messageMenuTarget still reads row.text and reports it as an ordinary prompt. Copy includes the hidden envelope, and Edit and Resend puts it into the composer as the user's own prompt.

Use message.body for the menu's text and explicitly prevent received messages from offering Edit and Resend.

@cursor

cursor Bot commented Oct 20, 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.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

high-signal review link / link is red on 27 of 27 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

CI / web / react-apps-check (3) is red on 12 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

CI / web / react-apps-check (1) is red on 12 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

CI / web / react-apps-check (4) is red on 12 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

CI / web / react-apps-check (2) is red on 12 of 16 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Not landing this. It does the same job as open #22013, which draws other agents' messages as cards from their sender instead of received lines, and #22310 (Reply on the card) is stacked on #22013. Merging both would clash in direct.ts, model.ts and turns.ts. Choose one design, then close the other.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing: this duplicates #22013's card design for other agents' messages, and the team chose #22013 (#22310 builds on it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant