Skip to content

ci: when the agent pin cannot think, say which models can - #23

Merged
aroff merged 1 commit into
mainfrom
ci/preflight-suggest-models
Sep 4, 2026
Merged

aroff merged 1 commit into
mainfrom
ci/preflight-suggest-models

Conversation

@aroff

@aroff aroff commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why

#22 made the agent-route preflight fast and accurate — it now fails in ~30s instead of burning
60 minutes, and it quotes the backend's own error. But its remedy is not actionable:

point LLM_GATEWAY_MODEL at a thinking-capable model group

Point it at which one? The gateway registers model groups in the LiteLLM DB
(litellm-config.yaml sets store_model_in_db: true and deliberately carries no model_list),
so there is nothing in git to read, and the names give nothing away. This key's catalog, printed
by the judge preflight on run 33896269263, is:

chat-default, tools-default, embed-default, vision-default, vision-accurate

Role names, not capabilities. Guessing costs a dispatch each.

What

On the failure path only, probe the rest of the allow-list with the same extended-thinking
request that just failed, and report one of two verdicts:

outcome message who fixes it
≥1 model passes ::error::set LLM_GATEWAY_MODEL to one of: <names> whoever owns the repo secret
none pass ::error::no model in this key's allow-list can serve an extended-thinking request. This is not fixable by repointing the secret… whoever owns the gateway + virtual key

That distinction is the point: the two outcomes need different people to do different things, and
today the log cannot tell them apart.

Embedding models are skipped (they cannot serve /v1/messages at all) and the list is capped at
12 so a large catalog cannot turn the diagnostic into its own long job. A healthy run never
reaches this code and pays nothing.

Verification

Against a mock gateway serving GET /v1/models plus per-model thinking behaviour, with the step
script extracted from this YAML (yaml.safe_load) rather than retyped:

  • two capable models → PASS chat-default, PASS vision-default, then
    ::error::set LLM_GATEWAY_MODEL to one of: chat-default vision-default, exit 1.
    Both the embedding model and the already-failed pin were skipped.
  • none capable → fail for each, then the "not fixable by repointing" error, exit 1.
  • healthy pin (chat-default) → minimal request: 200, thinking request: 200 — the agent route can serve this model., exit 0, no probing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DobwJ8YTnfowwqwhspU1kQ

#22 made the failure fast and accurate, but its remedy -- "point
LLM_GATEWAY_MODEL at a thinking-capable group" -- is not actionable on its own.
The gateway registers model groups by role in the LiteLLM DB, not in git
(litellm-config.yaml deliberately carries no model_list), so there is nothing to
read and the names give nothing away: this key serves chat-default,
tools-default, embed-default, vision-default and vision-accurate.

So probe the rest of the allow-list and report. Two distinct verdicts, which
matter because they need different people to do different things:

  - at least one passes  -> name them; the fix is to repoint the secret.
  - none pass            -> say plainly that repointing cannot fix it, and that
                            the gateway needs a thinking-capable group
                            registered and in the key's scope.

Embedding models are skipped and the list is capped at 12. This runs only on the
failure path, so a healthy run pays nothing for it.

Verified against a mock gateway serving /v1/models plus per-model thinking
behaviour: with two capable models it names exactly those two (skipping both the
embedding model and the already-failed pin); with none capable it emits the
"not fixable by repointing" error; and a healthy pin still exits 0 without
probing anything.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DobwJ8YTnfowwqwhspU1kQ
@aroff
aroff enabled auto-merge (squash) September 4, 2026 16:44
@aroff
aroff merged commit 7621442 into main Sep 4, 2026
4 checks passed
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