Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add provider-agnostic modelMaxThinkingTokens setting #1257

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

cte
Copy link
Collaborator

@cte cte commented Feb 28, 2025

Description

I think it's going to be unwieldy if we split this setting for each provider, so let's unify it and give it a better name. Note that the storage key is not changed, so no one's settings will get wiped out.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

Unified modelMaxThinkingTokens setting across providers, replacing vertexThinking and anthropicThinking.

  • Behavior:
    • Unified modelMaxThinkingTokens setting replaces vertexThinking and anthropicThinking across the codebase.
    • Ensures modelMaxThinkingTokens is capped at 80% of modelMaxTokens or a minimum of 1024 tokens.
  • Code Changes:
    • Updated VertexHandler, AnthropicHandler, and OpenRouterHandler to use modelMaxThinkingTokens.
    • Removed vertexThinking and anthropicThinking from ClineProvider.ts and globalState.ts.
    • Updated ThinkingBudget.tsx to use modelMaxThinkingTokens.
  • Tests:
    • Updated tests in vertex.test.ts, checkExistApiConfig.test.ts, ApiOptions.test.tsx, and ThinkingBudget.test.tsx to reflect the new setting.
    • Removed tests related to vertexThinking and anthropicThinking.

This description was created by Ellipsis for 8cbce2d. It will automatically update as commits are pushed.

@cte cte requested a review from mrubens as a code owner February 28, 2025 00:07
Copy link

changeset-bot bot commented Feb 28, 2025

⚠️ No Changeset found

Latest commit: 8cbce2d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 28, 2025
@cte
Copy link
Collaborator Author

cte commented Feb 28, 2025

CC @lupuletic

@@ -1723,6 +1720,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
this.updateGlobalState("requestyModelInfo", requestyModelInfo),
this.updateGlobalState("modelTemperature", modelTemperature),
this.updateGlobalState("modelMaxTokens", modelMaxTokens),
this.updateGlobalState("anthropicThinking", modelMaxThinkingTokens),
Copy link

Choose a reason for hiding this comment

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

Typographical Inconsistency: In updateApiConfiguration, the call to updateGlobalState uses the key "anthropicThinking" with the variable modelMaxThinkingTokens. Since the change intends to add a provider-agnostic 'modelMaxThinkingTokens' setting, consider renaming the key to "modelMaxThinkingTokens" for consistency.

Suggested change
this.updateGlobalState("anthropicThinking", modelMaxThinkingTokens),
this.updateGlobalState("modelMaxThinkingTokens", modelMaxThinkingTokens),

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ellipsis-dev - We don't want to change the way this setting is persisted or people will lose their settings.

Copy link

Choose a reason for hiding this comment

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

The current implementation correctly updates the global state key anthropicThinking with the variable modelMaxThinkingTokens. This approach ensures that user settings are preserved while implementing the new unified setting. Therefore, no changes are needed in response to the comment.


Responding to this comment by @cte. For more information about Ellipsis, check the documentation.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 28, 2025
@cte cte merged commit 8fae1ca into main Feb 28, 2025
16 checks passed
@cte cte deleted the cte/unify-thinking-budget-setting branch February 28, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants