Repository navigation
Description
Summary
In agent loops (tools plus prior tool results), meta/muse-ember via the Provider API frequently returns an assistant turn that is only a conversational preamble with zero tool calls and finish_reason: "stop". The harness treats that as a completed turn, so the run ends and the user has to type "continue" to move it forward.
The turn is not truncated and it is not an error. What is wrong is how much reasoning the model gets: on these turns reasoning_tokens is 0–50, and roughly 30% of requests come back with reasoning_tokens: 0 even though the request asks for reasoning_effort: "high". Without reasoning the model narrates its intent and stops instead of continuing the tool chain.
The same payload replayed against the same endpoint is sometimes fine and sometimes not, and system_fingerprint differs on every single response, which suggests per-request routing to a backend that does not run reasoning for this model.
The behaviour is identical on POST /provider/v1/chat/completions and on POST /provider/v1/responses, so it is not a harness protocol choice.
Expected Behavior
When the task is unfinished (the last message is a tool result and more work is required), a turn requested with reasoning_effort: "high" should either call the next tool or say it is done. It should not announce "I am now writing summary.md" and end the turn without calling write.
Requests asking for the same effort level should receive a comparable reasoning budget. reasoning_tokens: 0 on an effort: high request should not be a routine outcome.
Actual Behavior
Captured stall turns from the live stream (model output translated from Chinese):
| # | finish | reasoning_tokens | output_tokens | tool calls | text |
|---|---|---|---|---|---|
| 1 | stop |
0 | 15 | 0 | "summary.md has been created, running a final check." |
| 2 | stop |
0 | 11 | 0 | "Finished reading, now writing summary.md." |
| 3 | stop |
0 | 31 | 0 | "To make sure summary.md is complete, please confirm the counting scope: ..." |
In all three cases the file the model claims to be writing did not exist on disk. Any nudge ("continue") resumes it, which matches #1117.
x-trace-id for sample 1: 93e0cbe0967a6aef70874df60731dd3f. Other stalls from the same session: 316fc8226e238d08422393b4afb4c635, 6293f020f36192a5097bc68ca6d2a7ea.
system_fingerprint is different on every response (fp_2qdkkse0jr, fp_s7nwmgtkrv, fp_g11743cmm0, fp_5ljp9a0ybi, fp_1c04ylqsfv), and the per-request reasoning variance is extreme.
Steps to reproduce the issue
A. Stall in an agent loop (nondeterministic, roughly 25–50% of runs)
- Create a directory containing five small
*.txtfiles. - Prompt the agent, without telling it to use tools: count the
.txtfiles in this directory, read each one, writesummary.md, then verify it. - Repeat four times with
api: openai-completionsand four times withapi: openai-responses.
| protocol | summary.md missing |
stall turns |
|---|---|---|
openai-responses |
2 / 4 | 1 in every run |
openai-completions |
1 / 4 | 1 in every run |
B. Same payload replayed eight times (nondeterminism inside the provider)
One captured real mid-conversation payload (reasoning_effort: "high", 16 tools, max_completion_tokens: 32000, store: false, 12 messages):
reasoning_tokens: [0, 16, 20, 11, 9, 7, 8, 0] # 2/8 came back with zero reasoning
C. Control: the payload itself is valid
A captured first-turn payload (developer prompt, 16 tools, reasoning_effort: "high") replayed 15 times on each endpoint returned a tool call 15/15 on both endpoints. The request shape is correct and this is not a malformed-tools or protocol problem.
D. reasoning_effort works on short, non-agent requests
Same model, single-turn coding question, 8 samples per effort level:
reasoning_effort |
mean reasoning_tokens |
|---|---|
| omitted | 1547 |
low |
544 |
medium |
843 |
high |
1194 |
max |
1620 |
The parameter is honoured in general. The degradation is specific to agent-shaped payloads (system or developer prompt, tools, history, tool results), where measured means drop to 210–424 and captured real payloads drop to single digits.
Command Code Version
pi 1.5.2 with pi-commandcode-provider 0.8.4 (Provider API client, not the cmd CLI)
Operating System
Linux
Shell
bash
Additional context
Environment: endpoint https://api.commandcode.ai/provider/v1, model meta/muse-ember, thinking level high. GET /provider/v1/models reports context_length: 1048576 and supported_endpoints: ["/chat/completions", "/responses"].
Secondary issue found while measuring the above: max_completion_tokens is shared with reasoning, so reasoning can consume the entire budget. A hard prompt with max_completion_tokens: 2000 returns reasoning_tokens: 1998, message.content of 0 characters, and finish_reason: "length" in 3/3 runs. Reasoning and the visible answer draw from one budget.
Related issues:
- Agent stalls mid-turn: preamble line with no tool call follows (requires user nudge) #1117 — agent stalls mid-turn, preamble line with no tool call follows (same symptom, model not identified there)
- DeepSeek V4 Flash via Provider API drops reasoning on tool-call continuation turns (nondeterministic, independent of thinking param) #726 — DeepSeek V4 Flash via Provider API drops reasoning on tool-call continuation turns (same mechanism, different model)
- Agent turn narrates executed work with zero tool calls; the fabricated transcript then loops later turns (detection mod included) #1001 — agent turn narrates executed work with zero tool calls (downstream consequence of a stall being recorded as a completed turn)
- HTTP 400 missing messages[N].reasoning_content after context compaction (long sessions) #1121 — reasoning replay requirements in long sessions
Activity
vedantdubal-141 commentedon Nov 19, 2026
+1