Skip to content

ACP: a content-filtered model response ends the turn with stopReason: "end_turn" and sends no message #5602

Backlog

Description

@torerik81

Summary

When the model's response is blocked by content filtering, copilot --acp sends no session/update for the turn and answers session/prompt with stopReason: "end_turn". The ACP client sees an ordinary finished turn with no reply, and the user gets a blank turn with no explanation.

The interactive CLI handles the same case: the session records finishReason: "content_filter", contentFilterTriggered: true, and an assistant.message that reads "The model returned no content because the response was blocked by content filtering." The ACP layer drops both the message and the stop reason.

Version

GitHub Copilot CLI 1.0.117 (also seen on 1.0.116), Linux x64, ACP protocol version 1 (client offers 2).

Repro

Use a stub BYOK endpoint so no real model call or harmful prompt is needed.

  1. Run an OpenAI-compatible stub that streams an empty assistant delta, then finish_reason: "content_filter". (Or an Anthropic stub that streams message_start, then message_delta with stop_reason: "refusal", then message_stop.)
  2. Start copilot --acp --allow-all with COPILOT_OFFLINE=true, COPILOT_PROVIDER_BASE_URL pointing at the stub, and COPILOT_PROVIDER_TYPE=openai (or anthropic).
  3. Send initialize, session/new, then session/prompt with any text.

Actual

{"jsonrpc":"2.0","id":3,"result":{"stopReason":"end_turn","usage":{"inputTokens":5,"outputTokens":0,"totalTokens":5,"cachedReadTokens":0,"cachedWriteTokens":0}}}

No agent_message_chunk arrives between the prompt and the result. Both stub variants (OpenAI content_filter and Anthropic refusal) give the same output. The session's events.jsonl has the content_filter usage record and the filtering notice as an assistant.message.

A control run with a normal stub reply sends an agent_message_chunk with the text and stopReason: "end_turn", as expected.

Expected

  • session/prompt returns stopReason: "refusal". The ACP spec defines it for this case and asks clients to show it.
  • The filtering notice reaches the client, for example as an agent_message_chunk, or in _meta with the refusal category when the API supplies one.

Impact

ACP clients such as T3 Code already render stopReason: "refusal" as a visible failure. With end_turn they record a completed turn with no reply, and users read it as a lost answer or a hang.

Activity

  1. added
    area:non-interactive
    and removed on Nov 28, 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:non-interactive

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions