You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: A t3_thread_send message reaches the receiving model as an unlabeled user message, so it cannot tell an agent's text from the human's #37617
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Open a Claude thread (thread A) and have it start a child or launch another thread (thread B).
In thread B, have the agent call t3_thread_send with thread A's ID and some text, for example a final report.
Look at what thread A's model receives for that turn.
For the second case: type a message in thread A's composer at about the same moment the agent's message arrives, so both are delivered in one turn.
Expected behavior
The model in thread A can tell who wrote each message. A message delivered by t3_thread_send arrives with a short label the sending agent cannot write, edit or leave out, naming the sender (thread title and ID, or the linked environment). Text the human typed arrives without it. When an agent's message and the human's message land in the same turn, they stay separate blocks, each attributed.
Task completion notices already do this: they arrive as Delegated task <id> (<title>) [completed]: followed by the text. PR #27871 did the same for decline feedback ("The user declined this tool call and said: ...").
Actual behavior
The message from t3_thread_send reaches the receiving model as an ordinary user message containing exactly the sender's text. Nothing marks it as agent-written. The web and mobile timelines show the sender, so the human can tell, but the model cannot.
In practice the receiving agent has to guess the author from the wording. Two things went wrong for me in one long orchestration session:
A child agent's report and the human's own two-line reply arrived joined in one turn with no boundary. The agent had to infer where the report stopped from the content.
The human asked, "Are not my messages clearly labeled as coming from me?" They are not, and neither are the agents' messages.
This matters most for approvals. An orchestrator that waits for the human's "yes" before an install, an upload or a publish can receive that "yes" from any agent able to send to its thread, and has no reliable way to notice. A prompt convention ("start your report with From the X child") helps only while every sender follows it, and does nothing against a sender that imitates the human.
From reading main at 760f9cb: OrchestratorMcpService.sendToThread passes text: input.message unchanged with createdBy: "agent", creationSource: "mcp" and senderThreadId (or linkedSender). ProviderTurnStartService forwards createdBy and senderThreadId on the turn message, and ProviderAdapterV2TurnMessage carries them. So the information reaches the adapter boundary. Code search finds no use of senderThreadId in the Claude or Codex adapters, which matches what the model sees.
Suggested fix: where an adapter turns a turn message into provider input, prefix messages that have createdBy: "agent" and a sender with one server-written line, for example Message from agent thread "<title>" (<threadId>), not from the user:, and keep each message in a merged turn as its own block. Scheduled-task prompts (scheduledTaskId) could get the same treatment. Happy to open a PR if this direction is acceptable.
Related: #20257 (a per-thread allow-list of senders, closed as a feature request). This report is narrower: it does not restrict who may send, it only asks that the receiving model be told who did.
Activity
juliusmarminge commentedon Nov 16, 2026
This is the same problem as #24711, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.