Commit 24e660a
fix: disable Anthropic thinking to fix tool chain crash (#415)
* fix: disable Anthropic thinking to fix tool chain crash
Anthropic's API rejects requests that combine extended thinking with
forced tool_choice. The ToolLoopAgent enables thinking globally, and
prepareStep forces toolChoice for every tool chain step (create_new_artist,
create_release_report). This causes "Thinking may not be enabled when
tool_choice forces tool use" on any Anthropic model.
The Vercel AI SDK does not support overriding providerOptions per-step
(open issue vercel/ai#11761), so the fix must be at the constructor level.
Disables Anthropic thinking until the SDK adds per-step providerOptions
support or an alternative approach is implemented.
Made-with: Cursor
* fix: use fallback model for tool chain steps to avoid Anthropic thinking conflict
Instead of disabling Anthropic thinking globally, tool chain steps now
switch to openai/gpt-5-mini (via TOOL_CHAIN_FALLBACK_MODEL) when no
specific model is mapped in TOOL_MODEL_MAP.
This preserves extended thinking for regular Anthropic conversations
while ensuring forced toolChoice works during tool chain execution.
Made-with: Cursor
* chore: use openai/gpt-5.4-mini as tool chain fallback model
Made-with: Cursor
* style: fix prettier formatting on import
Made-with: Cursor
* refactor: remove TOOL_CHAIN_FALLBACK_MODEL, use TOOL_MODEL_MAP for all chain tools
Addresses code review feedback — use existing TOOL_MODEL_MAP pattern
instead of a separate fallback constant. All tool chain tools now have
explicit model entries in TOOL_MODEL_MAP.
Made-with: Cursor
---------
Co-authored-by: sswift <159544713+sswiftdrtv@users.noreply.github.com>1 parent fe1e264 commit 24e660a
2 files changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
23 | 37 | | |
24 | 38 | | |
25 | 39 | | |
| |||
0 commit comments