Skip to content

fix(strix): route direct OpenAI fallback through its API base (replacement) - #1331

Merged
seonghobae merged 16 commits into
mainfrom
fix/strix-openai-fallback-api-base-v2
Aug 25, 2026
Merged

fix(strix): route direct OpenAI fallback through its API base (replacement)#1331
seonghobae merged 16 commits into
mainfrom
fix/strix-openai-fallback-api-base-v2

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Replacement for #1324

This replacement is rebased onto the current protected main and preserves the validated direct-OpenAI fallback repair.

Root cause

When NVIDIA NIM, OpenRouter, or GitHub Models exhausted their primary/fallback candidates, openai-direct/gpt-5.4 inherited the primary LLM_API_BASE (for example the NVIDIA NIM gateway) and failed with 404 page not found. The key was cross-provider, but the API base was not.

Change

  • Provision a runner-scoped https://api.openai.com/v1 fallback base beside the OpenAI fallback key, including the github_models primary path.
  • Route openai-direct/*/openai_direct/* through that explicit base; absent an override, resolve no base so LiteLLM uses the OpenAI default rather than a foreign provider endpoint.
  • Keep provider-specific bases for NVIDIA NIM and GitHub Models.
  • Preserve the current protected gpt-5.4 model contract, doctoring record, changelog, and regression tests.

Verification

  • 46 focused fallback/autofix/queue tests passed.
  • bash scripts/ci/strix_required_workflow_smoke.sh passed.
  • Ruff, Bash syntax, and git diff --check passed.

No secrets, force-push, or merge bypass. Hosted Checks and independent review must re-run on this exact head.


Open in Devin Review

Summary by CodeRabbit

  • 개선 사항

    • Strix의 OpenAI 직접 폴백이 기본 OpenAI 엔드포인트를 사용하도록 개선되었습니다.
    • 다른 제공자의 엔드포인트가 OpenAI 폴백에 잘못 재사용되지 않도록 라우팅이 조정되었습니다.
    • GitHub Models 환경에서도 폴백 인증 정보와 엔드포인트가 자동으로 구성됩니다.
    • HTTPS 검증 및 사용자 지정 엔드포인트 지원이 강화되었습니다.
  • 문서

    • OpenAI 폴백 라우팅 방식과 제한사항이 문서화되었습니다.
    • 관련 변경 사항이 변경 로그에 반영되었습니다.

seonghobae and others added 10 commits August 24, 2026 18:56
0c6b9a6 mapped the openai-direct prefix and routed the OpenAI key,
but the child scan still read LLM_API_BASE_FILE -- the primary
provider's endpoint. Observed on LineageWeave#570 (run 32701426812):
after both NVIDIA models 429'd, the openai-direct/gpt-5.6-luna
fallback reached integrate.api.nvidia.com with an unknown model path
and died in 4s with '404 page not found'.

When the candidate is explicit-openai and
STRIX_OPENAI_FALLBACK_API_BASE_FILE is configured, select that file as
the api-base source, exactly mirroring the existing GitHub Models
cross-provider routing. Key routing was already correct.
…oint contract

Adds a regression contract for the openai-direct fallback API-base fix:
override file routes to https://api.openai.com/v1, absence resolves no
override (litellm default endpoint) so explicit OpenAI models can never
inherit a foreign primary gateway, NVIDIA/GitHub Models primaries keep
their bases, and non-https overrides fail configuration. Also records the
doctoring evidence and CHANGELOG entry for the routing fix.
….4 contract

The model rename in a724582 missed two test expectations that still
asserted the nonexistent gpt-5.6-luna default and fallback names; align
them with the shipped gpt-5.4 contract so required CI passes.
…dispatch chain

The a724582 rename updated strix.yml and the smoke contract but left the
opencode-review-dispatch workflow, its agent-contract tests, the
failed-check fallback-findings marker, and the pinned review-dispatch
blob SHAs asserting the retired model name, so required CI failed with
three missing-string markers. Align every remaining reference with the
shipped gpt-5.4 direct-OpenAI contract and refresh the paired blob SHAs.
…rimary; dedupe CHANGELOG

- CodeRabbit major: the github_models primary's STRIX_FALLBACK_MODELS chain
  ends in openai-direct/gpt-5.4, but 'Prepare GitHub Models fallback
  credentials' excluded the github_models mode, so that fallback could not
  authenticate or route after primary exhaustion. Include github_models in
  the provisioning step.
- Devin bug: remove the four accidentally duplicated [Unreleased] bullets
  from CHANGELOG.md, keeping a single copy before '### Added'.
- Add markdownlint MD040 language to the doctoring evidence fence.
…me Luna comment

- Devin bug: the CHANGELOG dedup accidentally removed the four legitimate
  [Unreleased] bullets entirely; restore them once alongside the two Strix
  entries so pending history is not dropped.
- Devin bug: the OPENCODE_MODEL_CANDIDATES rationale comment still named
  the retired 'GPT-5.6 Luna' slot with stale pricing; rewrite it for the
  valid gpt-5.4 direct-OpenAI contract.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 5 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27065cc8-a2e4-49d5-8a63-a2f512bed8bb

📥 Commits

Reviewing files that changed from the base of the PR and between 3c7f430 and 40955ba.

📒 Files selected for processing (5)
  • .github/workflows/strix.yml
  • CHANGELOG.md
  • docs/doctoring/strix-openai-fallback-api-base-routing.md
  • scripts/ci/strix_quick_gate.sh
  • tests/test_strix_openai_fallback_api_base.py
📝 Walkthrough

Walkthrough

Strix의 openai-direct/gpt-5.4 fallback이 전용 OpenAI API base를 사용하도록 라우팅 해석기와 workflow 전달 경로를 변경했습니다. 회귀 테스트, workflow 계약 검증, 문서와 변경 기록을 갱신했습니다.

Changes

OpenAI fallback 라우팅

Layer / File(s) Summary
Fallback API base 해석 및 회귀 검증
scripts/ci/strix_quick_gate.sh, tests/test_strix_openai_fallback_api_base.py
명시적 OpenAI fallback은 STRIX_OPENAI_FALLBACK_API_BASE_FILE을 우선 사용합니다. 해당 설정이 없으면 기존 LLM_API_BASE_FILE을 사용합니다. 두 설정이 없으면 기본 OpenAI endpoint를 사용합니다. HTTPS 검증과 provider별 base 유지 동작을 테스트합니다.
Workflow wiring 및 계약 문서
.github/workflows/strix.yml, .github/workflows/opencode-review-dispatch.yml, scripts/ci/test_strix_quick_gate.sh, docs/doctoring/*, CHANGELOG.md, tests/test_pr_review_autofix_nvidia_nim_contract.py
Strix workflow가 https://api.openai.com/v1을 fallback API base 파일에 기록하고 게이트 환경에 전달합니다. GitHub Models fallback credential 준비 조건을 확장했습니다. 관련 문서, assertion, workflow blob hash와 모델 계약 기록을 갱신했습니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 3c7f4

The PR correctly routes direct OpenAI fallbacks to the intended API base and preserves provider-specific routing; only a localized documentation clarification remains, with no actionable merge-blocking risk.

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as strix.yml workflow
  participant Gate as strix_quick_gate.sh
  participant Resolver as resolved_llm_api_base_for_model
  participant OpenAI as OpenAI API endpoint
  Workflow->>Workflow: OpenAI fallback API base 파일 생성
  Workflow->>Gate: STRIX_OPENAI_FALLBACK_API_BASE_FILE 전달
  Gate->>Resolver: openai-direct/gpt-5.4 해석 요청
  Resolver->>OpenAI: 전용 OpenAI endpoint 선택
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 direct OpenAI fallback을 해당 API base로 라우팅하는 핵심 변경을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (5 skipped: 4 unsupported, 1 too large.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/strix-openai-fallback-api-base-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Addressed Devin\x27s informational review on exact head 3c7f430 (full 3c7f430...). Standalone runs now honor a caller-supplied LLM_API_BASE_FILE for explicit OpenAI-compatible endpoints; no base still uses native OpenAI defaults, while the workflow-provisioned STRIX_OPENAI_FALLBACK_API_BASE_FILE remains authoritative for cross-provider fallbacks. Added regression coverage (8 focused tests), Ruff, shell syntax, trusted Strix smoke, and diff checks pass. Re-review and hosted Checks are required for this new head.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Fixed both exact-head review findings on 0547c6b (full 0547c6b...): direct-OpenAI fallbacks no longer inherit a GitHub Models base when the OpenAI override/key is absent, while standalone custom LLM_API_BASE_FILE remains supported; doctoring and CHANGELOG now match. Added regression coverage (9 focused tests); Ruff, shell syntax, trusted Strix smoke, and diff checks pass. Re-review and hosted Checks are required for this new head.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Resolved the remaining exact-head review note on 4fc261ff03f28b4ab8b44ef6d9f14cdb138eb3ef: known GitHub Models, NVIDIA NIM, and OpenRouter API bases are rejected for direct-OpenAI fallbacks without the paired override, while arbitrary caller-owned OpenAI-compatible endpoints remain supported. Added 10 focused tests; Ruff, shell syntax, trusted smoke, and diff checks pass. Hosted Checks and independent approval remain required.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact-head review follow-up for 4fc261ff03f28b4ab8b44ef6d9f14cdb138eb3ef: the current documentation distinguishes absent STRIX_OPENAI_FALLBACK_API_BASE_FILE from a caller-owned LLM_API_BASE_FILE; standalone custom endpoints remain valid, while known foreign provider bases are rejected for direct-OpenAI fallback. Focused fallback tests, Ruff, shell syntax, trusted Strix smoke, and diff checks pass locally. No unresolved non-outdated review threads remain; hosted checks and independent approval remain authoritative.

@seonghobae
seonghobae enabled auto-merge (squash) August 25, 2026 14:26
@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head verification

  • Exact head SHA: 91b08f4cca5ccaaa164eee12438fb19239c2bc65
  • Exact base SHA: 95b05b393c75931044b405ae491079d336d89293
  • Root-cause fix: explicit openai-direct/* fallbacks now use a trusted OpenAI API-base file instead of inheriting the NVIDIA NIM/GitHub Models/OpenRouter primary endpoint; known foreign bases fail closed when no override exists.
  • The remote agent's current-head merge of main was respected. Exact-head local verification passed: 124 passed focused Strix/OpenCode tests and git diff --check.
  • Hosted required Checks are newly materialized and not yet terminal; predecessor evidence is discarded. Protected auto-merge remains enabled, with no bypass or self-approval.

@seonghobae

seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head maintenance audit

  • Exact head: 91b08f4cca5ccaaa164eee12438fb19239c2bc65
  • Exact base: 95b05b393c75931044b405ae491079d336d89293
  • Local focused verification: 124 passed; merge-conflict and diff checks passed.
  • Current hosted evidence is bound to this exact head; queued checks and absent approval remain normal protected-gate states.
  • The PR remains on protected squash auto-merge; no bypass, fake status, or approval was used.

The exact-head OpenCode review dispatch was requested.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread .github/workflows/strix.yml
@opencode-agent
opencode-agent Bot disabled auto-merge August 25, 2026 20:40
@seonghobae
seonghobae enabled auto-merge (squash) August 25, 2026 20:43
@opencode-agent
opencode-agent Bot disabled auto-merge August 25, 2026 20:51
@seonghobae
seonghobae enabled auto-merge (squash) August 25, 2026 21:21
@opencode-agent
opencode-agent Bot disabled auto-merge August 25, 2026 21:21
@seonghobae
seonghobae merged commit 33dc57d into main Aug 25, 2026
64 of 67 checks passed
@seonghobae
seonghobae deleted the fix/strix-openai-fallback-api-base-v2 branch August 25, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant