Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Nov 5, 2025

Related GitHub Issue

Closes: #9045

Roo Code Task Context (Optional)

N/A

Description

This PR addresses the incorrect max token configuration for the Anthropic Opus 4.1 model. The issue correctly identified that claude-opus-4-1-20250805 had its maxTokens set to 8192, while according to Anthropic's documentation and the configuration of the similar claude-opus-4-20250514 model, it should be 32,000.

Changes made:

  • Updated maxTokens from 8192 to 32_000 for claude-opus-4-1-20250805
  • Added inline comment matching the pattern used by other reasoning-capable models to indicate the override behavior when enableReasoningEffort is false

This change ensures both Opus 4 model variants have consistent configuration and enables the larger context window that users require.

Test Procedure

Testing performed:

  1. Ran npm test in the types package - all 43 tests pass successfully
  2. Ran npm run lint - no linting issues
  3. Ran npm run check-types - type checking passes

How to verify:

  1. Check out this branch
  2. Navigate to packages/types/src/providers/anthropic.ts line 52
  3. Verify that claude-opus-4-1-20250805 now has maxTokens: 32_000
  4. Run cd packages/types && npm test to ensure tests pass

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - Configuration change only

Documentation Updates

  • No documentation updates are required.

This is a configuration value correction that aligns with existing Anthropic documentation.

Additional Notes

This is a straightforward configuration fix that brings consistency between the two Opus 4 model variants. The change follows the existing code patterns and conventions used throughout the file.

Get in Touch

Available via GitHub for any questions about this PR


Important

Update maxTokens for claude-opus-4-1-20250805 in anthropic.ts from 8192 to 32_000 to align with documentation.

  • Behavior:
    • Updated maxTokens from 8192 to 32_000 for claude-opus-4-1-20250805 in anthropic.ts.
    • Added inline comment for maxTokens override behavior when enableReasoningEffort is false.
  • Testing:
    • Ran npm test in types package; all tests passed.
    • Ran npm run lint and npm run check-types; no issues found.

This description was created by Ellipsis for f714a0c. You can customize this summary. It will automatically update as commits are pushed.

Aligns claude-opus-4-1-20250805 max token limit with claude-opus-4-20250514,
both models now supporting 32K output tokens (overridable to 8K when
enableReasoningEffort is false).

Fixes #9045
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 5, 2025 05:16
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Nov 5, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Nov 5, 2025

See this task on Roo Code Cloud

Review complete. No issues found - the change correctly updates claude-opus-4-1-20250805 max tokens from 8192 to 32,000, aligning with the similar claude-opus-4-20250514 model and Anthropic's documentation.

