ArvinCharl on X (tweet 2114658365963976779, v0.1.1560): pi on a
self-hosted DeepSeek through the Chat path keeps the thinking the server
returned in `reasoning` and sends it back there. withReasoningOnToolTurns
copied it into reasoning_content and left `reasoning` in, and the server,
which reads the two as one field, refused the request with "duplicate
field reasoning".
When magpie fills reasoning_content (asReasoningContent), the message's
`reasoning` is left out, so the thinking goes once. Sibling:
reasoningDetailsAsContent (Kimi, #1765) filled reasoning_content from
`reasoning` the same way and now leaves it out too. reasoning_details
stays on the DeepSeek path: it is a list of typed entries (an encrypted
one, a signature), not another name for the text, and an upstream that
refuses it already has it taken out (reasoningDetailsAsContent,
withoutMessageReasoning). A message with reasoning_content of its own is
left as the client sent it. Not changed: flattenContent (replies to the
client, typed thinking parts, no `reasoning` field added), buildChat
(writes reasoning_content alone), mistralThinking (drops all three).
TestChatToolTurnWithoutReasoningRelayed asserted the old duplicate on
its OpenRouter-field turn and now wants reasoning_content alone.
Run at 9df403f80 (rebased on origin/main 77f860105):
- gofmt -l: clean.
- go vet ./internal/gateway/ with GOOS darwin, linux, windows: ok.
- go test -count=1 -timeout 45m ./internal/gateway/...: ok (429s),
no FAIL in the log.
- Not run: the full go test ./... suite; the disk had 1.2 GB free after
the gateway run.
Broken by hand: with the delete of `reasoning` commented out,
TestSelfHostedDeepSeekGetsReasoningOnce (400 "duplicate field
`reasoning`" from a fake that refuses both fields, the reporter's
message shape), TestKimiReasoningDetailsWithReasoningGoOnce and
TestChatToolTurnWithoutReasoningRelayed go red; restored, green. The new
test also checks a body with no tool calls comes back byte for byte.
#1462/#1822/#494/#1765 tests pass.
Not tried: a real self-hosted DeepSeek server or a real pi session; the
fake reproduces the reported refusal.
Reported by ArvinCharl on X.