Skip to content

Agent chat: centralize agent-message bodies and recorded sends - #26376

Merged
teamleaderleo merged 37 commits into
feat-cmux-nextfrom
nx-agent-message-meaning-1027
Oct 28, 2026
Merged

teamleaderleo merged 37 commits into
feat-cmux-nextfrom
nx-agent-message-meaning-1027

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Bash sends whose message came from an earlier recorded file write expand to that message as Markdown, with Raw below it. Sent and received messages share the same Markdown renderer.

Leo: "we need to have these more centralized ... account for cases where formatting gets a bit fucked up by agent messages sent back and forth" and "we don't need to see all this shit with the whole ... sending messages back and forth".

The viewer never reads a host file. It accepts immutable bytes only from a preceding, successfully completed quoted heredoc captured in this turn. Mutation, overlap, failed/unended writers, remote path boundaries, unsafe redirects and ambiguous execution invalidate those bytes. Repeated read-only sends can use the same captured producer. Observational tools, including structurally parsed MCP read/list/search calls, retain it. A parsed mutating MCP name always invalidates the body, even when its generic ACP kind incorrectly says read, search or fetch.

Wrapper scripts are parsed structurally: a quoted mention of acpmux send is text, while executable sends share one bounded scan. Unresolved nested substitutions propagate ambiguity through wrapper returns. A WeakMap caches parses by immutable tool identity and command revision; unchanged turn replay adds no parsing.

Before / after

Public gallery agent-pane.sent-message-rows, recorded-file, 760×760:

Before After
Before dark After dark
Before light After light

Captures are base 37d1da2ad8683f and earlier rendering head 2280210c529b2d5fa180617b6c64663d19a9fda1; subsequent parser repairs have no new visual surface. No private user images are published.

Verification

Frozen source: 724e5d6f08ea8697882850005a285bf56db059ac, tree 4a93c24bbaed849677670a1a612e83289a04e37a.

Review (codex gpt-6-astra xhigh): SHIP at 724e5d6. Primary inspection confirms that parsed MCP mutations override misleading generic kinds, while genuine reads retain immutable recorded bodies. Earlier review receipts apply only to their recorded heads.

Exact-head fleet run 40667206376 is SUCCESS: the new misleading-MCP-kind regression fails against the old production file, then the final source passes 56 tests / 599 assertions, full web check, web lint, and the prepush gate against actual published history. The runner verifies the source tree and restores its captured HEAD before completion. Receipt: 3004ccac8b354c6fbd8e111f2edbe503 (32 CPUs).

The regression covers read, search and fetch kinds crossed with parsed and structured MCP metadata: write_file, read_and_write and delete_file discard stale content; read_file preserves it. The earlier wrapper red-to-green is recorded in run 40661256705.
The old head’s cmux-next checks fail in tests/test_ios_internal_notes.py and native namespace-type rules in WorkspaceHibernationActionStrings.swift and CloudWorkspaceSetupLocalization.swift; this PR touches none of those files. Release-notary and gallery-health failures are also being reconciled against base. The coordinator confirmed there is no broad web hold: this web-only PR lands once its own four react-apps-check shards pass and remaining reds are base reds. The Swift-only hold on #26809 does not apply to these files.

No native app build was run for this web parser repair.

Changelog

Changed: render captured agent sends as Markdown and preserve recorded bodies through observational tools and safe wrappers.

Agent session: agent session

Centralize Markdown rendering for sent agent messages and resolve only same-turn or same-turn-recorded heredoc bodies for acpmux sends. Keep raw shell plumbing secondary and bounded.

Leo: "we need to have these more centralized ... account for cases where formatting gets a bit fucked up by agent messages sent back and forth"

Co-authored-by: nx-chat <nx-chat@manaflow.ai>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 724e5d6: 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=pr26376 -f ref=nx-agent-message-meaning-1027 -f platform=macos -f backend_mode=local

Probably yours: agent-pane-dock-gutters.test.ts fails here but not on main's latest full suite. Seen on other PRs too (likely flaky): agent-pane-background-tasks.test.ts, agent-pane-chat-unavailable.test.ts, agent-pane-chat-unavailable.test.ts and 28 more. This PR merged before its CI finished: fix forward on main.

CI failed on 724e5d6f08 (run 40666473963 attempt 1): 4 code, 1 unknown.

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

