Skip to content

Force thinking off until the gateway accepts adaptive mode - #6

Merged
BeLazy167 merged 1 commit into
mainfrom
fix/adaptive-thinking-workaround
Aug 20, 2026
Merged

Force thinking off until the gateway accepts adaptive mode#6
BeLazy167 merged 1 commit into
mainfrom
fix/adaptive-thinking-workaround

Conversation

@BeLazy167

Copy link
Copy Markdown
Member

Found by the first real installed session: recent Claude Code sends
thinking: {type: "adaptive"}, the gateway accepts only enabled|disabled
(qbraid-api ai-request.validators.ts), so a fresh install's first request
400s
on the default model.

MAX_THINKING_TOKENS=0 in both launchers and the --global env 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 -p returns a real completion.

This is a stopgap: the real fix (map adaptiveenabled, and fold Claude
Code's system-role reminder messages into the instructions channel — that one
blocks Opus entirely) is built and gate-green on qbraid-api
feat/ai-system-role-messages, awaiting push approval. Remove this once that
deploys to prod.

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).
@BeLazy167
BeLazy167 merged commit 2728963 into main Aug 20, 2026
6 checks passed
@BeLazy167
BeLazy167 deleted the fix/adaptive-thinking-workaround branch August 20, 2026 21:49
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.

1 participant