Mention @roomote in a comment to trigger your PR Fixer agent and make changes to this pull request.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 5, 2025
@mrubens mrubens merged commit 6965e5c into main Nov 5, 2025
20 checks passed
@mrubens mrubens deleted the fix/opus-4-1-max-tokens branch November 5, 2025 05:24
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 5, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Nov 5, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Nov 6, 2025
* feat: add UsageStats schema and type (RooCodeInc#8441)

feat: add UsageStats schema and type to cloud.ts

Co-authored-by: Roo Code <[email protected]>

* Release: v1.80.0 (RooCodeInc#8442)

chore: bump version to v1.80.0

* feat: add new DeepSeek and GLM models with detailed descriptions to the Chutes provider (RooCodeInc#8467)

* Deprecate free grok 4 fast (RooCodeInc#8481)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* fix: improve save button activation in prompts settings (RooCodeInc#5780) (RooCodeInc#8267)

Co-authored-by: MuriloFP <[email protected]>
Co-authored-by: Roo Code <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>

* fix: properly reset cost limit tracking when user clicks "Reset and Continue" (RooCodeInc#6890)

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>

* chore(deps): update dependency vite to v6.3.6 [security] (RooCodeInc#7838)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency glob to v11.0.3 (RooCodeInc#7767)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: add changeset for v3.28.15 (RooCodeInc#8491)

* Changeset version bump (RooCodeInc#8492)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <[email protected]>

* Clamp GPT-5 max output tokens to 20% of context window (RooCodeInc#8495)

* fix: add ollama and lmstudio to MODELS_BY_PROVIDER (RooCodeInc#8511)

Co-authored-by: Roo Code <[email protected]>

* Release: v1.81.0 (RooCodeInc#8519)

* Add the parent task ID in telemetry (RooCodeInc#8532)

* Release: v1.82.0 (RooCodeInc#8535)

* feat: Experiment: Show a bit of stats in Cloud tab to help users discover there's more in Cloud (RooCodeInc#8415)

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <[email protected]>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: SannidhyaSah <[email protected]>
Co-authored-by: John Richmond <[email protected]>

* Revert "feat: Experiment: Show a bit of stats in Cloud tab to help users discover there's more in Cloud" (RooCodeInc#8559)

* Identify cloud tasks in the extension bridge (RooCodeInc#8539)

* Revert "Clamp GPT-5 max output tokens to 20% of context window" (RooCodeInc#8582)

* feat: Add Claude Sonnet 4.5 1M context window support for Claude Code… (RooCodeInc#8586)

feat: Add Claude Sonnet 4.5 1M context window support for Claude Code provider

* chore: add changeset for v3.28.16 (RooCodeInc#8592)

* Changeset version bump (RooCodeInc#8593)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <[email protected]>

* fix(i18n): Update zh-TW run command title (RooCodeInc#8631)

* feat(commands, webview): Add TDD built-in command; Refactor welcome tips and test guide definition

* refactor(project-wiki): separate command from subtask initialization

* feat(command): update built-in commands count and names in tests

* Add Claude Haiku 4.5 (RooCodeInc#8673)

* Release v3.28.17 (RooCodeInc#8674)

* Changeset version bump (RooCodeInc#8675)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <[email protected]>

* fix(editor): prevent file editing issues when git diff views are open (RooCodeInc#8676)

* fix(editor): prevent file editing issues when git diff views are open

Add scheme checks to ensure only file:// URIs are matched when finding editors,
avoiding issues with git diffs and other schemes. Includes error logging for
failed editor lookups.

* Remove the warnings

* fix(editor): enforce file:// scheme in editor lookups to prevent git diff issues

---------

Co-authored-by: daniel-lxs <[email protected]>

* web: Cloud page and updates to Pricing to explain Cloud Agent Credits (RooCodeInc#8605)

* Adds mention of Cloud agents to /pricing

* Credit pricing FAQ

* Skeleton of a /cloud page and more pricing page tweaks

* Lint

* Update apps/web-roo-code/src/app/cloud/page.tsx

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>

* Code review

* Updates copy to new credit system

* Moves Terms of Service to be backed by a markdown file, easier to read/edit/diff

* Updated ToS

* Twerm copy tweaks

* Cloud screenshot and style adjustments

* Style tweaks

* Styles

---------

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>

* feat: Add userAgent to Bedrock client for version tracking (RooCodeInc#8663)

Co-authored-by: Roo Code <[email protected]>

* feat: Cloud agents in extension (RooCodeInc#8470)

Co-authored-by: Matt Rubens <[email protected]>

* feat: Z AI: only two coding endpoints (RooCodeInc#8687) (RooCodeInc#8693)

* Remove request content from UI messages (RooCodeInc#8696)

* Left align the welcome title (RooCodeInc#8700)

* Update image generation model selection (RooCodeInc#8698)

* feat(core): enhance client ID validation and CSP configuration

* web: Mobile image in /cloud (RooCodeInc#8705)

* feat(ui): add option to hide API request details by default

* Revert cloud agents for now (RooCodeInc#8713)

* chore: add changeset for v3.28.18 (RooCodeInc#8715)

* fix(task): adjust API request handling and error message assignment

* Changeset version bump (