Repository navigation
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @kenrogers on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
I'm starting a first review of this spec-only pull request. You can view the conversation on Warp. I completed the review and posted feedback on this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds product and tech specs for a generic OpenAI-compatible BYOK endpoint flow, including Settings > AI configuration, synthetic model picker entries, and request-time endpoint metadata.
Concerns
- The specs promise local OpenAI-compatible servers while preserving the current backend-routed BYOK architecture, which makes localhost/private endpoints ambiguous or unreachable.
- Backend routing to arbitrary user-provided URLs needs explicit SSRF/egress controls, redirect/DNS rebinding handling, timeouts, and secret redaction rules.
- The tech spec is ambiguous about clearing stored endpoint config when BYOK becomes disabled, which conflicts with the product spec's non-destructive gating behavior.
- The backend request contract remains unresolved enough to block implementation handoff.
Verdict
Found: 2 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| ## Summary | ||
|
|
||
| Users should be able to configure a custom OpenAI-compatible model endpoint for Warp Agent by entering a provider label, base URL, API key, and model ID. This gives users a narrow, predictable way to use OpenRouter, LiteLLM, internal OpenAI-compatible gateways, and local OpenAI-compatible servers without requiring Warp to add a bespoke provider integration for each one. |
There was a problem hiding this comment.
🚨 [CRITICAL] This promises local OpenAI-compatible servers, but the tech flow sends endpoint metadata to Warp's backend; localhost would resolve from the backend, not the user's machine. Specify client-side/local routing for local endpoints or remove local servers from the first-version scope.
|
|
||
| Validation: | ||
|
|
||
| - Parse base URL with `url::Url`. |
There was a problem hiding this comment.
🚨 [CRITICAL] Syntax-only URL validation is not enough for a backend-routed arbitrary endpoint. The spec needs server-side egress rules for private/link-local/metadata IPs, redirects, DNS rebinding, timeouts, and redaction of the URL/API key from logs before implementation.
|
|
||
| - On blur or Enter, persist the full config via `ApiKeyManager`. | ||
| - Empty base URL, API key, or model ID keeps the config incomplete. | ||
| - If BYOK is disabled for the workspace, clear/disable the endpoint editors using the same `UserWorkspacesEvent::TeamsChanged` handling as the fixed provider key fields. |
There was a problem hiding this comment.
clear/disable conflicts with the product spec's non-destructive gating. Specify that BYOK-disabled workspaces preserve the stored custom endpoint but disable editing/selection unless the user explicitly deletes it.
| ## Open questions | ||
|
|
||
| 1. Should the first implementation support exactly one custom endpoint, or should the persistence shape support a list immediately while the UI initially exposes one? | ||
| 2. Should custom endpoint metadata live in the existing `api_keys` request payload or a distinct `custom_model_endpoint` request field? |
There was a problem hiding this comment.
ApiKeys, including versioning/backward compatibility with the backend.
|
/oz-review |
|
I'm re-reviewing this spec-only pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds product and technical specs for a generic OpenAI-compatible BYOK endpoint flow. The specs cover the main UX, request-routing shape, validation expectations, testing plan, and several backend SSRF mitigations.
Concerns
- The spec leaves arbitrary custom endpoint use governed only by the existing BYOK gate, without defining whether enterprise/workspace admins can disable or restrict user-supplied endpoint domains even though agent context can leave Warp for an arbitrary third party.
- Custom model identity is not specified firmly enough; treating a stable prefix or marker as optional can collide with server-provided model IDs and make routing/selection ambiguous.
- Execution profile behavior is underspecified when the custom endpoint is edited, made incomplete, or deleted after selection.
Security
- Arbitrary endpoint egress expands the data-exfiltration trust boundary beyond fixed BYOK providers; the spec should define the admin policy/control surface before implementation.
- The request payload carries a user API key to the backend; the spec should explicitly state request-scoped handling and no server-side persistence.
Verdict
Found: 0 critical, 3 important, 1 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| 3. Supporting `localhost`, private-network, link-local, or otherwise client-local model endpoints in the first version. Those require a separate client-side/local routing design because backend-routed requests cannot reach the user's machine as `localhost`. | ||
| 4. Supporting non-OpenAI-compatible protocols in this feature. | ||
| 5. Guaranteeing every model behind a compatible endpoint supports all Warp Agent tools. | ||
| 6. Changing the paid plan or workspace policy that gates BYOK access. |
There was a problem hiding this comment.
| 4. Base URL validation is lightweight and user-facing in the client: the value must parse as an absolute `https` URL and must not use obvious local/private hosts such as `localhost` or loopback IPs. Warp does not perform a network validation request when the user saves the setting; the backend performs the authoritative egress validation before routing any request. | ||
| 5. API key input uses the same password-style treatment as existing BYOK provider key fields. | ||
| 6. The saved custom model appears in the existing model picker using the configured label and model ID. A key icon or equivalent BYOK affordance should make clear that it is billed to the user's endpoint credentials. | ||
| 7. Selecting the custom model persists through the same execution profile mechanism as other model choices. |
There was a problem hiding this comment.
|
|
||
| Recommended shape: | ||
|
|
||
| - `id`: the configured model ID, preferably with a stable custom prefix if the backend needs to distinguish custom endpoint models from server-known models. |
There was a problem hiding this comment.
|
|
||
| The selected model ID alone is not enough; the request layer must also know base URL and API key. Use a distinct request settings field instead of overloading fixed provider API keys. | ||
|
|
||
| Add an optional `custom_model_endpoint` payload to the agent request settings: |
There was a problem hiding this comment.
💡 [SUGGESTION] [SECURITY] Add request-scoped secret handling for this payload: the backend should not persist the custom API key, and deletion or rotation should be driven only by the local secure-storage config.
Description
Adds a draft product spec and tech spec for issue #4687: a generic OpenAI-compatible BYOK endpoint flow.
The spec frames OpenRouter as the proof case, but keeps the proposed implementation generic: provider label, base URL, API key, and model ID. That avoids a one-off provider button while still making OpenRouter, LiteLLM/internal proxies, and local OpenAI-compatible gateways possible through the same surface.
It also calls out how this relates to #9253: OpenRouter-specific BYOK is useful partial progress, but the broader issue still needs custom endpoint/model metadata instead of relying only on server-approved model choices.
Linked Issue
Fixes #4687 after approval and implementation.
ready-to-specorready-to-implement.Note: #4687 is currently
enhancement/triagedbut notready-to-spec. I am opening this as a draft spec PR to give maintainers a concrete scope to accept, edit, or reject before any code implementation.Screenshots / Videos
Not applicable; spec-only PR.
Testing
git diff --cached --checkgit show --check --stat --oneline HEADNo runtime tests were run because this PR only adds Markdown specs and does not change application code.