Skip to content

refactor: centralize model IDs into shared constants with env var overrides#1097

Open
shaal wants to merge 1 commit intoruvnet:mainfrom
shaal:refactor/centralize-model-ids
Open

refactor: centralize model IDs into shared constants with env var overrides#1097
shaal wants to merge 1 commit intoruvnet:mainfrom
shaal:refactor/centralize-model-ids

Conversation

@shaal
Copy link

@shaal shaal commented Feb 7, 2026

Summary

  • Add centralized CLAUDE_MODELS constants and getModelId() function in @claude-flow/shared/core/models.ts with CLAUDE_FLOW_MODEL_* environment variable overrides
  • Replace all 16+ hardcoded model ID references across packages with imports from the shared module
  • Update model IDs to latest versions (Opus 4.6, Sonnet 4.5, Haiku 4.5) and remove version-specific display names

Closes #1096

Test plan

  • Verify @claude-flow/shared builds successfully with new models.ts export
  • Verify @claude-flow/cli builds with updated imports in headless-worker-executor and settings-generator
  • Verify @claude-flow/plugins builds with optional @claude-flow/shared peer dependency
  • Test CLAUDE_FLOW_MODEL_OPUS env var override works at runtime
  • Verify npx claude-flow@v3alpha init --wizard generates settings with correct model IDs
  • Verify statusline displays "Opus" without version number

🤖 Generated with claude-flow

…rrides

Replace hardcoded Claude model IDs scattered across 16+ files with a
single source of truth in @claude-flow/shared/core/models.ts.

- Add CLAUDE_MODELS constants, getModelId() with CLAUDE_FLOW_MODEL_*
  env var overrides, and MODEL_DISPLAY_NAMES for UI strings
- Update headless-worker-executor, settings-generator, and providers
  to import from the centralized module
- Remove version-specific display names (e.g. "Opus 4.5") in favor
  of version-agnostic labels ("Opus", "Claude")
- Update all .claude/settings.json configs to latest model IDs
- Add @claude-flow/shared as optional peer dep to @claude-flow/plugins

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
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.

Centralize hardcoded Claude model IDs into shared constants

1 participant