Skip to content

feat: explicit dispatch model for every ensemble agent — default opus, PAI_AGENT_MODEL override (#20) - #21

Merged
kiki830621 merged 2 commits into
mainfrom
idd/20-agent-dispatch-default-opus
Jul 2, 2026
Merged

feat: explicit dispatch model for every ensemble agent — default opus, PAI_AGENT_MODEL override (#20)#21
kiki830621 merged 2 commits into
mainfrom
idd/20-agent-dispatch-default-opus

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Refs #20

Summary

引擎解析 args.agentModel(whitelist sonnet|opus|haiku|fablenull/''/absent → opus;顯式非法值於任何派發前 throw)、3 個 agent() 站點帶 modelstats.dispatchModel + progress log 揭露實際請求值(含 early-return 路徑)。5 個 ensemble-* skill 解析 PAI_AGENT_MODEL 傳入;13 個 legacy Backend-B Agent 範本 + lecture CRITICAL 行帶具體 model 欄位。args surface + return shape 官方化為 STABLE external-consumer 契約(第一個 consumer:idd-verify 的依賴切換,見 issue-driven-development#207——依使用者「需要官方就直接依賴」裁決)。

Verification

6-AI verify(self-dogfood 第二輪:verify 自身即 agentModel:'opus' 派發)master report 見 issue #20。DA 的「model opt 未證」被雙重 live 證據駁倒(兩輪 fable session、12/12 transcript 實跑 claude-opus-4-8);MEDIUM + 全部 LOW 當輪修復。TDD:13/13 ensemble tests(5 個 #20 新案例)、17/17 全套件。

Checklist

  • Diagnose ✓(Plan / A_parallel_safe;含依賴性盤點證據答案)
  • TDD implement(RED→GREEN)+ verify fixes(2 commits)
  • Verify ✓(post-fix 0 blocking)
  • Verify-gated: ready to merge → after merge, run /idd-close manually

Related

  • Primary:issue-driven-development#205(同型修復,已 shipped 2.88.0)
  • 依賴切換追蹤:issue-driven-development#207

🤖 Generated by /idd-all. Do NOT add a GitHub close trailer.

…, PAI_AGENT_MODEL override (#20)

The engine resolves AGENT_MODEL from the new args.agentModel
(whitelist sonnet|opus|haiku|fable; absent → opus; an explicitly
invalid value throws before any dispatch — a pre-dispatch
arg-contract violation, unlike unknown-profile which stays a
mid-run harness finding) and passes model at all 3 agent() sites;
stats.dispatchModel and the progress log disclose what actually
ran. All 5 ensemble-* skills resolve PAI_AGENT_MODEL (unset →
opus, invalid → usage-error abort) and thread it as agentModel;
legacy TeamCreate fallbacks pin each spawned Agent the same way.

Unpinned dispatch inherits the session's main-loop model — on
high-tier sessions that burned 563k–1,092k tokens per round and
killed a lens agent at a session limit (primary:
issue-driven-development#205, where the sibling engine got the
same fix).

The args surface + return shape are now the documented STABLE
external-consumer contract: per the owner's direct-dependency
ruling, idd-verify's vendored 305-line fork is slated to become a
resolve-installed-engine dependency (tracked in the IDD repo),
so this engine is the single canonical place for ensemble fixes.

TDD: 3 new regression cases (default-opus at every site, override
honored, invalid-throws-before-dispatch) — 11/11 ensemble tests,
17/17 full suite.

Refs #20
…ty, legacy templates, live routing proof

The invalid-agentModel guard now treats null and empty string as
absent (default opus) — the '(unset = opus)' hint and the || 'opus'
fallback always signaled falsy→default intent, and a set-but-empty
PAI_AGENT_MODEL env var must not hard-throw. The error message
JSON-stringifies the offending value (no log pollution), and the
header documents this throw as the engine's ONE out-of-band exit,
distinct from the findings-shaped guards. Both early-return guard
stats now carry dispatchModel for return-shape parity with the
officialized contract. All 13 legacy Backend-B Agent template
blocks across the skills gain a concrete model field — a prose
banner alone risked the fallback path re-inheriting the session
model, the exact bug being fixed. CHANGELOG rolls [Unreleased]
into [2.18.0] to match the manifest bump.

Model routing is no longer an assumption in this repo either: the
header cites two live 6-agent runs on this same runtime + opts
contract (wf_6c1d8ee6-5f3 and wf_d44fa55e-65a — the verify run of
this very change), both dispatched from a claude-fable-5 session
with agentModel:'opus' and all twelve transcripts recording
claude-opus-4-8; it also notes the request-echo caveat on runtimes
predating opts.model and the codex wrapper-only pin nuance.

Tests: 13/13 ensemble (2 new: null/''-defaults, early-return
dispatchModel), 17/17 full suite.

Refs #20
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