feat: explicit dispatch model for every ensemble agent — default opus, PAI_AGENT_MODEL override (#20) - #21
Merged
Conversation
…, 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
4 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #20
Summary
引擎解析
args.agentModel(whitelistsonnet|opus|haiku|fable;null/''/absent →opus;顯式非法值於任何派發前 throw)、3 個agent()站點帶model、stats.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
Related
🤖 Generated by /idd-all. Do NOT add a GitHub close trailer.