Files
magpie/docs
yetone 4718943432 gateway: a small reply limit sent to Tencent's DeepSeek has room to think above it (WaiooT on X)
WaiooT (Tencent Cloud Token Plan, deepseek-v4.1-flash, an agent named
nowledge-mem): requests often ended "an empty reply (the model answered
nothing; try again) -- cut at its length, the whole output spent on
reasoning". Output 4,096, reasoning tokens 4,096, finish length. The
request named max_tokens 4096 (the memory tool's own setting; magpie adds
no limit to it) and no reasoning. Tencent's DeepSeek runs thinking by
default (docs 1823/132248: thinking "enabled", reasoning_effort "high",
"max_tokens >= 2048 advised in thinking mode") and counts it in
max_tokens, so the thinking spent the whole limit before an answer.

A Chat or Responses request to a tencentmaas.com provider's DeepSeek model
that names a reply limit of 16384 or less, names no reasoning of its own
(reasoning_effort, thinking, enable_thinking, reasoning...) and has no Max
output set by the user is sent that limit plus a high effort's room
(replyRoom, as side calls are), within the model's own limit where known
(withThinkingRoom, maxoutput.go). Scoped to that host and DeepSeek models.

The failure itself, a cut void, was already failed at once and asked
nowhere (#2972): its text now names the limit the request set and what to
do ("raise max_tokens in the agent, or ask for less reasoning"), still
holding cutVoidWords, so the group and patience matching is unchanged.

Run (mica): TestTencentDeepSeekCapGetsThinkingRoom (4096 gets room;
max_completion_tokens too; effort asked, thinking off, a large limit, no
limit, and another vendor's DeepSeek go as they came), TestChatLength*
(the error names the limit), TestShortDefault*, and gateway tests matching
Void|Length|Empty|Cut|Tencent|Output|Thinking|Reasoning; gofmt; go vet
darwin, linux nogui, windows of internal/gateway.
Broken by hand: withThinkingRoom's call removed, the new test red
("4096 and no reasoning: max_tokens 4096, want 28096").
Not tried: a real Tencent Token Plan key (none here), so that the 4096
came from the agent and not a Tencent default is read from the docs and the
reporter's numbers, not seen on the wire; an Anthropic-protocol client in
front of Tencent's DeepSeek is not covered; full suite after the tag.
2026-11-12 17:37:04 +08:00
..