acpmux: a remote agent's report names its sender, never reads as the person's

Merged
TE
1mo ago
+288-22

Leo (relayed by claude-sr2, 2026-10-24): "these codexes, they're just not following the instructions. And, like what, do we not have the rendering situation going on for them yet? Like the proper attribution and whatever to make them show up, just like how the Opus ones do."

Cause

I checked claude-sr2's event log on cosmic-gray (~/.acpmux/sessions/01a15779…/events).

  • Every report that drew a chip came from a session on cosmic-gray and carried _meta.provenance: session_message from the proven caller token, or agent_message from cmux agent message.
  • Every report from a lane on another machine (acpmux-peer#… over the peer link, acpmux-outbox#… for --no-wait, and acpmux-cli#… for reach cosmic-gray 'acpmux send …') had no provenance and no sender, so the pane drew it as Leo's own words. Of the last 60 such reports, 0 named a sender.

Why:

  • A peer hop strips provenance (mark_forwarded), and the owning daemon never sees the caller proof.
  • The forwarder named the sender (fromAgent) only for a --supersede prompt.
  • fromAgent alone was never recorded on the user_message.
  • Over ssh, the session's env (its token) never arrives.

It isn't specific to Codex: Opus lanes on other machines lost their chip the same way.

Fix

  • Peer forward (server/peer_forward.rs): the forwarding daemon names the proven caller session (fromAgent) on every forwarded prompt, not only keyed ones. A prompt from the person carries no name.
  • Owning daemon (server/requests.rs, prompt_provenance::named_sender): a prompt with a named sender and no provenance records {kind: "agent_message", from: "fromAgent", fromName, to}. The pane already draws that as the agent's card (incomingMessage.ts), so no GUI change is needed. A session's note to itself stays unmarked.
  • CLI (cli/sender.rs): outside a session, acpmux send names its sender from ACPMUX_FROM. A companion leo-workspace PR makes reach export it from the caller's session name. With no name and no session, the send is the person's: a person at a terminal is still the person.

Tests (red on the tests-only commit, green with the fix)

  • peer_integration::a_prompt_an_agent_sends_through_a_peer_names_that_agent_on_the_owning_daemon: two daemons. An agent in a session on A sends to b/coordinator, and B records it as codex-lane's message; the person's prompt through A stays unmarked.
  • hub_integration::prompt_provenance::a_prompt_that_names_its_sender_records_it_as_that_agents_message: covers a peer origin and a local origin, and checks that a self-note and the person's prompt stay unmarked.
  • cli::sender unit tests, and incomingMessage.test.ts (a named sender becomes the card, no sender becomes the person's bubble).
  • Gallery: agent-pane.remote-sender, variants named (after) and unnamed (before).

Agent session: big-red

🤖 Generated with Claude Code


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