Skip to content

fix(coder): provider-aware model fallback in subtask recovery - #334

Merged
OBenner merged 1 commit into
developfrom
fix/coder-model-fallback
Jun 12, 2026
Merged

fix(coder): provider-aware model fallback in subtask recovery#334
OBenner merged 1 commit into
developfrom
fix/coder-model-fallback

Conversation

@OBenner

@OBenner OBenner commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Находка живой сборки №6 (фатальная для direct-провайдеров)

Recovery после падения gpt-5.2-сессии рекомендовал model fallback, а inline-блок в agents/coder.py угадывал Claude-шортхенд по имени модели с дефолтом "sonnet" для любого не-Claude id → чейн дал haikuresolve_model_id() развернул в claude-haiku-4-5-20251001 → ретрай отправил Claude-модель в OpenAI-провайдера → 404 model_not_found → сборка умерла.

Фикс

Заменён на существующий provider-aware core.model_fallback.get_fallback_model() (его же использует qa_fixer с #316): gpt-5.2 → gpt-5, claude-sonnet-4-5 → claude-haiku-4-5, gemini-2.5-flash → gemini-2.0-flash. Падение в том же провайдере, как и задумано чейном.

Проверено: resolve_model_id("gpt-5") — passthrough; 240 passed (agent_runtime), ruff clean.

🤖 Generated with Claude Code

Live-build finding (2026-06-12): when a gpt-5.2 coder session failed and
the recovery manager recommended model fallback, the inline fallback
block guessed a Claude shorthand from the model name and defaulted
ANY non-Claude model to "sonnet". The chain then yielded "haiku",
resolve_model_id() expanded it to claude-haiku-4-5-20251001, and the
retry sent a Claude model id to the OpenAI provider — 404
model_not_found, fatal for the whole build.

Use core.model_fallback.get_fallback_model() instead: it looks up the
ACTUAL current model and returns its same-provider fallback
(gpt-5.2 -> gpt-5, claude-sonnet-4-5 -> claude-haiku-4-5,
gemini-2.5-flash -> gemini-2.0-flash). This is the same helper the QA
fixer already uses for its retry parity (#316), so coder recovery now
matches that behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Oleg Miagkov <mrobenner@gmail.com>
@github-actions github-actions Bot added area/backend bug Something isn't working size/S labels Jun 12, 2026
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@OBenner, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 46 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 08dfb182-3d8a-43df-adfe-c3449e32f2b9

📥 Commits

Reviewing files that changed from the base of the PR and between f960903 and 94b1caa.

📒 Files selected for processing (1)
  • apps/backend/agents/coder.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/coder-model-fallback

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 and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@OBenner
OBenner merged commit e339adb into develop Jun 12, 2026
20 checks passed
@OBenner
OBenner deleted the fix/coder-model-fallback branch June 12, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend bug Something isn't working size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant