Skip to content

Partial thinking config doesn't merge with defaults, causing AI_InvalidArgumentError #6806

Closed as not planned

Description

@TechDufus

Summary

Setting thinking.type without budgetTokens causes AI_InvalidArgumentError: invalid anthropic provider options when using plan mode or compact.

Reproduction

Config (opencode.json):

{
  "provider": {
    "anthropic": {
      "models": {
        "claude-opus-4-5": {
          "options": {
            "thinking": {
              "type": "hidden"
            }
          }
        }
      }
    }
  }
}

Then use plan mode or compact.

Expected

Partial config merges with defaults. User just wants to hide thinking blocks - budgetTokens should use OpenCode's default.

Actual

The incomplete thinking object is passed to the AI SDK as-is:

{
  "thinking": {
    "type": "hidden",
    "budgetTokens": null
  }
}

SDK validation fails because budgetTokens must be a number.

Workaround

Add budgetTokens manually or remove the thinking config entirely.

Version

1.0.223

Activity

  1. github-actions commented on Jan 4, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or related to existing issues. Please check:

    Feel free to ignore if this doesn't address your specific case.

  2. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions