3.4 KiB
3.4 KiB
Vercel AI Gateway Provider — Implementation Checklist
Archived (2026-02-18): Historical implementation checklist. Canonical status is tracked in
docs/plans/state.json; unchecked boxes here are not active backlog unless explicitly re-opened.
Date: 2026-02-15
Parent roadmap: docs/plans/2026-02-15-openclaw-gap-roadmap.md
Goal: Close the gap item "Vercel AI Gateway" by adding a first-class model provider that routes through the Vercel AI Gateway using Flynn's existing OpenAI-compatible client path where possible.
Scope
- Add a new provider id (
vercelorvercel_ai_gateway). - Implement the provider via
OpenAIClientwhen the gateway is OpenAI-compatible. - Ensure the provider works with:
- streaming (if supported by OpenAIClient path)
- tool calling
- model tier switching via
/model <tier> <provider/model>
Non-goals:
- Implementing gateway-specific “extras” (tracing, metadata) unless required.
Design
Provider id
Recommended id: vercel (short) or vercel_ai_gateway (explicit).
Pick one and use it consistently in:
MODEL_PROVIDERSinsrc/config/schema.ts- docs + setup wizard provider list
- doctor checks
Config fields
Use the existing ModelConfig fields:
endpoint: base URL of gateway (OpenAI-compatible)api_key: gateway API key (or env var)
Example:
models:
default:
provider: vercel_ai_gateway
model: gpt-4.1
endpoint: "https://gateway.ai.example.com/v1"
api_key: "${VERCEL_AI_GATEWAY_API_KEY}"
PR Breakdown
PR 1 — Schema + factory wiring
Checklist:
- Add provider id to
MODEL_PROVIDERSinsrc/config/schema.ts. - Update
createClientFromConfig()insrc/daemon/models.ts:- map provider ->
new OpenAIClient({ model, apiKey, baseURL }) - require an API key (config or env var)
- use
cfg.endpointasbaseURL(or a sensible default if the gateway has one)
- map provider ->
- Update
/modelstrict-tier switching support (should be automatic once provider id is recognized).
Tests:
- Update
src/config/schema.test.tsto accept the new provider enum. - Add case to
src/daemon/clientFactory.test.ts:- asserts the provider returns an OpenAI-compatible client
- asserts
baseURLis passed whenendpointis set
Acceptance:
pnpm typecheckpnpm test:run src/daemon/clientFactory.test.ts src/config/schema.test.ts
PR 2 — Doctor + setup wizard + docs
Checklist:
- Update
src/cli/doctor.tsprovider key checks:- if Vercel gateway requires a key, ensure doctor warns when missing
- Update setup wizard provider picker (optional but recommended):
src/cli/setup/providers.tssrc/cli/setup/providers.test.ts
- Document provider config in
README.md(one short snippet; avoid long docs).
Tests:
pnpm test:run src/cli/setup/providers.test.ts(if changed)pnpm test:run src/cli/doctor.test.ts(if changed)
Acceptance:
flynn doctorguidance includes Vercel gateway key/env var info.
PR 3 — Integration validation (optional)
Checklist:
- Add a simple smoke test using the
syntheticprovider style or a mocked OpenAI SDK path if possible. - Ensure streaming works end-to-end via gateway.
Acceptance:
- A real config can run
flynn send "hello"using the gateway provider.
Final Checks
pnpm typecheckpnpm test:run- Update
docs/plans/state.jsonentry tocompletedonce implemented (include test status).