Files
magpie/internal
yetone 2bc25a2d6e claude: a reply's thinking is never told to a Claude Code run as words (#6623)
The subscription bridge tells a conversation to a Claude Code run as
Human:/Assistant: text (a run started anew, the messages since a reply,
the transcript a new interactive run resumes). renderCachedParts wrote
each thinking part's text into the assistant's turn, so earlier
reasoning reached the model verbatim in a user message. Anthropic
refused it as reasoning_extraction, and every run started anew after
the refusal told it again (#6623; solllin on X). Thinking and
redacted_thinking parts are now left out there. Words, tool calls and
tool results are told as before. renderCachedParts is the one place:
renderClaudePrompt (-p and interactive first message), renderClaudeTurn
(next message, typed turn) and replaySession all reach it; a grep of
every `case Thinking` in the tree finds only native structured
encodings besides it, and sessions' carry already drops thinking.

Run (mica, at 338eae3c2 plus this change):
- TestClaudeReplayLeavesThinkingOut: red on the old code (thinking text
  in the history), green with the fix. It covers renderClaudePrompt with
  and without client cache marks, renderClaudeTurn and replaySession's
  transcript, with thinking and redacted_thinking blocks, and checks the
  words, tool call and tool result are still there.
- go test ./internal/gateway ./internal/sessions -count=1 -timeout 45m: ok.
- go vet ./internal/gateway, GOOS=linux and GOOS=windows: ok. gofmt -l: clean.

After rebasing on 343920464 (routing only): go test ./internal/gateway
-run TestClaude: ok.

Not tried: a real Claude subscription conversation reproducing the
refusal before and after; no GUI change.
2026-11-15 19:23:19 +08:00
..
…
…
…
…
…
…
…
…
…
…