Description
Describe the bug
When two session.send calls with mode: "immediate" arrive while a tool runs, the CLI takes both in at the next step and puts them into one user message, one text block each. It also trims each block. The model then reads the blocks as one string with no separator.
The user sent "no" and then "drop phase 7". The model read "nodrop phase 7".
The session events are correct: there are two user.message events ("no" and "drop phase 7", both delivery: "steering"). Only the model request merges them.
Affected version
GitHub Copilot CLI 1.0.113-0 (macOS arm64), copilot --headless --stdio, protocol 4. Model claude-haiku-4.5 (also seen with claude-opus-5.5).
Steps to reproduce
- Start
copilot --headless --stdio --log-level all --log-dir ./logsand create a session withpermissions: { request: true }. Approve permission requests. session.sendthe prompt: "Run exactly this bash command first: sleep 12. After it finishes, reply with ONLY a JSON array holding the exact raw text of each user message you received after this one, one item per message."- When
tool.execution_startarrives, wait 3 s, then send two steers back to back:session.send { prompt: "no", mode: "immediate" }session.send { prompt: "drop phase 7", mode: "immediate" }
- Wait for
session.idle.
Result
| Sends | Model answer |
|---|---|
no, drop phase 7 |
["nodrop phase 7"] |
no\n, drop phase 7\n |
["nodrop phase 7"] (the trailing newline is trimmed) |
second send only after the first one's user.message event |
["no", "drop phase 7"] |
The model request in the debug log:
{
"role": "user",
"content": [
{ "type": "text", "text": "no" },
{ "type": "text", "text": "drop phase 7" }
]
}The model's reasoning starts with: The user has sent a message "nodrop phase 7".
Expected behavior
Two steering messages reach the model as two messages, or at least with a separator between the blocks (for example a blank line, as the interactive UI uses when it joins queued drafts). Two short messages glued together can change their meaning.
Additional context
Workaround in our client: send the next steer only after the CLI reports the previous one as a user.message event. System notifications (such as a shell completion) that arrive at the same step are added to the same user message, so the same issue may apply to them.
Sent by Agency Coder on behalf of Radostin
Activity
radostingg-eng commentedon Nov 17, 2026
A better client workaround than waiting: while the first steer is still pending (no
user.messagefor it yet), append the next one withsession.queue.appendSteering(messageIdfromsession.send,expectedPrompt, sameagentMode). The CLI joins them with a blank line, and the model reads them apart. Verified on 1.0.112 and 1.0.113. A plain secondsession.sendstill produces the glued text, so the separate-block case is still worth fixing in the CLI.Sent by Agency Coder on behalf of Radostin