[AGE-3962] fix(runner): surface Claude extended-thinking in the playground#5380
Conversation
Recent Claude models default extended-thinking display to "omitted"
(signature-only, empty text), so claude-agent-acp emits no
agent_thought_chunk and the playground shows no reasoning for Sonnet/Opus
while Haiku works. Request visible ("summarized") adaptive thinking via
_meta.claudeCode.options for the Claude harness only, so reasoning
surfaces for every model without forcing a budget. Pi harness untouched.
Ports open PR #5372 onto the decomposed runner layout: the session-init
insertion now lives in sandbox_agent/environment.ts.
Claude-Session: https://claude.ai/code/session_01DnWRxU3dCJ11hgDidm26vW
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughAdds a Claude extended-thinking metadata helper, requests adaptive summarized reasoning for Claude sessions, merges it with existing system-prompt metadata, and adds unit coverage for the configuration. ChangesClaude thinking configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Railway Preview Environment
Updated at 2026-07-18T23:40:47.777Z |
Problem
In the agent playground, the Claude Code harness shows no thinking for some models. Sonnet and Opus show nothing; Haiku works — even though all three stream fine. Closes #5355 (AGE-3962).
Root cause
Recent Claude models default extended-thinking
displayto"omitted": the Anthropic API returns signature-only thinking blocks whose text is empty.@agentclientprotocol/claude-agent-acpemits anagent_thought_chunkonly when that text is non-empty, so on those models the runner never sees any reasoning and nothing renders — in streaming or batch. Models that return thinking text (e.g. Haiku) are unaffected. The runner set no thinking config, so recent models fell to theomitteddefault.This is emission-side (the reasoning never reaches us), not a rendering bug.
Fix
For the Claude harness, request visible (
"summarized") thinking display via_meta.claudeCode.options.thinking— the same_metachannel the system-prompt append already uses, whichclaude-agent-acpspreads over its env-derived thinking config (so it wins):type: "adaptive"leaves the think-or-not decision to the model (no forced budget)."summarized"still returns the thinking signature, so multi-turn thinking continuity is unaffected.plan.acpAgent === "claude"— Pi harness is untouched (it has its own reasoning path).The change is model-agnostic within the Claude harness: it fixes Sonnet/Opus (same
omitted-default cause) and leaves Haiku/default behavior unchanged (summarizedis their existing default, now explicit).Before / after
Supersedes #5372
This PR supersedes #5372 (same author's fix), ported onto the decomposed runner layout. The runner engine was split since #5372 was opened: the monolithic
sandbox_agent.tsis now a thin facade overengines/sandbox_agent/*. #5372's newclaude-thinking.tsmodule and its test are byte-identical here; its one session-init insertion (the import and theclaudeThinking/claudeMetamerge) now lands inengines/sandbox_agent/environment.ts, next to whereclaudeSystemPromptMetaand thesessionInitpayload are already assembled — the block that moved out of the monolith. No behavior change from #5372. #5372 can be closed in favor of this one.Testing
claudeThinkingMetahelper.pnpm run typecheckclean;pnpm testgreen — 1205 tests (was 1204, +1 for the new test).https://claude.ai/code/session_01DnWRxU3dCJ11hgDidm26vW