Skip to content

refactor(agents): extract DEFAULT_MODEL constant for single source of truth#29

Merged
vtemian merged 1 commit intomainfrom
refactor/default-model-constant
Mar 9, 2026
Merged

refactor(agents): extract DEFAULT_MODEL constant for single source of truth#29
vtemian merged 1 commit intomainfrom
refactor/default-model-constant

Conversation

@vtemian
Copy link
Owner

@vtemian vtemian commented Mar 9, 2026

Summary

  • Extracts DEFAULT_MODEL constant into src/utils/config.ts, replacing 26 hardcoded "openai/gpt-5.2-codex" strings in src/agents/index.ts
  • Changing the default model is now a one-line edit instead of a 26-line diff
  • No behavior change — model resolution priority chain is identical

Context

Related to #28 which attempted to fix this by removing models entirely. This approach keeps the fallback model as a safety net while making it DRY.

Files changed

File Change
src/utils/config.ts Added model.default + exported DEFAULT_MODEL
src/agents/index.ts Import + use DEFAULT_MODEL (26 replacements)
src/config-loader.ts Updated comment + fallback message
tests/agents/index.test.ts Use DEFAULT_MODEL, added "all agents use DEFAULT_MODEL" test
tests/config-loader-integration.test.ts Use DEFAULT_MODEL in assertions
tests/config-loader.test.ts Use DEFAULT_MODEL in test fixtures

… truth

Replace 26 hardcoded "openai/gpt-5.2-codex" strings in agents/index.ts
with a single DEFAULT_MODEL constant from config. Changing the default
model is now a one-line change in src/utils/config.ts.

Plan: thoughts/shared/plans/2026-03-09-default-model-constant.md
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@vtemian vtemian merged commit 340e238 into main Mar 9, 2026
2 checks passed
@vtemian vtemian deleted the refactor/default-model-constant branch March 9, 2026 17:09
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