Repository navigation
Bug: reasoningEffort=max burns whole output budget on thinking, yields empty content, turn ends max-tokens forever #6936
martin-lee07
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Symptom
On DeepSeek reasoner models (
reasoningEffort: max), a single request can spend the entiremaxTokensoutput budget on internal reasoning tokens and end the turn with an empty assistant message (content: []) plus amax-tokensfinish. The user keeps pressing continue and never gets an answer.Observed in real durable session logs:
[]{kind: "max-tokens"}[]{kind: "max-tokens"}[]{kind: "max-tokens"}Key: after compaction input was only ~14k tokens, far below the 262k window β this is NOT context overflow. It is the reasoning budget exhausting the output token ceiling.
Proposed fix (implemented on a fork branch)
packages/core/agent-loop/src/agent.ts: when a step endsmax-tokenswith no produced content (no text, no tool-call) and the request carried areasoningEffort, auto-downshift the effort one rung (max -> high -> medium -> low -> off) and retry the step once. Truncation WITH produced content keeps existing behavior. Recovery is at most one rung per step (no infinite loops).Branch:
fix/empty-max-tokens-retryat https://github.com/martin-lee07/deepseek-harness/tree/fix/empty-max-tokens-retry (commit28ec0f3)Includes 4 regression tests (all pass: 421 agent-loop tests green, tsc + oxlint clean).
Since issues/PRs appear disabled on this repo, posting here as a discussion.
All reactions