fix(strix): route direct-OpenAI fallback models to the OpenAI platform endpoint - #1295
fix(strix): route direct-OpenAI fallback models to the OpenAI platform endpoint#1295seonghobae wants to merge 10 commits into
Conversation
|
Warning Review limit reachedNext included review available in 30 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough직접 OpenAI 폴백은 주 모델 제공자에 따라 OpenAI 엔드포인트와 전용 키를 선택합니다. 전용 키가 없으면 동일 제공자의 주 키를 재사용하거나 폴백을 건너뜁니다. 제공자 구성 오류가 발생하면 다음 폴백을 시도합니다. Changes직접 OpenAI 폴백 처리
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🔵 Low · up to The PR changes direct-OpenAI fallback routing, but its test scenario does not provide the fallback credential or verify that the inherited NVIDIA endpoint is removed, so a routing regression could pass validation. The change is mergeable with explicit owner follow-up to add those success-path assertions. Sequence Diagram(s)sequenceDiagram
participant PrimaryProvider
participant StrixQuickGate
participant OpenAIFallback
participant NextFallback
PrimaryProvider->>StrixQuickGate: quota 또는 실행 오류
StrixQuickGate->>OpenAIFallback: 직접 OpenAI 폴백 구성 및 키 확인
OpenAIFallback-->>StrixQuickGate: 제공자 구성 오류
StrixQuickGate->>NextFallback: 다음 폴백 모델 시도
NextFallback-->>StrixQuickGate: 실행 결과 반환
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Fixed the exact-head finding on new head Added an integration regression scenario proving the NVIDIA-NIM rate-limit path performs one primary call, never invokes direct OpenAI without its credential, and fails closed. Local filtered scenario exited 0; |
…m endpoint resolved_llm_api_base_for_model() inherited the primary provider's LLM_API_BASE_FILE for every non-Vertex model. When NVIDIA NIM rate-limited (HTTP 429) and the chain fell back to openai-direct/gpt-5.6-luna, the gate sent an OpenAI model and key to https://integrate.api.nvidia.com/v1, which answered '404 page not found' and failed the whole scan closed. Explicit direct-OpenAI models (openai_direct/* and openai-direct/*) now resolve to no custom API base, so litellm uses the OpenAI platform endpoint with STRIX_OPENAI_FALLBACK_KEY. GitHub Models base guards are unchanged.
2485eac to
3d18db7
Compare
Exact-head validation update
Please perform a new independent substantive review of the complete exact-head diff above. |
Current-head review loop
Please rerun the exact-head required Checks and current-head review. No merge is requested until the hosted gates and eligible approval are present. |
Current-head validation
The Devin notes are informational: PR-mode fail-closed classification intentionally returns the PR failure code before the later non-PR configuration-only exit-code branch; the new counter and fallback continuation are covered. Please refresh substantive review and approval for this exact head. Hosted required checks remain pending, so this stays on the protected normal path. |
|
Exact current head Targeted evidence:
The motivating DiskSage PR #246 Strix failure was provider infrastructure evidence failure: NVIDIA NIM and direct OpenAI fallback both returned 404/no report, so the gate correctly failed closed. This PR’s dedicated direct-OpenAI routing and fallback configuration tests cover that path. No secrets or provider calls were made locally. |
|
Exact pushed head is now Added synchronized control-plane evidence:
Verification on this exact worktree:
PR remains open and blocked pending new-head hosted Checks and independent protected approvals. |
Summary
resolved_llm_api_base_for_model()inherited the primary provider'sLLM_API_BASE_FILEfor every non-Vertex model. Observed failure chain on every org PR scanned today (e.g., bandscope PR #968 strix job 97343250198):nvidia_nim/nvidia/nemotron-3-super-120b-a12b→ HTTP 429 (thundering herd: ~123 open PRs each triggering required Strix scans).nvidia_nim/nvidia/llama-3.3-nemotron-super-49b-v1.5→ same 429 (same quota pool).openai-direct/gpt-5.6-luna→ gate mapped model toopenai/gpt-5.6-lunawith the OpenAI key but keptLLM_API_BASE=https://integrate.api.nvidia.com/v1→ NVIDIA answered404 page not found.Fix
Explicit direct-OpenAI models (
openai_direct/*,openai-direct/*) now resolve to no custom API base so litellm uses the OpenAI platform endpoint withSTRIX_OPENAI_FALLBACK_KEY. Vertex and GitHub Models routing/guards unchanged.Verification
pytest tests/test_strix_backend_unavailable_after_exempted_finding.py tests/test_strix_model_behavior_error.py tests/test_strix_nvidia_nim_not_found_fallback.py: 28 passed.LLM_API_BASE_FILE=https://integrate.api.nvidia.com/v1,resolved_llm_api_base_for_model 'openai-direct/gpt-5.6-luna'now returns empty base (OpenAI default) while NIM primaries keep the NIM base.Security Notes
Summary by CodeRabbit