Repository navigation
Description
Summary
When using gemini-4-neon in Copilot CLI, any assistant message in conversation history that contains both non-empty content and tool_calls arrives at the model with its content stripped. Only the tool_calls reach the model; text-only assistant turns (with no tool_calls) arrive intact.
Copilot CLI sends content on the wire in the /chat/completions request payload. The drop happens server-side in the /chat/completions to gemini-4-neon translation layer (CAPI or the upstream Gemini adapter), and occurs both for turns with reasoning_opaque/reasoning_text and for earlier turns without them.
This breaks ask_user flows (where instructions tell the model to show a draft or options in visible text before calling ask_user): the user sees the draft and approves it, then on the next turn gemini-4-neon sees only a bare ask_user call with no preceding text and loops asking again. It also strips every progress update emitted alongside tool calls.
Version
GitHub Copilot CLI 1.0.119, Linux x64, endpoint https://api.enterprise.githubcopilot.com/chat/completions, model gemini-4-neon.
Where the drop happens
- Copilot CLI sends
contentintact. Confirmed two ways on1.0.119:- Capturing the live HTTP body with a local stub via
COPILOT_PROVIDER_BASE_URL(OpenAI-compatible/chat/completions): Turn 2 contains"role": "assistant","content": "SENTINEL_DRAFT_TEXT_12345", and"tool_calls": [...]. --log-level debug([rust:model_wire] Wire request:) on liveapi.enterprise.githubcopilot.comrequests shows the fullcontentstring alongsidetool_calls.
- Capturing the live HTTP body with a local stub via
gemini-4-neonnever receives those tokens. Confirmed by both the model's response and the server-reportedprompt_tokensdelta on a minimal two-turn repro (below).
Repro
Run a two-turn non-interactive prompt that forces non-empty text plus a bash call in Turn 1, and asks the model on Turn 2 whether it sees its own Turn 1 text:
PROMPT="Follow these two steps exactly.
Step 1 (first turn): Write a visible text message containing 150 repetitions of the word 'zebra' followed by a freshly invented random 4-word phrase (do NOT pass the words to any tool), AND in the SAME turn call bash with command \`echo ping\`.
Step 2 (second turn, after bash returns \`ping\`): Inspect your own Step 1 assistant message in the conversation history. Tell me literally: (a) whether any visible text appears alongside the bash tool call in your Step 1 assistant turn (YES or NO), and (b) if YES, quote the invented 4-word phrase."
copilot -p "$PROMPT" \
--model gemini-4-neon \
--reasoning-effort low \
--available-tools bash \
--no-custom-instructions \
--disable-builtin-mcps \
--no-ask-user \
--allow-all \
--log-dir /tmp/neon-repro \
--log-level debugActual (gemini-4-neon)
- Turn 1 outputs 150×
zebra+velvet lantern copper riveralongsidebash("echo ping"). - Turn 2's
[rust:model_wire] Wire requestincludes"role": "assistant","content": "zebra zebra ... velvet lantern copper river", and"tool_calls": [...]. - Turn 2 responds:
(a) NO (b) N/A (no visible text appears alongside the `bash` tool call in my Step 1 assistant turn). - Token counts from CAPI's response telemetry confirm the ~165 tokens of
contentwere dropped before reaching the model:- Turn 1 (
Request-ID 4802e839-9af5-4dec-9107-b6afabca28a3):prompt_tokens: 4886,completion_tokens: 529(reasoning_tokens: 334, visible output195tokens). - Turn 2 (
Request-ID 94739896-4cb7-4164-810c-ee4270a34d56):prompt_tokens: 5284(+398=334reasoning +~30tool call +~34tool result; zero tokens for the 150×zebratext).
- Turn 1 (
Control (claude-haiku-5.5)
Running the exact same command with --model claude-haiku-5.5 --reasoning-effort low (Request-ID d8741150-7bb6-4b62-97a6-ec3df1859370 -> 3949cb24-ad50-411e-89bc-587d5a94dbae):
- Turn 1 outputs 150×
zebra+silver clouds drift slowlyalongsidebash("echo ping"). - Turn 2 responds:
(a) YES. My Step 1 turn included visible text alongside the bash call. (b) The invented 4-word phrase was: "silver clouds drift slowly"
Expected
When translating /chat/completions history for gemini-4-neon, assistant messages that include both content and tool_calls should preserve the text part alongside the function-call parts so the model sees what it already showed the user.
Activity