Failures:

  • seen on other PRs agent-pane-background-tasks.test.ts the summary card lists the chat's background tasks: running ones first, the finished folded: failed (job)
  • seen on other PRs agent-pane-chat-unavailable.test.ts loading never shows the unavailable text: a slow attach, then a machine still connecting: failed (job)
  • seen on other PRs agent-pane-chat-unavailable.test.ts a chat whose machine goes offline names it, says when it was last seen, and Reconnect opens it: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts composer at 1x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts newtab at 1x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts composer at 2x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts newtab at 2x: focus is the resting hairline a step brighter, no ring: failed (job)
  • seen on other PRs agent-pane-hairline-focus.test.ts under Increase Contrast a focused edge keeps the resting edge, never a dimmer one: failed (job)
  • seen on other PRs agent-pane-dock-gutters.test.ts chromium > the gutter beside every part of the stack scrolls the transcript, and the part keeps the ...: failed (job)
  • new in this PR agent-pane-dock-gutters.test.ts chromium > a part that scrolls in a short pane scrolls under the wheel alone, and its scrollbar take...: failed (job)
  • ... 22 more in the job logs
Matched log lines
web / react-apps-base-check (3): (fail) the summary card lists the chat's background tasks: running ones first, the finished folded [973.24ms]
web / react-apps-base-check (2): (fail) chromium > the gutter beside every part of the stack scrolls the transcript, and the part keeps the pointer [3205.22ms]
web / react-apps-base-check (1): (fail) only page.css imports the page's sheets [19.84ms]
web / react-apps-base-check (4): (fail) no orange or system accent and no opaque glass on the gallery stages [758233.21ms]

Not re-run automatically: web / react-apps-base-check (3), web / react-apps-base-check (2), web / react-apps-base-check (1), web / react-apps-base-check (4), 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: web / Web status; NEW: green on the base cc0d757; do not merge until green; see lane-rules
red: web / react-apps-base-check (1); no finished base run on cc0d757 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (2); no finished base run on cc0d757 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (3); no finished base run on cc0d757 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (4); no finished base run on cc0d757 to compare; do not merge until green; see lane-rules
red: web / react-apps-check; no finished base run on cc0d757 to compare; do not merge until green; see lane-rules

Gallery before/after for 724e5d6: 16 states rendered, 11 images differ, 2091 more touched states not rendered. Images are in the run's artifact, not on this public PR.

