Skip to content

fix: provider-aware model routing for claude-code harness#13

Merged
AbirAbbas merged 1 commit into
mainfrom
fix/claude-code-railway-runtime
Mar 13, 2026
Merged

fix: provider-aware model routing for claude-code harness#13
AbirAbbas merged 1 commit into
mainfrom
fix/claude-code-railway-runtime

Conversation

@AbirAbbas
Copy link
Copy Markdown
Contributor

Summary

  • Model tier resolution (budget/mid/premium) was hardcoded to OpenRouter model IDs (e.g. openrouter/google/gemini-2.5-flash), which Claude Code doesn't understand
  • When PR_AF_PROVIDER=claude-code, tiers now resolve to Claude's normalized identifiers: budget → haiku, mid → sonnet, premium → opus
  • OpenCode flow is completely unchanged

Changes Made

  • config.py: _default_tier_map() now accepts a provider parameter with provider-specific defaults
  • config.py: ModelConfig.resolve() and ReviewConfig.from_input() pass provider through
  • app.py: Passes _ai_config.provider to ReviewConfig.from_input()

Test Plan

  • Set PR_AF_PROVIDER=opencode, run a review — models should resolve to OpenRouter IDs (no regression)
  • Set PR_AF_PROVIDER=claude-code + ANTHROPIC_API_KEY, run a review — models should resolve to haiku/sonnet/opus
  • Verify Claude Code review produces actual findings (not zero)

🤖 Generated with Claude Code

Model tier resolution (budget/mid/premium) was hardcoded to OpenRouter
model IDs, which Claude Code doesn't understand. When PR_AF_PROVIDER is
claude-code, tiers now resolve to Claude's normalized identifiers
(haiku/sonnet/opus) instead of OpenRouter paths.

Co-Authored-By: Claude <noreply@anthropic.com>
@AbirAbbas AbirAbbas merged commit 3376a23 into main Mar 13, 2026
2 checks passed
@AbirAbbas AbirAbbas deleted the fix/claude-code-railway-runtime branch March 13, 2026 22:44
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