-
Notifications
You must be signed in to change notification settings - Fork 0
fix(strix): route direct OpenAI fallback through its API base (replacement) #1331
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5ecbebb
fix(strix): route openai-direct fallback to the OpenAI API base
seonghobae 84eb379
fix(strix): wire direct OpenAI fallback endpoint
seonghobae 689212b
test(strix): pin direct-OpenAI fallback base routing and default-endp…
seonghobae 859ab5a
Merge branch 'main' into fix/strix-openai-fallback-api-base
seonghobae 7c596f3
test(strix): align remaining gpt-5.6-luna expectations with the gpt-5…
seonghobae 2d98237
fix(opencode-review): complete gpt-5.6-luna to gpt-5.4 rename across …
seonghobae 9288031
fix(strix): provision OpenAI fallback credentials for github_models p…
seonghobae 91c79dc
fix(opencode-review): restore deduplicated changelog entries and rena…
seonghobae c5f1c74
test: repin review workflow contract to exact blob
seonghobae 26f96e2
fix(strix): route direct OpenAI fallback through its API base
seonghobae 3c7f430
fix(strix): preserve standalone custom OpenAI bases
seonghobae 0547c6b
fix(strix): reject foreign GitHub Models fallback bases
seonghobae 4fc261f
fix(strix): reject known foreign fallback bases
seonghobae 91b08f4
Merge branch 'main' into fix/strix-openai-fallback-api-base-v2
opencode-agent[bot] a1408f5
Merge branch 'main' into fix/strix-openai-fallback-api-base-v2
opencode-agent[bot] 40955ba
Merge main into Strix fallback API-base fix
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Strix direct-OpenAI fallback API-base routing: evidence and design record | ||
|
|
||
| ## Decision | ||
|
|
||
| A Strix cross-provider fallback to an explicit direct-OpenAI model | ||
| (`openai-direct/...` or `openai_direct/...`) must route through the OpenAI | ||
| inference endpoint, never through the primary provider's `LLM_API_BASE`. The | ||
| gate now prefers an explicit `STRIX_OPENAI_FALLBACK_API_BASE_FILE` for such | ||
| models. In standalone runs, a caller-supplied `LLM_API_BASE_FILE` remains in | ||
| force for an OpenAI-compatible endpoint; known GitHub Models, NVIDIA NIM, and | ||
| OpenRouter primary endpoints are not inherited. Litellm uses its default | ||
| `https://api.openai.com/v1` endpoint only when no base file is supplied (or | ||
| when that provider-specific base is rejected). | ||
|
|
||
| The central workflow writes `https://api.openai.com/v1` into | ||
| `$RUNNER_TEMP/openai_fallback_api_base.txt` and exports | ||
| `STRIX_OPENAI_FALLBACK_API_BASE_FILE` whenever it publishes the OpenAI | ||
| fallback key file, so every provider chain that ends in | ||
| `openai-direct/gpt-5.4` (NVIDIA NIM primary, OpenRouter primary, | ||
| GitHub Models primary) inherits correct routing automatically. | ||
|
|
||
| ## Failure this fixes | ||
|
|
||
| Required-CI evidence (BandScope PR #1021 strix run 32800796577, 2026-08-25) | ||
| showed the NVIDIA NIM primary and first fallback exhausting provider | ||
| availability, then the contracted final fallback `openai-direct/gpt-5.4` | ||
| failing with a plain-text gateway error: | ||
|
|
||
| ```text | ||
| LLM CONNECTION FAILED | ||
| Could not establish connection to the language model. | ||
| Error: 404 page not found | ||
| ``` | ||
|
|
||
| Root cause: with `provider_mode=nvidia_nim`, the workflow sets | ||
| `LLM_API_BASE_FILE=https://integrate.api.nvidia.com/v1`. The gate reused that | ||
| base for the openai-direct fallback child, so litellm sent OpenAI requests to | ||
| the NVIDIA NIM edge, whose Go gateway answered `404 page not found`. The | ||
| fallback key was already routed correctly (`STRIX_OPENAI_FALLBACK_KEY_FILE`); | ||
| only the base URL leaked from the primary provider. Because no vulnerability | ||
| report artifact was produced, the gate failed closed — correct policy on an | ||
| incomplete scan, but caused by routing rather than by any repository finding. | ||
|
|
||
| ## Trust boundary | ||
|
|
||
| The override is a runner-provisioned regular file under `$RUNNER_TEMP`, | ||
| resolved through the same `resolve_trusted_input_file` boundary as the other | ||
| API-base files: it must be a regular non-symlink file inside the trusted input | ||
| root, must trim to a single `https://` URL, and must not contain whitespace or | ||
| control characters. Absent or empty overrides preserve a caller-supplied | ||
| `LLM_API_BASE_FILE` for standalone local gate runs; when both files are absent, | ||
| litellm selects its default endpoint. Known GitHub Models, NVIDIA NIM, and | ||
| OpenRouter bases are explicitly rejected for a direct OpenAI model so a | ||
| missing OpenAI key remains a provider-unavailable outcome instead of a | ||
| configuration error. | ||
|
|
||
| ## Verification contract | ||
|
|
||
| Regression evidence proves that: | ||
|
|
||
| 1. with a NVIDIA NIM primary base configured, `openai-direct/gpt-5.4` | ||
| resolves through the explicit OpenAI fallback base when provided; | ||
| 2. without either base file, the resolver returns no base so litellm defaults | ||
| to `https://api.openai.com/v1`; | ||
| 3. a standalone caller-supplied custom `LLM_API_BASE_FILE` remains effective; | ||
| 4. known GitHub Models, NVIDIA NIM, and OpenRouter primary bases are not | ||
| inherited by a direct-OpenAI fallback; | ||
| 5. NVIDIA NIM primary attempts keep resolving through the NIM edge; | ||
| 6. `github_models/*` fallbacks keep their dedicated GitHub Models endpoint; | ||
| 7. a non-https override fails configuration (exit 2) instead of scanning; | ||
| 8. the workflow provisions the override file and passes it into the gate env; | ||
| 9. the required-workflow smoke contract pins both sides of the wiring; and | ||
| 10. the stale `gpt-5.6-luna` expectations left behind by the model rename are | ||
| aligned with the valid `gpt-5.4` contract in queue-contract tests. | ||
|
|
||
| ## Limitations | ||
|
|
||
| This change restores reachability of the final fallback; it does not create | ||
| OpenAI quota. If the OpenAI key is absent or exhausted after NIM exhaustion, | ||
| the gate still fails closed as provider-unavailable — by design, because no | ||
| complete authoritative scan exists. Hosted model catalogs may also change | ||
| independently of this repository; model-name updates remain manual contract | ||
| changes reviewed through CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.