Skip to content

claude provider: properly handle "withThinking"#11

Merged
Pascal-Delange merged 5 commits into
mainfrom
pascal/fix-claude-thinking
Mar 23, 2026
Merged

claude provider: properly handle "withThinking"#11
Pascal-Delange merged 5 commits into
mainfrom
pascal/fix-claude-thinking

Conversation

@Pascal-Delange

@Pascal-Delange Pascal-Delange commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

See thread in checkmarble/marble-backend#1277.

The implementation was not properly handling thinking without a budget.

@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a52b0062-beb1-4c0e-b669-4f095673b406

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pascal/fix-claude-thinking

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@OrriMandarin OrriMandarin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

A minor remark, but it can be treated independently.

Comment thread llms/anthropic/anthropic.go Outdated
Comment on lines +251 to +252
} else if r.Thinking != nil && *r.Thinking {
params.Thinking = lo.ToPtr(DefaultThinkingBudgetTokens)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid defining a "default" budget by utilizing the ThinkingConfigAdaptiveParam option to control the thinking feature. (instead of ThinkingConfigParamOfEnabled).
The AdaptiveParam feature allows Claude to determine the budget allocation based on the complexity of the request. I believe this feature is a perfect match.

This can be implemented in another PR.

Comment thread llms/anthropic/anthropic.go Outdated
@Pascal-Delange Pascal-Delange merged commit 09e47d6 into main Mar 23, 2026
1 check passed
@Pascal-Delange Pascal-Delange deleted the pascal/fix-claude-thinking branch March 23, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants