Skip to content

fix(thinking): switch WebLLM thinking models with enable_thinking; release 0.0.21 - #19

Merged
siarheidudko merged 1 commit into
mainfrom
claude/agents-review-improvements-2m2406
Oct 3, 2026
Merged

siarheidudko merged 1 commit into
mainfrom
claude/agents-review-improvements-2m2406

Conversation

@siarheidudko

Copy link
Copy Markdown
Member

With a local model in the demo, the thinking setting did nothing.

Cause

@browser-ai/web-llm ignores the AI SDK's portable reasoning level. WebLLM switches a thinking model (Qwen3) only through extra_body.enable_thinking, which it reads from providerOptions['web-llm']. A thinking model thinks by default, so a local Qwen3.5 always thought, whatever the setting.

Change

resolveThinking now also returns providerOptions['web-llm'].extra_body.enable_thinking:

  • 'none' sends false, the only way to turn a thinking model off;
  • any other level sends true; models without thinking ignore it;
  • unset or false still sends nothing, so the provider default applies.

The other providers are unchanged. Docs: docs/capabilities.md → Thinking. Version 0.0.21.

Checks

typecheck, format:check, build, npm test 144/144.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5


Generated by Claude Code

…lease 0.0.21

@browser-ai/web-llm ignores the AI SDK's portable `reasoning` level: a Qwen3
model in WebLLM is switched only by `extra_body.enable_thinking`, and thinks
by default. So the thinking setting changed nothing for local models.

resolveThinking now also returns providerOptions['web-llm'].extra_body
.enable_thinking: false for 'none', true for any other level (models without
thinking ignore it). Unset still sends nothing, leaving the provider default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
@siarheidudko
siarheidudko marked this pull request as ready for review October 3, 2026 01:47
@siarheidudko
siarheidudko merged commit cf5fd98 into main Oct 3, 2026
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