[Bug]: Fast mode on custom Claude-provider models is dropped before the Agent SDK query
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- On a Claude provider instance, add a custom model (for example a model served through an Anthropic-compatible proxy) and enable the Fast mode capability in Settings → Models.
- Select that custom model in a thread and turn the per-thread Fast toggle on.
- Send a prompt and inspect the Agent SDK query options or the outgoing request.
Expected behavior
The thread's Fast choice should reach the Claude Agent SDK as settings.fastMode: true, as it does for bundled models that expose the fast-mode option.
Actual behavior
From source tracing on main, the selection is dropped at the provider boundary:
- The custom capability is saved and offered per thread (
apps/web/src/components/settings/customModelEditor.logic.ts,apps/web/src/components/chat/TraitsPicker.tsx), and the composer dispatches the selected model with its options. makeClaudeQueryOptionsinapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tscallscompileClaudeModelSelection(input.modelSelection)without a catalog argument, so it falls back toBUNDLED_CLAUDE_MODEL_CATALOG.compileClaudeModelSelection(apps/server/src/claudeModelOptions.ts) only emitsfastModewhen that catalog's capabilities for the model include the booleanfastModedescriptor. Custom models aren't in the bundled catalog, so nofastModesetting is produced, while the custom slug is still passed asoptions.model.scopeClaudeModelCataloginapps/server/src/provider/ClaudeModelCatalog.tswould include custom-model descriptors, but it appears to be used only byClaudeTextGeneration.ts, not the adapter.
I have not captured a live request; this is from reading the code path.
Impact
Minor bug or occasional failure
Version or commit
main @ 8ddf200e8f
Environment
macOS, T3 Code desktop, Claude provider with custom models routed through an Anthropic-compatible proxy.
Workaround
Configure a separate custom model ID that encodes the fast variant on the proxy side, instead of using the Fast toggle.
Possible fix
Compile the selection against the provider instance's scoped catalog (the one including custom-model capabilities) in makeClaudeQueryOptions. Separately, whether Claude Code forwards fast mode for a non-Claude model ID would need confirming once settings.fastMode is passed.
[!NOTE] Grok responding on behalf of Julius.
Thanks for the careful trace! This is the same root cause as #16672: makeClaudeQueryOptions in ClaudeAdapterV2 compiles the selection against the bundled catalog, so every option declared on a custom Claude model (effort, thinking, and fast mode alike) gets dropped. Closing this as a duplicate so the discussion stays in one place.
The open fix is #16583, which passes the driver's live catalog (with the instance's custom models scoped in) to the adapter, so a custom model's fastMode descriptor should then produce settings.fastMode. If fast mode is still dropped once that lands, please reopen or comment on #16672.