Repository navigation
List provider models with plugin-contributed provider environment - #5767
Merged
Merged
Conversation
The model catalog launched each provider's model/list without the environment plugins contribute through bb.providers.experimental_contributeEnv, so Codex behind the Account Pooler listed only the models of the machine's own login. The server now resolves contributed env with a null thread and project for catalog reads and prewarm, fingerprints it into the catalog cache, and sends it on provider.list_models. The Codex bridge relaunches its model-list app-server when the pool route or token changes. ExperimentalPluginProviderEnvContext threadId and projectId become nullable; the Account Pooler skips per-thread routing state when there is no thread. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 23, 2026
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
What was wrong
The model catalog sent
provider.list_modelswithout the environment plugins contribute throughbb.providers.experimental_contributeEnv. Those resolvers ran only for thread sessions and turns. With the Account Pooler routing Codex, the bridge's model-listcodex app-servertherefore started with the machine's own Codex login instead of the pool. On a machine without its own login, or with a smaller plan, the picker showed only that account's models. For example, GPT-6-Astra and the Sol models were missing even though pooled threads could use them.What changed
provider-model-catalog-store.ts): catalog reads and prewarm resolve contributed provider env with{ threadId: null, projectId: null, hostId }and send it onprovider.list_models. The env names and values are part of the catalog fingerprint, so a route or token change discards the stored list.provider.list_modelsgains a requiredcontributedEnv;HOST_DAEMON_PROTOCOL_VERSION242 → 243. The daemon passes it toruntime.listModels. The runtime expands it like a session's env (serverPath→BB_SERVER_URL+ path) through a sharedresolveContributedEnvironment, and sends the result asenvVarson the bridgemodel/listrequest. That bridge param is optional, so existing bridges ignore it.ExperimentalPluginProviderEnvContext.threadIdandprojectIdare nowstring | null, withnullmeaning "no thread", e.g. model catalog listing. This is a breaking change to anexperimental_API.nullthread it still returns the pooled env, but skips the thread bypass check, theretry-route:key andrecordRouted.docs/provider-plugin-api.md,docs/api_to_audit.md, and the bb-plugin-authoringproviders.mdreference.Marketplace impact. I searched all 414 community marketplace entries (316 git repos and 13 npm packages, default branches). 7 plugins call
experimental_contributeEnv. None crash, because when a resolver throws, bb logs it and skips that plugin's env.OXI-717/account-pool-balancedthrows inhubTokens.forThread, which requires a string thread, so its Codex catalog still lists local-login models and logs an error per read. It needs the same null-thread guard as the bundled pooler: Resolve provider env without a thread for bb model listing OXI-717/bb-plugins#70.grrowl/bb-github-app-authreturns nothing and logs project-lookup warnings.vaayne/agent-kit) falls back to its global routing setting, so it gets the fix.How you verified
BB_SERVER_URLprovider.list_modelsand a change invalidates the stored listpnpm exec turbo run typecheck lint --filter='...[origin/main]': 142/142 tasks passed.turbo run testfor agent-runtime, host-daemon-contract, host-daemon, server, provider-bridge-protocol, plugin-sdk, account-pool and provider-codex all passed, except one timing assertion inbuiltin-plugins.test.ts(builtin hot-reload), which passed when re-run alone.pnpm start:worktreeinside a pooled bb thread (parent-proxy mode; this machine has no Codex login).bb provider models codexagainst main listed 3 models (gpt-6-luna, gpt-5.6-terra, gpt-5.6-luna). Against this branch it listed 8, including gpt-6-astra, gpt-6.1-sol and gpt-6-sol, all with thefasttier.🤖 Generated with Claude Code