Files
cleveragents-core/opencode.json
T
drew 132a5a2269 feat(auto-agents): centralise model registry under .opencode/models with session-create model stamp
Every agent's model assignment now lives in a single-line text file at
.opencode/models/<name>.txt; default.txt is the 27-agent catch-all.
opencode.json's agent.<name>.model uses
{file:./.opencode/models/<name>.txt} interpolation, and
tools/_opencode_worker.py reads the same files at session-create to
stamp the resolved model on the session record (observability + drift
sentinel; OpenCode does NOT propagate session-level model to
prompt_async — schema for that is undocumented and deferred to Stage
2). 39 .md frontmatter `model:` lines stripped; the two intentional
inheritors (task-implementor, agent-evolution-pool-supervisor) keep
their model-less frontmatter.

Operator workflow for swapping a model is now: edit
.opencode/models/<role>.txt, restart OpenCode so opencode.json's
{file:...} re-resolves, run the dispatcher. Live-swap without restart
was attempted (override on prompt_async); OpenCode 0.x silently
dropped those requests (200 OK, no assistant message) and the
prompt_async override was reverted. The session-create override
remains for observability + drift detection.

End-to-end validation (2026-05-10): dispatch_review.py on PR #25 with
default.txt=openai/gpt-5-mini produced a clean REQUEST_CHANGES review
in 26 s for ~$0.016; dispatch_implementer.py on PR #30 with
tier-qwen-* files remapped to openai/{gpt-5-nano, gpt-5-mini,
gpt-5-codex} ran the full implementation-worker → tier-dispatcher →
estimator-implementation → tier-qwen-med → task-implementor →
git-isolator-util chain in 16 min with model=gpt-5-mini end-to-end.

Also documents the printenv VAR form as the only allowed env-read in
implementation-worker.md and task-implementor.md (live testing
showed the worker burning 2–4 turns on permission-denied
trial-and-error trying printf and echo variants).

Tests: 21 in tests/auto_agents/test_opencode_worker_models.py
(resolver semantics with caplog assertions on every malformed-input
path; session-create body shape; prompt_async body never carries
model; three repo-level invariants — every {file:...} reference
resolves, every .md is wired or in the inheritor allowlist, no .md
has a model: frontmatter). 1027 auto_agents tests pass / 3 skipped.

Note: .opencode/models/default.txt and the three tier-qwen-*.txt
files are committed with their OpenAI swaps in place (gpt-5-mini,
gpt-5-nano, gpt-5-mini, gpt-5-codex respectively) because the
CleverThis HuggingFace endpoints are paused. Revert with `git diff
HEAD~1 -- .opencode/models/*.txt | git apply -R` if/when they come
back.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 17:23:06 -04:00

396 lines
16 KiB
JSON