gh run download 40666473435 -R manaflow-ai/cmux -n gallery-advisory-26376-724e5d6f08ea8697882850005a285bf56db059ac (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.agent-message-row/sent Apple System Colors Light changed 0.0103% own MessageCard.tsx
agent-pane.agent-message-row/sent Apple System Colors changed 0.0092% own MessageCard.tsx
agent-pane.agent-message-row/lanes Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/lanes Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/sent-subagents Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/sent-subagents Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/sent-hover Apple System Colors changed 0.0096% own MessageCard.tsx
agent-pane.agent-message-row/sent-hover Apple System Colors Light changed 0.0038% own MessageCard.tsx
agent-pane.agent-message-row/sent-opened Apple System Colors Light changed 0.0105% own MessageCard.tsx
agent-pane.agent-message-row/sent-opened Apple System Colors changed 0.0068% own MessageCard.tsx
agent-pane.agent-message-row/sent-opened-long Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/sent-opened-long Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/outcomes Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/outcomes Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/both-directions Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.agent-message-row/both-directions Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.message-preview/baseline-fade Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.message-preview/baseline-fade Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.message-preview/code-first Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.message-preview/code-first Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.message-preview/one-line Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.message-preview/one-line Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.message-preview/cards-no-fade Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.message-preview/cards-no-fade Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.message-preview/full-cards-no-fade Apple System Colors Light unchanged 0% own MessageCard.tsx
agent-pane.message-preview/full-cards-no-fade Apple System Colors unchanged 0% own MessageCard.tsx
agent-pane.sending-line/shell Apple System Colors Light changed 0.188% own acpmuxSends.ts
agent-pane.sending-line/shell Apple System Colors unchanged 0% own acpmuxSends.ts
agent-pane.sending-line/reach Apple System Colors changed 0.208% own acpmuxSends.ts
agent-pane.sending-line/reach Apple System Colors Light changed 0.0872% own acpmuxSends.ts
agent-pane.sending-line/subsession Apple System Colors Light changed 0.161% own acpmuxSends.ts
agent-pane.sending-line/subsession Apple System Colors changed 0.148% own acpmuxSends.ts

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

Show a prior recorded Bash write followed by acpmux send < file in the sent-message gallery, with the compact row and expanded Markdown body.\n\nLeo: "we don't need to see all this shit with the whole ... sending messages back and forth"\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 27, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-929x84 created for this PR by the cmux coordinator.

Cache recorded message producer parsing by tool id and command revision with a bounded LRU. Unknown writes still invalidate the path before a later send.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
@blacksmith-sh

blacksmith-sh Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Found 118 test failures on Blacksmith runners:

Failures

Test View Logs
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build/
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build
View Logs
nightly.yml must derive the embedded key and sign every appcast through the helper/
nightly.yml must derive the embedded key and sign every appcast through the helper
View Logs
src/pages/settings/layout.test.ts/layout.test View Logs
src/pages/settings/layout.test.ts/layout.test View Logs
test/agent-pane-background-tasks.test.ts/agent-pane-background-tasks.test View Logs
test/agent-pane-background-tasks.test.ts/agent-pane-background-tasks.test View Logs
test/agent-pane-chat-unavailable.test.ts/agent-pane-chat-unavailable.test View Logs
test/agent-pane-chat-unavailable.test.ts/agent-pane-chat-unavailable.test View Logs
test/agent-pane-dock-gutters.test.ts/agent-pane-dock-gutters.test View Logs
test/agent-pane-dock-gutters.test.ts/agent-pane-dock-gutters.test View Logs

...and 108 more test failures. View all on Blacksmith: run 40666473963, run 40666473576

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

The parser cache regression now asserts an unknown same-path overwrite removes the prior body before a later send.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
Only a completed simple cat truncating stdout can publish a recorded body. Control flow, non-stdout redirects, appends, dynamic paths and path mutators clear the bounded producer cache.\n\nLeo: "formatting gets a bit fucked up by agent messages sent back and forth"\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
@cursor

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

Relative directory changes invalidate the transcript producer cache, so a later file send cannot reuse bytes from an unknown working directory.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
Apply recorded producer events in shell order. Shadowed redirects, skipped branches, failed writers and unknown path mutations now clear cached body bytes before acpmux send renders them.\n\nLeo: "formatting gets a bit fucked up by agent messages sent back and forth"\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
Apply recorded producer events in shell order and clear on shadowing redirects or uncertain control flow. A failed or in-flight tool keeps its compact preview but cannot publish a cached producer across calls.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
Only one simple standalone cat truncating an absolute literal stdout path can publish a recorded body. Multiple redirects, fd duplication, control flow, shell wrappers, mutators and dynamic paths clear provenance. Cache parsed immutable tool snapshots in a WeakMap so long transcript replay stays constant for unchanged calls.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
Require quoted stdin on fd 0 and a single absolute stdout truncating redirect for recorded message bodies. Unknown commands, control flow, fd redirects, and ambiguous writers clear provenance; immutable tool snapshots use WeakMap parse caching.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
Send rows now clear recorded bodies when their own command writes, substitutes, groups, or uses alternate input redirects. Grouped and multi-command producers, fd redirects and later here-strings remain unresolved.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
Clear prior producer candidates on accepted writes, reject uncertain aliases and alternate stdin routing, and require writer completion before a later send resolves recorded bytes. Reject grouped and substitution-bearing heredocs.\n\nAgent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2\n

Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b4ecd9d94ff38860db2
@cursor

cursor Bot commented Oct 28, 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
teamleaderleo merged commit 7ce775e into feat-cmux-next Oct 28, 2026
158 of 168 checks passed
@teamleaderleo
teamleaderleo deleted the nx-agent-message-meaning-1027 branch October 28, 2026 10:14
@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40671012262 at 193f745 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 5b6ffb3. This pull request is one of 4 merged since: #26828, #26810, #26376, #26767.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40672367480 at d92bb78 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 5b6ffb3. This pull request is one of 5 merged since: #26828, #26810, #26376, #26767, #26808.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 724e5d6f Deployed Oct 28, 2026 by teamleaderleo via wait for same-key tree publisher #71155
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