Skip to content

Two mode: "immediate" messages taken in at one step reach the model as one string ("no" + "drop phase 7" = "nodrop phase 7") #5483

Backlog

Description

@radostingg-eng

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

  1. Start copilot --headless --stdio --log-level all --log-dir ./logs and create a session with permissions: { request: true }. Approve permission requests.
  2. session.send the 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."
  3. When tool.execution_start arrives, wait 3 s, then send two steers back to back:
    • session.send { prompt: "no", mode: "immediate" }
    • session.send { prompt: "drop phase 7", mode: "immediate" }
  4. 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

  1. radostingg-eng commented on Nov 17, 2026

    @radostingg-eng
    Author

    A better client workaround than waiting: while the first steer is still pending (no user.message for it yet), append the next one with session.queue.appendSteering (messageId from session.send, expectedPrompt, same agentMode). 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 second session.send still produces the glued text, so the separate-block case is still worth fixing in the CLI.

    Sent by Agency Coder on behalf of Radostin

  2. added
    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loading
    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation
    and removed on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loadingarea:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions