From 2464842fee93ee1c98ba4164040063455f3d8138 Mon Sep 17 00:00:00 2001 From: BeLazy167 Date: Thu, 20 Aug 2026 21:25:11 -0500 Subject: [PATCH] Remap the picker's built-in tier rows to gateway model ids Selecting 'Opus 4.8' (or Sonnet/Haiku) in /model silently broke the session: those rows point at Anthropic's dated first-party ids, which the proxy does not serve. ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU}_MODEL remaps them to the gateway's ids, labeled '(qBraid)' so the provenance is visible. Live report that motivated it: /model -> 'Opus 4.8' -> next reply claims to be gpt-5.6-luna. The switch never took effect on the wire; the self-report echoes whatever id Claude Code puts in the system prompt. --- qbraid-code | 10 ++++++++++ qbraid-code.cmd | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/qbraid-code b/qbraid-code index a8cc8d7..9f26c67 100755 --- a/qbraid-code +++ b/qbraid-code @@ -208,6 +208,16 @@ if [ -n "$PROXY_BIN" ] && [ -x "$PROXY_BIN" ] && [ -s "$HOME_DIR/proxy-config.ya # fetches {base}/v1/models at startup and shows rows labeled "From # gateway"; GPT models appear via their anthropic-compat/ aliases. export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 + # The picker's BUILT-IN tier rows (Opus/Sonnet/Haiku) point at Anthropic's + # dated first-party ids, which this proxy does not serve — selecting one + # silently broke the session. Remap them to the gateway's ids so every + # row in the picker actually routes. + export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5" + export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME="Opus 5 (qBraid)" + export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6" + export ANTHROPIC_DEFAULT_SONNET_MODEL_NAME="Sonnet 4.6 (qBraid)" + export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5" + export ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME="Haiku 4.5 (qBraid)" else case "$RUN_MODEL" in gpt-*|*/gpt-*) exit 1 ;; # start_proxy already explained diff --git a/qbraid-code.cmd b/qbraid-code.cmd index 22e9111..4a1f63b 100644 --- a/qbraid-code.cmd +++ b/qbraid-code.cmd @@ -63,8 +63,16 @@ powershell -NoProfile -ExecutionPolicy Bypass -File "%QC_HOME%\qbraid-proxy.ps1" if errorlevel 1 goto :noproxy set /p RUNTOKEN=<"%QC_HOME%\proxy.key" set "RUNBASE=http://127.0.0.1:8320" -rem Populate the /model picker from the proxy's model list at startup. +rem Populate the /model picker from the proxy's model list at startup, and +rem remap the built-in Opus/Sonnet/Haiku rows to gateway ids so every picker +rem row actually routes (the defaults point at dated first-party ids). set "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1" +set "ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5" +set "ANTHROPIC_DEFAULT_OPUS_MODEL_NAME=Opus 5 (qBraid)" +set "ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-6" +set "ANTHROPIC_DEFAULT_SONNET_MODEL_NAME=Sonnet 4.6 (qBraid)" +set "ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5" +set "ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME=Haiku 4.5 (qBraid)" goto :routed :noproxy if /i "%RUNMODEL:~0,4%"=="gpt-" (