Repository navigation
fix(vercel): list models with the configured API key - #180838
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR authenticates Vercel model discovery with the configured API key and documents Token Pass model selection. Example: List Vercel models using a Token Pass key.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a current catalog-discovery bug with a focused change, and no introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Vercel plugin resolves provider credentials and supplies model rows to OpenClaw’s catalog; shared discovery owns HTTP acquisition, credential-scoped caching, and refresh outcomes. flowchart LR
A[Model listing and picker] --> B[Vercel catalog hook]
C[Provider credential resolver] --> B
B --> D[Shared live discovery]
D --> E[Guarded Vercel models request]
E --> F[Model rows and refresh outcome]
F --> A
Technical reviewBest possible solution: Use the existing credential resolver and live discovery helper to acquire Vercel’s key-scoped catalog while preserving strict outcomes and offline static listing. Do we have a high-confidence way to reproduce the issue? Current main visibly drops discovery credentials before the Vercel model-list request; the author reports the corresponding anonymous-versus-keyed catalog difference, but this review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete fix: forward resolved discovery credentials through existing acquisition ownership, with one regression protecting the missing authorization header. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 082e55e28d33. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +13, Tests +18, Docs +9. Total +40 across 5 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 1:55 PM ET / 17:55 UTC. |
|
Landed as caf1220.
|
## What Problem This Solves The Vercel AI Gateway plugin fetched `/v1/models` without the user's API key. Vercel scopes that list per key, so OpenClaw showed the public list (486 models) even when the key can use only a few. A Vercel Token Pass key can call only Token Pass models, so most models in the picker failed with HTTP 403. ## Fix The Vercel catalog now resolves the provider credential and sends it on the model-list request, using the existing live catalog helper (same pattern as Hugging Face). The trusted-proxy fetch guard, the strict discovery mode and the static catalog for unauthenticated reads stay as they are. The provider docs gain a short Token Pass note. ## User Impact `openclaw models list --provider vercel-ai-gateway` and the model picker show the models the configured key can use. New Vercel models still appear without an OpenClaw release, and model details still come from Vercel's live rows. ## Evidence - Vercel API, Token Pass key: `/v1/models` returns 6 models (`deepseek/deepseek-v4.1-flash`, `moonshotai/kimi-k3`, `zai/glm-5.3` and their `-fast` variants). Without a key it returns 486. - Live run with a real Token Pass key on built OpenClaw: `openclaw models list --provider vercel-ai-gateway --all --refresh` lists exactly those 6 models, with Vercel status `ready`. `openclaw agent --local` turns on `zai/glm-5.3` and `moonshotai/kimi-k3` replied as expected. - Regression test: the catalog run sends `Authorization: Bearer <key>` on the model-list request. It fails on `main` (`expected null to be 'Bearer scoped-key'`) and passes with the fix. All 12 Vercel plugin tests pass. - Related: openclaw#173750 keeps the key usable after a 403 for a model outside the pass. - Follow-up, not in this PR: onboarding still sets `anthropic/claude-opus-4.6` as the default, which a Token Pass key cannot use. Co-authored-by: Ayaan Zaidi <[email protected]>
## What Problem This Solves The repo has no written rules for agents that work on model listing, provider plugins or usage/cost. So the same classes of bugs keep coming back across providers and on the Models and Usage pages. ## User Impact There is no user-visible change. Agents that work in these areas now get short rules from the scoped guide they already read. ## Why This Change Was Made Each rule records a lesson that came back 2 or more times in merged work. Each rule is one line, in the guide that owns the area: - **`src/plugins/AGENTS.md` "Model Listing":** - The hot path has no network request. - `models.list` has p99 under 300 ms. Rows and prices publish as one snapshot, and removals apply at once. - The authenticated listing decides which models show. - List with the credential and runtime that will execute the turn, with one row per model per provider. - Failed and empty listings each have defined semantics. - Capabilities come from the listing, not from model-ID rules. - One core admission rule. - **`extensions/AGENTS.md`:** - Host policy that every provider shares stays core. - Sign-in goes through the Models page and `/login`. Setup saves the connection only. - Native CLIs own their login and model menu. - Refusals are classified by cause. - Attribution headers come from one helper. - **`src/agents/AGENTS.md` "Run Authority":** - One model resolver for every entry path. - No silent fallback to another runtime or billing. - Native-runtime consent is asked once. - **`src/gateway/AGENTS.md` "Usage And Cost" (new section):** - Measured, unpriced, partial and unknown usage stay distinct. - Each route is priced from the provider that bills it. - Reports are complete or flagged as partial. - **`ui/AGENTS.md`:** - A route waits only for its first-paint data. - New "Layout Stability" section: zero layout shift, how to prove it, and a 200 ms load budget for Models and Usage. - **Root `AGENTS.md`:** one line in "Read when relevant" that points to these sections. Examples of the incidents behind the rules: #140139, #158000, #167444, #167658, #168033, #172608, #172773, #173792, #174641, #176404, #180838, #184066. ## Evidence - `pnpm check:agents-md-size`: all 27 files are within 20000 chars. - `oxfmt --check` passes on each of the 6 changed files. - I checked the cited names on current `main`: `buildLiveModelProviderConfig`, `readModelId` and `modelPricing.providers.<id>.priceAs`. Co-authored-by: Ayaan Zaidi <[email protected]>
…87141) ## What Problem This Solves The repo has no written rules for agents that work on model listing, provider plugins or usage/cost. So the same classes of bugs keep coming back across providers and on the Models and Usage pages. ## User Impact There is no user-visible change. Agents that work in these areas now get short rules from the scoped guide they already read. ## Why This Change Was Made Each rule records a lesson that came back 2 or more times in merged work. Each rule is one line, in the guide that owns the area: - **`src/plugins/AGENTS.md` "Model Listing":** - The hot path has no network request. - `models.list` has p99 under 300 ms. Rows and prices publish as one snapshot, and removals apply at once. - The authenticated listing decides which models show. - List with the credential and runtime that will execute the turn, with one row per model per provider. - Failed and empty listings each have defined semantics. - Capabilities come from the listing, not from model-ID rules. - One core admission rule. - **`extensions/AGENTS.md`:** - Host policy that every provider shares stays core. - Sign-in goes through the Models page and `/login`. Setup saves the connection only. - Native CLIs own their login and model menu. - Refusals are classified by cause. - Attribution headers come from one helper. - **`src/agents/AGENTS.md` "Run Authority":** - One model resolver for every entry path. - No silent fallback to another runtime or billing. - Native-runtime consent is asked once. - **`src/gateway/AGENTS.md` "Usage And Cost" (new section):** - Measured, unpriced, partial and unknown usage stay distinct. - Each route is priced from the provider that bills it. - Reports are complete or flagged as partial. - **`ui/AGENTS.md`:** - A route waits only for its first-paint data. - New "Layout Stability" section: zero layout shift, how to prove it, and a 200 ms load budget for Models and Usage. - **Root `AGENTS.md`:** one line in "Read when relevant" that points to these sections. Examples of the incidents behind the rules: openclaw#140139, openclaw#158000, openclaw#167444, openclaw#167658, openclaw#168033, openclaw#172608, openclaw#172773, openclaw#173792, openclaw#174641, openclaw#176404, openclaw#180838, openclaw#184066. ## Evidence - `pnpm check:agents-md-size`: all 27 files are within 20000 chars. - `oxfmt --check` passes on each of the 6 changed files. - I checked the cited names on current `main`: `buildLiveModelProviderConfig`, `readModelId` and `modelPricing.providers.<id>.priceAs`. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
The Vercel AI Gateway plugin fetched
/v1/modelswithout the user's API key. Vercel scopes that list per key, so OpenClaw showed the public list (486 models) even when the key can use only a few. A Vercel Token Pass key can call only Token Pass models, so most models in the picker failed with HTTP 403.Fix
The Vercel catalog now resolves the provider credential and sends it on the model-list request, using the existing live catalog helper (same pattern as Hugging Face). The trusted-proxy fetch guard, the strict discovery mode and the static catalog for unauthenticated reads stay as they are. The provider docs gain a short Token Pass note.
User Impact
openclaw models list --provider vercel-ai-gatewayand the model picker show the models the configured key can use. New Vercel models still appear without an OpenClaw release, and model details still come from Vercel's live rows.Evidence
/v1/modelsreturns 6 models (deepseek/deepseek-v4.1-flash,moonshotai/kimi-k3,zai/glm-5.3and their-fastvariants). Without a key it returns 486.openclaw models list --provider vercel-ai-gateway --all --refreshlists exactly those 6 models, with Vercel statusready.openclaw agent --localturns onzai/glm-5.3andmoonshotai/kimi-k3replied as expected.Authorization: Bearer <key>on the model-list request. It fails onmain(expected null to be 'Bearer scoped-key') and passes with the fix. All 12 Vercel plugin tests pass.anthropic/claude-opus-4.6as the default, which a Token Pass key cannot use.