Skip to content

fix(coder): replace claude-family phase default with the provider's own model#337

Merged
OBenner merged 1 commit into
developfrom
fix/coder-provider-model-coherence
Jun 13, 2026
Merged

fix(coder): replace claude-family phase default with the provider's own model#337
OBenner merged 1 commit into
developfrom
fix/coder-provider-model-coherence

Conversation

@OBenner

@OBenner OBenner commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Находка живой сборки №7

Run 7 (после мержа #333/#335): AGENT_PROVIDER_CODER=openai, модель нигде явно не задана → phase_model остаётся Claude-дефолтом фазы (claude-sonnet-4-5-20250929) и уезжает в OpenAI-сессию → 404 model_not_found на первом же комплишене. Раньше это маскировал smart-роутер (он подменял модель своей) — но с #335 при явном пине провайдера роутер корректно отступает, и Claude-центричный дефолт протекает напрямую.

Фикс

После резолва провайдера/рантайма (и только когда модель никто не пинил: ни --model, ни smart route, ни runner route, ни task_metadata) claude-family phase_model, направляющийся в не-Claude провайдера, заменяется моделью самого провайдера (AGENT_MODEL_<TYPE> / <PROVIDER>_MODEL / дефолт), с info-строкой о подмене.

Явная (пусть и противоречивая) конфигурация «--model claude-x + provider=openai» тоже разрешается в пользу модели провайдера — с видимой пометкой в логе.

Tests: 241 passed (runtime-сьюта), ruff clean. Пятый фикс серии живой сборки (#332#336 → этот).

🤖 Generated with Claude Code

…wn model

Live-build finding (2026-06-12, run 7): with AGENT_PROVIDER_CODER=openai
and no explicit model anywhere, the coder session was created with the
phase-model DEFAULT — which phase_config resolves to a claude-* id — and
the OpenAI provider 404'd on claude-sonnet-4-5-20250929. The smart
router used to mask this by replacing the model on its own; once an
explicit provider pin makes the router stand down (#335), the
claude-centric default leaks straight into the direct provider session.

After provider/runtime resolution (and only when nothing pinned a model:
no --model, no smart route, no runner route, no task_metadata phase
model), a claude-family phase model headed to a non-Claude provider is
now replaced with that provider's configured model
(AGENT_MODEL_<TYPE> / <PROVIDER>_MODEL / provider default), with an info
line stating the substitution.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Oleg Miagkov <mrobenner@gmail.com>
@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 41 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: a679e061-a2a3-425d-b223-ce16ebae9ed5

📥 Commits

Reviewing files that changed from the base of the PR and between fd96b5c and ea20928.

📒 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-provider-model-coherence

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.

@github-actions github-actions Bot added area/backend bug Something isn't working size/S labels Jun 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@OBenner OBenner merged commit 83c5f49 into develop Jun 13, 2026
20 checks passed
OBenner added a commit that referenced this pull request Jun 13, 2026
Live-build finding (2026-06-13, spec 901): with QA roles routed to a
direct provider (qa_reviewer/qa_fixer on openai via the promotion gate,
now that #317 dropped the opt-in), the QA runtime session was built with
the QA phase-model DEFAULT — which phase_config resolves to a claude-*
id — and OpenAI 404'd on claude-sonnet-4-5-20250929. This is the QA-path
analog of the coder fix in #337: once routing correctly sends QA to the
direct provider, the Claude-centric phase default leaks straight into
the session.

New ProviderConfig.coherent_session_model() returns the provider's own
configured model when the requested model is a Claude-family id and the
provider is non-Claude; otherwise it passes the request through
unchanged. Both QA runtime shims (run_qa_reviewer_runtime_session,
_build_qa_fixer_runtime_session) now route their model through it before
create_session. The qa_fixer recovery loop already uses
get_fallback_model() (#316 parity), so once the initial model is the
provider's, the fallback chain (gpt-5.2 -> gpt-5 -> ...) stays coherent.

Tests: 5 helper cases (claude->provider, explicit preserved, None,
claude-provider unchanged, no-configured-model keeps request) + existing
QA runtime / factory suites. 85 passed.

Signed-off-by: Oleg Miagkov <mrobenner@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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