Skip to content

Claude Sonnet 5: thinking cannot be disabled, and a non-default Temperature returns 400 #875

Description

@PLLaberge

Add-on version: 4.1.1
Provider: Claude API (Anthropic)
Model: claude-sonnet-5

Anthropic changed three API behaviours with Sonnet 5. Two of them make
js/api/anthropic.js build a request body that either fails outright or is much
slower than intended. Both are small fixes.


1. Extended thinking budget 0 no longer disables thinking

js/api/anthropic.js, lines 103-111:

const thinkingBudget = parseInt(this.extended_thinking_budget);
const thinkingEnabled = !Number.isNaN(thinkingBudget) && thinkingBudget > 0;

if (thinkingEnabled) {
  claude_body.thinking = { type: 'enabled', budget_tokens: thinkingBudget };
} else {
  const tempFloat = parseFloat(this.temperature);
  if (this.temperature != '' && !Number.isNaN(tempFloat)) claude_body.temperature = tempFloat;
}

When the budget is 0 the request carries no thinking field at all. On Sonnet 4.6
and earlier that meant no thinking. On Sonnet 5 an omitted thinking field means
adaptive thinking is on by default, at the default effort level of high.

The practical effect is that short editing prompts (proofread, rewrite, clarify) now
spend significant time and tokens reasoning before answering, with no way to switch
it off from the options page. The "Extended thinking budget" field is the only
related control, and setting it to 0 does not do what its label implies.

It also consumes the max_tokens budget, since max_tokens caps thinking plus
response text together. A limit sized for a short email rewrite can now be spent on
thinking and truncate the reply.

Suggested fix — send the explicit disable when the budget is 0:

if (thinkingEnabled) {
  claude_body.thinking = { type: 'enabled', budget_tokens: thinkingBudget };
} else {
  claude_body.thinking = { type: 'disabled' };
  const tempFloat = parseFloat(this.temperature);
  if (this.temperature != '' && !Number.isNaN(tempFloat)) claude_body.temperature = tempFloat;
}

Note that thinking: { type: 'enabled', budget_tokens: N } is itself removed on
Sonnet 5 and returns 400, so any non-zero budget now fails on that model. The field
may need to be hidden or ignored for Sonnet 5 and later, or repurposed as described
in section 3.


2. A non-default Temperature returns 400 on Sonnet 5

Line 110 sends temperature whenever the field is non-empty. On Sonnet 5, setting
temperature, top_p or top_k to any non-default value returns a 400 error, so
every request fails until the user finds the field and sets it to 1.0 or clears it.

The options page still describes the range as 0.0 to 1.0 with guidance to use lower
values for analytical tasks, which now leads users straight into a broken
configuration.

Suggested fix: skip temperature for models where it is not accepted, or
validate on the options page and warn when a Sonnet 5 model is selected with a
non-default temperature. A clearer error surfaced from the 400 response would also
help, since the current failure gives no hint about which field caused it.


3. Feature request: expose the effort parameter

Sonnet 5 replaces manual thinking budgets with output_config.effort, accepting
low, medium, high (default), xhigh and max.

claude_body.output_config = { effort: this.effort };

For ThunderAI's use cases this maps well onto the existing per-prompt settings. A
proofread or tone rewrite runs fine at low and returns much faster, while a
summarise or classify prompt might warrant medium. Exposing it globally would help;
exposing it per prompt, alongside the existing type and action fields, would fit the
add-on's design better.

Activity

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

Metadata

Metadata

Assignees

Labels

api_claudeClaude API Integration (it was Anthropic)bugSomething isn't workingstatus: releasedFeature released.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions