Force thinking off until the gateway accepts adaptive mode - #6
Merged
Conversation
Recent Claude Code sends `thinking: {type: "adaptive"}`; the gateway's
Anthropic surface accepts only enabled|disabled, so the FIRST request of a
fresh install 400s — verified live on this machine, on the default model.
MAX_THINKING_TOKENS=0 is FORCED, not defaulted: an inherited value from the
user's shell re-enables thinking and reproduces the 400 (also verified).
Set in both launchers and in the --global env block.
Remove once qbraid-api maps adaptive -> enabled (fix built and tested on
branch feat/ai-system-role-messages there).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by the first real installed session: recent Claude Code sends
thinking: {type: "adaptive"}, the gateway accepts onlyenabled|disabled(
qbraid-api ai-request.validators.ts), so a fresh install's first request400s on the default model.
MAX_THINKING_TOKENS=0in both launchers and the--globalenv block.Forced, not defaulted — an inherited value from the user's shell re-enables
thinking and reproduces the 400 (verified both ways on this machine).
Verified live after the change: sonnet, haiku (and opus via direct curl) all
answer through the gateway;
qbraid-code -preturns a real completion.This is a stopgap: the real fix (map
adaptive→enabled, and fold ClaudeCode's system-role reminder messages into the instructions channel — that one
blocks Opus entirely) is built and gate-green on
qbraid-apifeat/ai-system-role-messages, awaiting push approval. Remove this once thatdeploys to prod.