opencode-era record. Superseded where moot by the pi migration (ADR-0055). Retained as historical context.
Date: 2026-07-16
Accepted
Partially supersedes ADR-0012 (model-location clause). Partially supersedes ADR-0013 (variant-location clause). ADR-0014 (temperature explicitness) is unaffected.
ADR-0012 ("Configurable Model Variables via {env:VAR} Substitution")
established that {env:VAR} model references would live in both
opencode.json (for primary agents) and .opencode/agents/*.md frontmatter
(for subagents). It explicitly rejected the alternative "Remove explicit
model: fields, use top-level inheritance only" — reasoning that this would
lose three-tier differentiation.
In practice, and as enforced by tests/Unit/Harness/ModelConfigTest.php, all
20 agents have their model, variant, and temperature fields defined in
opencode.jsonc's agent section — not in .opencode/agents/*.md
frontmatter. The .md files carry only description, mode: subagent,
temperature (literal, per ADR-0014), and permission.
The @opencode-ai/plugin v1.18.3 runtime rejects model: and variant:
fields in sub-agent .md frontmatter with a configuration error. Three
agents (@code-review, @spec-review, @standards-review) were added with
redundant model: lines in their .md frontmatter during the 4-axis code
review coordinator work — these lines duplicated the authoritative config
already present in opencode.jsonc.
ADR-0012's rejected alternative (remove explicit model fields from .md files)
feared loss of tier differentiation. This fear is unfounded:
tier-separated model assignment is fully preserved via opencode.jsonc's
agent section, where each agent has an independently specified model
field using {env:OPENCODE_MODEL_*} references.
-
Model and variant config lives exclusively in
opencode.jsonc'sagentsection. The.opencode/agents/*.mdfiles do NOT carrymodel:orvariant:frontmatter fields. -
The
.mdfiles carry onlydescription,mode: subagent,temperature(a literal numeric value, per ADR-0014), andpermission— the fields that the runtime accepts from sub-agent frontmatter. -
A regression test (
ModelConfigTest.php) asserts no.mdfile containsmodel:orvariant:— a repeat of the three redundant lines will fail the test suite. -
Tier differentiation is preserved — each agent in the
agentsection ofopencode.jsonchas its ownmodel+variantfields, independently targeting PRIMARY, PLANNER, JUDGE, or UTILITY tiers. -
The
@opencode-ai/plugindependency is updated from 1.17.15 to 1.18.3, matching the runtime version that introduced the frontmatter restriction.
Positive:
.mdfiles are simpler — only runtime-supported fields, no redundant duplication withopencode.jsonc.- Single source of truth for model/variant assignment —
opencode.jsoncagentsection. - Runtime configuration error is fixed — sub-agents no longer trigger
rejection on
model:/variant:frontmatter fields. - Regression test prevents re-emergence of redundant model/variant lines.
Negative:
- None material. Tier differentiation is preserved; no agent changes model.
Neutral:
- Temperature remains duplicated across both
opencode.jsoncand.mdfrontmatter (pre-existing, required by bothModelConfigTest.phpand ADR-0014's explicitness mandate). This duplication is outside the scope of this ADR. - The
opencode.jsonvsopencode.jsoncnaming inconsistency in AGENTS.md (line 149 —opencode.json) is a pre-existing issue in a comment aboutPlan-by:derivation, not addressed here. Update (ADR-0031): The footer is nowAuthored-by:(renamed fromPlan-by:). The verification footerTested-by:is sourced fromagent.code-review.model(wasagent.build.model). See ADR-0031.
Rejected. The runtime (plugin 1.18.3+) rejects it. This is not a choice — it is a configuration error that prevents the agent from loading.
Rejected. This would lose the three-tier differentiation that
ADR-0012/0013/0014 were designed to support. @docs-writer and @semgrep
must remain on the UTILITY tier; @from-issue must remain on the PLANNER
tier. Top-level inheritance would collapse all sub-agents to PRIMARY.
Rejected. The runtime does not accept model:/variant: in .md
frontmatter. Even if it did, .md YAML frontmatter is less structured
than opencode.jsonc's JSON — variants and temperatures would need
quoting, and the harness tests would need substantial rewrites.
- ADR-0012 — partially superseded (model-location clause; the
{env:VAR}mechanism and tier system stand) - ADR-0013 — partially superseded (variant-location clause; the
{env:VAR}variant mechanism and JUDGE tier stand) - ADR-0014 — unaffected (temperature explicitness stands; temperature is still required as a literal in both opencode.jsonc and .md frontmatter)
- GitHub issue #139 — the issue whose branch carries this fix