Repository navigation
feat(core): add Vercel AI Gateway setup and key replacement - #1
pcomans-bot wants to merge 8 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e05cb1064
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| title: Schema.String, | ||
| fields: Form.Fields, | ||
| }).annotate({ identifier: "Integration.Prompt" }) | ||
| export type Prompt = typeof Prompt.Type |
There was a problem hiding this comment.
Export the public Prompt record with a same-name interface
The new public Prompt is a Schema.Struct record, but its TypeScript counterpart is exported as a type alias. The Public Types guidance in packages/schema/AGENTS.md explicitly requires same-name interfaces for public Struct records and reserves aliases for other contract shapes. Export interface Prompt extends Schema.Schema.Type<typeof Prompt> {} instead to preserve the package's public-contract convention.
AGENTS.md reference: packages/schema/AGENTS.md:L60-L67
Useful? React with 👍 / 👎.
Issue for this PR
No linked issue. Adds guided Vercel AI Gateway setup and key replacement.
Type of change
What does this PR do?
Vercel setup currently requires a pasted API key. This adds browser sign-in, team selection, key naming and expiration, and confirmation before creating an AI Gateway key. The app, TUI, and CLI share the setup prompts. Manual key entry remains available; setting a spending limit is an optional Vercel dashboard link after connecting.
Expired or rejected keys offer Replace key. Replacement preserves the existing connection's ID, name, active-account selection, and model preferences. Cancellation leaves the old key intact. Setup retries reconcile the server's current step, duplicate form submissions are blocked, and dismissed TUI flows ignore late responses. Vercel OAuth tokens are not persisted.
The OAuth client ID is the placeholder
REPLACE_ME; no borrowed client ID is included. SetOPENCODE_VERCEL_CLIENT_IDon the server, or replace the placeholder with an OpenCode-owned public OAuth client before release. That app needs Team read access, AI Gateway API-key write access, and confirmed device-authorization support from Vercel. API permissions are currently documented as private beta.How did you verify your code works?
bun run checkpassed (full repository lint and typechecking); regenerated the client for the integration API changes.REPLACE_ME. The full backend also exposed 261 Vercel chat models after saving a test credential in an isolated local server.Visual
Screenshots / recordings
Setup and key-replacement screenshot gallery (fresh screenshots with sample data, including pending confirmation).
Checklist