Skip to content

fix(server,web,mobile): messages from a linked environment name the thread that sent them - #34719

Closed
EtanHey wants to merge 1 commit into
pingdotgg:mainfrom
EtanHey:fix/linked-env-sender
Closed

EtanHey wants to merge 1 commit into
pingdotgg:mainfrom
EtanHey:fix/linked-env-sender

Conversation

@EtanHey

@EtanHey EtanHey commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #34708

Problem

An agent's t3_thread_send forwarded to a linked environment arrives as the link's client session, so the receiving server records no sender. The folded row says "Agent" and has no "Open thread".

Change

  • Forwarded calls carry the calling thread in a T3-Sender-Thread header (environment, thread, title), next to T3-Mode-Limit. The receiving server reads it only from linked clients.
  • sendToThread stores it as the message's linkedSender. senderThreadId still names only a local thread, so wake timing and subagent matching are unchanged.
  • Web and mobile look the sender up in its own environment and fall back to the carried title. "Open thread" shows only when this client can reach that thread.

Scope and approval

One problem: the attribution folded rows already have (#23135) is lost across a link. Fixing it needs the contract, server, web and mobile changes together.

Verification

Each new test fails on main and passes here:

  • PeerMcpClient.test.ts: the header round-trips through a real peer /mcp, and long titles are cut to whole characters
  • OrchestratorMcpService.test.ts: a linked caller's send records linkedSender
  • runtimeLayer.test.ts: started and queued messages keep it
  • MessagesTimeline / QueuedRunsControl browser tests: the label, the fallback title, and "Open thread" in the right environment

Typecheck passes for contracts, server, web and mobile. Affected test files pass: server 502, web 113, mobile 51, contracts 12.

Before After
before after

The timeline row, rendered in the browser test runner with a linked sender.

Not checked: a live two-machine run, the steer-redispatch path in EffectWorker (no test reaches it), and a negative test for the non-linked header guard.

Review: GPT-6.1 Sol, 3 rounds; the third was a narrow check of one fix. It found 3 defects, all fixed: the steer redispatch dropped the sender, a single-environment client still saw "Agent", and an unbounded title header could hit HTTP 431. The last two have tests.

🤖 Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly

…hread that sent them

A t3_thread_send forwarded to a linked environment arrived as the link's
client session, so the receiving server recorded no sender and clients
labeled the folded row "Agent" with no way back to the sender.

Forwarded calls now carry the calling thread in a T3-Sender-Thread header,
read only from linked clients. sendToThread keeps it as the message's
linkedSender (environment, thread, and its title then). Web and mobile look
the sender up in that environment, fall back to the carried title when the
client cannot reach it, and offer Open thread only when it can. A steer
that misses the turn keeps the sender when it is sent again. senderThreadId
still names only a thread in this environment.

Fixes pingdotgg#34708

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

Copy link
Copy Markdown
Contributor

Closing: EtanHey already has 3 or more open PRs here, which is the limit for contributors who are not vouched.

Once one of them is merged or closed, open this again. See the open PR limit.

@github-actions github-actions Bot closed this Nov 12, 2026
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Messages sent from a linked environment show "Agent" instead of the sending thread

1 participant