-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(router): warn when a pinned provider discards a configured baseUrl #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
320cdb5
870202a
38b3396
d9e22f2
ab9f01c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,7 @@ network. Only do this on trusted networks, and always set a strong `OPENCODEX_AP | |
| | Field | Type | Meaning | | ||
| | --- | --- | --- | | ||
| | `adapter` | `string` | One of `openai-chat`, `openai-responses`, `anthropic`, `google`, `kiro`, `cursor`, `azure-openai` (or alias `azure`). | | ||
| | `baseUrl` | `string` | Upstream API base URL. | | ||
| | `baseUrl` | `string` | Upstream API base URL. Built-in providers with a fixed endpoint ignore it — see [Fixed provider endpoints](#fixed-provider-endpoints). | | ||
| | `responsesPath?` | `string` | Optional relative resource path for key-auth `openai-responses` requests. It must start with `/` and contain no URL scheme, query, or fragment. When omitted, the adapter keeps its legacy `/v1/responses` URL construction. | | ||
| | `disabled?` | `boolean` | Keep the provider on disk but exclude it from routing and model/catalog listings. | | ||
| | `apiKey?` | `string` | API key, or an `${ENV_VAR}` / `$ENV_VAR` reference resolved at request time. | | ||
|
|
@@ -193,6 +193,31 @@ network. Only do this on trusted networks, and always set a strong `OPENCODEX_AP | |
| | `unsafeAllowNativeLocalExec?` | `boolean` | **Cursor adapter only.** Legacy compatibility boolean for the Cursor server-driven local `read` / `write` / `delete` / `ls` / `grep` / `shell` / `fetch` executor. Equivalent to `nativeLocalExec: "on"` when `nativeLocalExec` is unset; an explicit `nativeLocalExec` value always wins. Defaults to `false`. Prefer `nativeLocalExec` for new configs. See [Cursor provider](#cursor-provider-adapter-cursor) below. | | ||
| | `nativeLocalExec?` | `"off" \| "codex-sandbox" \| "on"` | **Cursor adapter only.** Native local exec policy for the Cursor server-driven executor. `"off"` (default) rejects it; `"on"` is the trusted-local opt-in; `"codex-sandbox"` is accepted for backwards compatibility but is fail-closed like `"off"`. See [Cursor provider](#cursor-provider-adapter-cursor) below. | | ||
|
|
||
| ### Fixed provider endpoints | ||
|
|
||
| Routing resolves a provider's endpoint before any adapter sees it, and for most built-in | ||
| providers the registry's own endpoint wins over a `baseUrl` in your config. Three kinds of entry | ||
| keep the configured URL at this stage: | ||
|
|
||
| - providers that opt into an override — `ollama`, `vllm`, `lm-studio`, `litellm`, `qwen-cloud` | ||
| and `alibaba-token-plan-intl`; | ||
| - providers whose registry endpoint is a template you fill in, such as `azure-openai` and | ||
| `cloudflare-ai-gateway`; | ||
| - providers you define yourself, which are not in the registry at all. | ||
|
|
||
| Adapters may adjust the resolved URL afterward. The `kiro` adapter, for example, follows the API | ||
| region of the imported credential for a canonical `runtime.{region}.kiro.dev` host. See | ||
| [Adapters](/reference/adapters/) for per-adapter rules. | ||
|
|
||
| When routing discards a configured `baseUrl`, opencodex logs a warning. It names the registry | ||
| endpoint in full and your configured one by origin only, shown as `https://host/…` when it had a | ||
| path — a configured path can itself be a credential, so none of it is logged. Either drop the | ||
| `baseUrl` — the registry endpoint is what routing will use regardless — or switch to the provider | ||
| whose endpoint matches the URL you wanted. | ||
| Picking the right entry matters when a vendor runs one product in several regions: | ||
| `alibaba-token-plan` is pinned to Beijing while `alibaba-token-plan-intl` covers the | ||
| international endpoints, and a key issued for one is rejected by the other. | ||
|
|
||
|
Comment on lines
+196
to
+220
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
fd -t f -i 'configuration.md' docs-site/src/content/docs \
| rg '/(ja|ko|ru|zh-cn)/' \
| xargs -r rg -n 'Fixed provider endpoints|baseUrl|alibaba-token-plan|Credentials'Repository: lidge-jun/opencodex Length of output: 2782 🏁 Script executed: #!/bin/bash
set -euo pipefail
for f in \
docs-site/src/content/docs/ja/reference/configuration.md \
docs-site/src/content/docs/ko/reference/configuration.md \
docs-site/src/content/docs/ru/reference/configuration.md \
docs-site/src/content/docs/zh-cn/reference/configuration.md
do
echo "===== $f ====="
# show the section around the provider endpoint guidance if present
rg -n -C 8 'Fixed provider endpoints|固定|固定された|고정|поставляем|baseUrl|alibaba-token-plan|cloudflare-ai-gateway|ollama|vllm|lm-studio|litellm|qwen-cloud' "$f" || true
echo
doneRepository: lidge-jun/opencodex Length of output: 19921 Add the new fixed-endpoint guidance to the translated config docs. The 🤖 Prompt for AI AgentsSource: Path instructions |
||
| For broken `openai-responses` compatibility gateways, `responsesItemIdRepair` belongs on the | ||
| provider object itself, for example: | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.