[AGE-3962] fix(runner): surface Claude extended-thinking in the playground#5372
[AGE-3962] fix(runner): surface Claude extended-thinking in the playground#5372ardaerzin wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughClaude sandbox sessions now send adaptive, summarized extended-thinking metadata alongside existing system-prompt metadata. A helper and unit test define and verify the configuration, while ChangesClaude thinking display
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b49a5598-61e8-42ef-905a-0fa6c69dc52f
📒 Files selected for processing (3)
services/runner/src/engines/sandbox_agent.tsservices/runner/src/engines/sandbox_agent/claude-thinking.tsservices/runner/tests/unit/claude-thinking.test.ts
…round Recent Claude models (e.g. Sonnet) default extended-thinking `display` to "omitted" — the API returns signature-only thinking blocks whose text is empty. claude-agent-acp emits an `agent_thought_chunk` only when that text is non-empty, so the runner never sees the reasoning and the playground shows none, while models that return thinking text (e.g. Haiku) work. For the Claude harness, request `display: "summarized"` via `_meta.claudeCode.options.thinking` so the reasoning text is returned for every model. `type: "adaptive"` leaves the think-or-not decision to the model, and "summarized" still returns the signature, so multi-turn thinking continuity is unaffected.
68a7a89 to
12a5f36
Compare
|
deprecated |
Problem
In the agent playground, the Claude Code harness shows no thinking/reasoning for some models — Sonnet shows nothing, Haiku works — even though both 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
Testing
claudeThinkingMetahelper; full runner suite green (pnpm test,pnpm run typecheck).Notes
fold()in the SDK); that's tracked separately and not included here.