{
"$schema": "https://opencode.ai/config.json",
"permission": "allow",
"instructions": [
".opencode/instructions/*.md"
],
"mcp": {
"context7": {
"type": "local",
"command": [
"npx",
"-y",
"@upstash/context7-mcp"
],
"enabled": true
},
"sequential-thinking": {
"type": "local",
"command": [
"npx",
"@modelcontextprotocol/server-sequential-thinking"
],
"enabled": false
}
},
"provider": {
"anthropic": {
"models": {
"anthropic/claude-opus-4-6": {
"name": "Claude OPUS 4.6",
"limit": {
"context": 200000,
"output": 32768
}
},
"anthropic/claude-haiku-4-5": {
"name": "Claude Haiku 4.5",
"limit": {
"context": 200000,
"output": 32768
}
},
"anthropic/claude-sonnet-4-6": {
"name": "Claude Sonnet 4.6",
"limit": {
"context": 200000,
"output": 32768
}
}
}
},
"CleverThis": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://ke5ntcikhnj2clcp.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-6-35B-A3B-GGUF-BF16": {
"name": "Qwen 3.6 35b A3B GGUF BF16 (Thinking)",
"tools": true
}
}
},
"CleverThis-2": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://bqdgwv2uzjgianhe.us-east-2.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"MiniMax-M2-7-GGUF-BF16": {
"name": "MiniMax M2.7 GGUF BF16 (Thinking)",
"limit": {
"context": 196608,
"output": 65536
},
"tools": true
}
}
},
"CleverThis-3": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://jve0bsgx6csdzln9.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Devstral-Small-2-24B-Instruct-GGUF": {
"name": "Devstral Small 2 24B GGUF (Instruct)",
"tools": true
}
}
},
"CleverThis-4": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://ntgtpdbn2vuag4yb.us-east-2.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Kimi-K2-6-GGUF-Q2-K-XL": {
"name": "Kimi K2.6 GGUF Q2_K_XL (Thinking)",
"tools": true
}
}
},
"CleverThis-5": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://fhe4kwehnm1rb275.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-Coder-Next-GGUF-BF16": {
"name": "Qwen3 Coder Next GGUF BF16",
"tools": true
}
}
},
"CleverThis-6": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://f0oelboag4bzw1zp.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Nemotron-3-Nano-30B-GGUF-Q8-K-XL": {
"name": "Nemotron 3 Nano 30B GGUF Q8_K_XL (Thinking)",
"tools": true
}
}
},
"CleverThis-7": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://dfwwzwtekzhnh4fl.us-east-2.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"DavidAU/Qwen3.6-40B-Claude-4.6-Opus-Deckard-Heretic-Uncensored-Thinking": {
"name": "Qwen 3.6 40B Uncensored BF16 (Thinking)",
"tools": true
}
}
},
"CleverThis-8": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://ki19d58snp1d3qa4.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-Coder-Next-GGUF-Q4-0": {
"name": "Qwen3 Coder Next GGUF Q4_0",
"tools": true
}
}
},
"CleverThis-9": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://m56026p5kxvout0d.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-6-35B-A3B-GGUF-MXFP4-MOE": {
"name": "Qwen 3.6 35b A3B GGUF MXFP4_MOE (Thinking)",
"tools": true
}
}
},
"CleverThis-10": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://dirv1cnem5wqzoax.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-235B-A22B-INST-GGUF-Q8-0": {
"name": "Qwen3 235b A22B GGUF Q8_0 (Instruct)",
"tools": true
}
}
},
"CleverThis-11": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://hueiyrdbly1ff4oo.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-235B-A22B-INST-GGUF-UD-Q2-K-XL": {
"name": "Qwen3 235b A22B GGUF UD-Q2_K_XL (Instruct)",
"tools": true
}
}
},
"CleverThis-12": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://atocunu78hjdnu3f.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-30B-A3B-INST-GGUF-UD-Q8-K-XL": {
"name": "Qwen3 30b A3B GGUF UD-Q8_K_XL (Instruct)",
"tools": true
}
}
},
"CleverThis-13": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://dpe3orf5en4581im.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-30B-A3B-INST-GGUF-UD-Q5-K-XL": {
"name": "Qwen3 30b A3B GGUF UD-Q5_K_XL (Instruct)",
"tools": true
}
}
},
"CleverThis-14": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://jamyigykfzm39bcu.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"MiniMax-M2-7-GGUF-UD-Q4-K-XL": {
"name": "MiniMax M2.7 GGUF UD-Q4_K_XL (Thinking)",
"tools": true
}
}
},
"CleverThis-15": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://n4u4h8h0fgintms4.us-east-1.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-6-35B-A3B-GGUF-UD-Q3-K-XL": {
"name": "Qwen 3.6 35b A3B GGUF UD-Q3_K_XL (Thinking)",
"tools": true
}
}
},
"CleverThis-16": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://kcgeda25msp4dkwm.us-east-2.aws.endpoints.huggingface.cloud/v1",
"apiKey": "{env:HF_TOKEN}",
"headers": {
"X-HF-Bill-To": "CleverThis",
"Authorization": "Bearer {env:HF_TOKEN}"
}
},
"models": {
"Qwen3-code-480B-A35B-INST-GGUF-1M-UD-Q3-K-XL": {
"name": "Qwen3 Code 480b A35B GGUF UD-Q3_K_XL (Instruct, 1M Context)",
"tools": true
}
}
},
"openai": {
"models": {
"gpt-5-codex": {
"name": "GPT-5 Codex"
},
"gpt-5-mini": {
"name": "GPT-5 Mini"
},
"gpt-5-nano": {
"name": "GPT-5 Nano"
},
"o4-mini": {
"name": "o4-mini"
}
}
},
"google": {
"models": {
"gemini-2.5-pro": {
"name": "Gemini 2.5 Pro"
}
}
}
},
"agent": {
"async-agent-util": { "model": "{file:./.opencode/models/default.txt}" },
"auto-agents": { "model": "{file:./.opencode/models/default.txt}" },
"conflict-resolver-worker": { "model": "{file:./.opencode/models/default.txt}" },
"estimator-implementation": { "model": "{file:./.opencode/models/default.txt}" },
"git-checkout-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-cleanup-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-clone-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-commit-and-push-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-commit-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-create-commit-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-fetch-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-force-push-with-lease-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-isolator-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-push-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-rebase-and-push-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-rebase-util": { "model": "{file:./.opencode/models/default.txt}" },
"git-stage-util": { "model": "{file:./.opencode/models/default.txt}" },
"implementation-worker": { "model": "{file:./.opencode/models/default.txt}" },
"pr-merge-supervisor": { "model": "{file:./.opencode/models/default.txt}" },
"pr-merge-worker": { "model": "{file:./.opencode/models/default.txt}" },
"pr-review-worker": { "model": "{file:./.opencode/models/default.txt}" },
"session-health-full-util": { "model": "{file:./.opencode/models/default.txt}" },
"session-health-quick-util": { "model": "{file:./.opencode/models/default.txt}" },
"session-health-util": { "model": "{file:./.opencode/models/default.txt}" },
"supervisor": { "model": "{file:./.opencode/models/default.txt}" },
"tier-dispatcher": { "model": "{file:./.opencode/models/default.txt}" },
"work-group-util": { "model": "{file:./.opencode/models/default.txt}" },
"tier-qwen-small": { "model": "{file:./.opencode/models/tier-qwen-small.txt}" },
"tier-qwen-med": { "model": "{file:./.opencode/models/tier-qwen-med.txt}" },
"tier-qwen-large": { "model": "{file:./.opencode/models/tier-qwen-large.txt}" },
"tier-kimi": { "model": "{file:./.opencode/models/tier-kimi.txt}" },
"tier-haiku": { "model": "{file:./.opencode/models/tier-haiku.txt}" },
"tier-sonnet": { "model": "{file:./.opencode/models/tier-sonnet.txt}" },
"tier-opus": { "model": "{file:./.opencode/models/tier-opus.txt}" },
"tier-codex": { "model": "{file:./.opencode/models/tier-codex.txt}" },
"tier-gpt5-mini": { "model": "{file:./.opencode/models/tier-gpt5-mini.txt}" },
"tier-gpt5-nano": { "model": "{file:./.opencode/models/tier-gpt5-nano.txt}" },
"tier-o4-mini": { "model": "{file:./.opencode/models/tier-o4-mini.txt}" },
"ca-test-infra-improver": { "model": "{file:./.opencode/models/ca-test-infra-improver.txt}" }
}
}