一键导入
add-model
// Add or update a model in the harness model registry. Use when the user wants to add a new AI model, update model pricing, or change default models for a harness.
// Add or update a model in the harness model registry. Use when the user wants to add a new AI model, update model pricing, or change default models for a harness.
| name | add-model |
| description | Add or update a model in the harness model registry. Use when the user wants to add a new AI model, update model pricing, or change default models for a harness. |
Add or update a model in the model registry. The user will specify which harness (e.g., codex, claude-code) and what model to add or change.
Before making changes, confirm with the user:
HarnessId in projects/harness/src/types.ts for valid values)gpt-5.4, claude-opus-4-6)opus, gpt-5.4) — often the same as the model ID for codex modelsGPT-5.4, Opus 4.6)Codex, Opus)If the model name is ambiguous or you're unsure about the exact wire ID, test it locally first by running the harness CLI. For codex:
codex exec -m <model-id> "echo hello" 2>&1 | head -15
For claude-code, check Anthropic's model docs or test with claude.
Search the web for the model's official per-million-token pricing:
Use the provider's official pricing page as the source of truth.
Every model addition touches these files — all must stay in sync:
File: projects/harness/src/models.ts
Add a ModelEntry to the appropriate harness in MODEL_REGISTRY. If making it the default, update defaultModel.
models() methodThe harness class must return identical data to the registry. A sync test enforces this.
projects/harness/src/harnesses/codex/index.ts — the models() methodprojects/harness/src/harnesses/claude-code/index.ts — the models() methodEach harness has its own pricing file:
projects/harness/src/harnesses/codex/pricing.ts — add entry to CODEX_PRICINGprojects/harness/src/harnesses/claude-code/pricing.ts — add entry to CLAUDE_PRICINGnormalizeModelClass() fallbackFile: projects/harness/src/models.ts
If the new model ID doesn't match existing string-based fallback patterns (e.g., a codex model that doesn't contain "codex" in its name), add a fallback line. The function first checks the registry, then falls back to substring matching for legacy/effort-suffixed IDs.
File: projects/harness/src/models.test.ts
Update:
normalizeModelClass assertions if new fallback patterns were addedAlso check projects/harness/src/harnesses/<harness>/pricing.test.ts for any pricing test expectations.
The web UI reads dynamically from MODEL_REGISTRY so typically no frontend changes are needed. But check for hardcoded model IDs in:
projects/web/src/constants.tsprojects/web/src/components/ModelPicker.tsxprojects/web/src/store/TaskModel.tsprojects/web/src/hyperplan/ (test fixtures may reference specific models)These usually don't need changes but verify.
Run the harness unit tests (excluding slow integration tests):
cd projects/harness && npm run test
All tests must pass before committing.
End-to-end release workflow — draft notes, run checks, push, watch CI, publish GitHub release, and update download links. Minimal user interaction required.
Generate a beautiful Twitter/social media promo PNG graphic for OpenADE features