Skip to content

feat(agents): add Claude model tier configuration (haiku/sonnet/opus)#134

Merged
vadimvlasenko merged 2 commits intomainfrom
feat/claude-model-tiers
Feb 12, 2026
Merged

feat(agents): add Claude model tier configuration (haiku/sonnet/opus)#134
vadimvlasenko merged 2 commits intomainfrom
feat/claude-model-tiers

Conversation

@vadimvlasenko
Copy link
Collaborator

@vadimvlasenko vadimvlasenko commented Feb 9, 2026

Summary

Changed Claude model tier configuration from manual prompts to automatic selection during setup. Intelligently selects the latest haiku/opus models and uses the user's chosen model for sonnet.

Logic

Priority 1: Environment Variables

  • If ANTHROPIC_DEFAULT_*_MODEL env vars are set, use those
  • Allows manual override when needed

Priority 2: Automatic Selection

  • Haiku: Latest haiku model (version-based comparison)
  • Sonnet: User's selected model during setup
  • Opus: Latest opus model (version-based comparison)

Version Comparison

  • Supports multiple formats: claude-opus-4-6-20260205, claude-haiku-4.5, claude-4-5-sonnet
  • Normalizes dots to dashes, compares segment-by-segment
  • Fallback to string comparison if version parsing fails
  • Future-proof: handles Claude 5.0, 6.0+ without code changes

Benefits

  • ✅ Zero configuration for most users
  • ✅ Always selects latest models automatically
  • ✅ Environment variable override still works
  • ✅ Handles new Claude versions without updates
  • ✅ Robust format support (dashes, dots, mixed)

Changes

  • Removed manual tier configuration prompt
  • Added autoSelectModelTiers() with intelligent version parsing
  • Added parseModelVersion() and compareModelVersions() helpers
  • 31 test cases covering all version formats and edge cases

Impact

  • New profiles: automatic tier selection (no user action needed)
  • Existing profiles: unchanged (no migration needed)
  • Breaking changes: none

vadimvlasenko and others added 2 commits February 9, 2026 17:52
Add support for configuring separate models for each Claude tier
(haiku, sonnet, opus) in CodeMie profiles. This allows users to map
CodeMie model names to actual Anthropic model IDs per tier.

- Add haikuModel, sonnetModel, opusModel fields to ProviderProfile
- Extend envMapping to support ANTHROPIC_DEFAULT_*_MODEL env vars
- Auto-map CLAUDE_CODE_SUBAGENT_MODEL to sonnet model
- Add optional model tier prompts in setup wizard (Claude providers only)
- Pass model tiers through Bedrock provider hook

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Enhanced the automatic Claude model tier selection to handle various
model naming formats and provide robust fallback mechanisms.

Changes:
- Add support for dot-separated versions (claude-haiku-4.5)
- Add support for mixed formats (claude-4.5-sonnet-v2)
- Add fallback to string comparison for unparseable versions
- Enhance debug logging with candidate lists and sorted order
- Environment variables (ANTHROPIC_DEFAULT_*_MODEL) take precedence

Testing:
- Add comprehensive unit tests (31 tests covering all scenarios)
- Add model tier auto-selection test suite (384 lines)
- All 1,622 tests passing (1,446 unit + 176 integration)
- Zero linter warnings

Benefits:
- Future-proof: automatically handles Claude 5, 6, etc.
- Robust: always selects at least one model even if parsing fails
- Debuggable: logs selection details and fallback usage
- Override: environment variables allow manual control

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
@vadimvlasenko vadimvlasenko merged commit 4e3ca98 into main Feb 12, 2026
5 checks passed
@vadimvlasenko vadimvlasenko deleted the feat/claude-model-tiers branch February 12, 2026 14:49
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.

2 participants