Repository navigation
Run the real-CLI Claude Code model probe in CI - #4126
Merged
Merged
Conversation
andrewkchan
force-pushed
the
ci/real-provider-model-listing
branch
3 times, most recently
from
September 23, 2026 00:14
7ad115a to
a951482
Compare
Every automated check of bb's Claude Code model catalog mocks the Agent SDK's `query()`, so nothing in CI ever spawned a real `claude`. The test that would catch a broken probe already exists — `integration.provider-basic.test.ts` "lists models" — but `test:integration` is referenced nowhere in `.github/`. The picker broke exactly that way: the probe's `settingSources: []` made the CLI exit with code 0 and no output, reported as "Query closed before response received". `models.fallback` hid it until #4084 removed it. - Add a `provider-model-listing` CI job running the probe against a real, unpinned CLI. It passes today, and would have passed on the unfixed probe: the defect is specific to the macOS native build, which exits when the settings set it loads is empty, so a Linux runner cannot reproduce it. - Match the probe's setting sources to what `sdk-session.ts` already passes for real sessions, which fixes the picker. - Let CLAUDE_CODE_OAUTH_TOKEN reach the CLI. The bridge env allowlist declared only BB_CLAUDE_CODE_EXECUTABLE, and Turbo strips undeclared variables, so token auth never worked for any bb user and the documented executable override was inert under `test:integration`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
andrewkchan
force-pushed
the
ci/real-provider-model-listing
branch
from
September 23, 2026 00:20
a951482 to
830886e
Compare
3 tasks done
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.
Human comments
I am running into a bug on the Claude Code model picker where the models are not listing properly. It looks like we have some automated tests that download claude code and then run the bb probe against it to get the list of models to display in the picker, but they simply do not run in CI.
This wires them up in CI. Note some changes are needed for secrets:
CLAUDE_CODE_OAUTH_TOKENthrough to the bridge processCLAUDE_CODE_OAUTH_TOKENto the github repo secretsPR also includes the fix for the bug on my local computer. Unfortunately, the automated tests on linux do not repro the issue.
What was wrong
Every automated check of bb's Claude Code model catalog mocks the Agent SDK's
query(), so nothing in CI has ever spawned a realclaude. A test that would catch a broken probe already exists —integration.provider-basic.test.ts"lists models" — buttest:integrationis referenced nowhere under.github/, so it only runs when someone remembers to run it locally.That gap surfaced when the picker started showing "Could not load models for Claude Code": the probe's
settingSources: []made the CLI exit with code 0 and no output, which the SDK reports asQuery closed before response received. It had been failing since at least Sep 16, hidden bymodels.fallbackuntil #4084 removed it.What changed
.github/workflows/ci.yml: newprovider-model-listingjob on pushes and same-repo PRs. Installs the Claude Code CLI, authenticates from aCLAUDE_CODE_OAUTH_TOKENsecret, runs the model-listing probe against a real binary.plugins/provider-claude-code/src/bridge/model-list.ts: the probe now usessettingSources: ["user", "project", "local"], matching whatsdk-session.tsalready passes for real sessions.plugins/provider-claude-code/server.ts,turbo.json: letCLAUDE_CODE_OAUTH_TOKENreach the CLI. Two layers stripped it — the bridge env allowlist declared onlyBB_CLAUDE_CODE_EXECUTABLE, and Turbo strips undeclared variables. So token auth never worked for any bb user, not just CI, and the documentedBB_CLAUDE_CODE_EXECUTABLEoverride was inert undertest:integration.docs/configuration.md,claude-code-providerskill: document both variables.Scope is the model-listing tests only, to keep the job fast and free of real model turns. The CLI version is unpinned (pinning would hide the breakage this job watches for), and it installs the native build, which is what bb resolves from
PATHand~/.local/bin.Expected state of this job: green
This job passes, and would have passed on the unfixed probe too. It is general regression coverage, not a reproduction of the defect that motivated it.
That defect is specific to the macOS native build, which exits when the settings set it loads is empty. On CLI 2.1.280:
So a Linux runner cannot reproduce it; a macOS leg could, and is the natural follow-up. A CLI that exits 0 with empty stdout and stderr also leaves bb nothing to report, which is worth filing upstream separately.
How you verified
[]fails,["user","project","local"]returns 5 models. Verified end to end in a dev build.✓ lists models,Tests 1 passed | 64 skipped (65)— the filter is not silently matching zero tests.turbo run test typecheck --filter=bb-plugin-provider-claude-code: passing.turbo run test --filter=@bb/server: 295 files passing, with one unrelated pre-existing failure (bb-official-generator.test.ts, a local git%cIformat difference) that reproduces with these changes stashed.Fixes #