Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/central-model-resolver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@bradygaster/squad-sdk": minor
"@bradygaster/squad-cli": patch
---

Central model resolver (#1720): `resolveAgentModel` (an alias of `resolveModel`) from `@bradygaster/squad-sdk/agents` adds `config`, `session` and `fallback` sources, applies the exported `MODEL_RESOLUTION_PRECEDENCE` (user-override > config > session > charter > task-auto > default), and returns a `rationale` for every choice (typed as `ModelResolution`; `ResolvedModel.rationale` stays optional so consumer-built values remain valid). `auto` (any case) means "no preference" at every layer, including a per-spawn override. A session-picked model is inherited by every sub-agent spawn with source `session`. When a model listed in `unavailableModels` is in its tier chain, fallback moves only forward to the next available entry; models outside the chain search it from the head; with no candidate left, `omitModel` is set. The returned `fallbackChain` lists only available entries, starting at the selected model when it is in its chain, so retries never move back toward the head. `ModelFallbackExecutor.execute` accepts an optional `{ platformDefault }` callback that runs model-less when the resolution has `omitModel`; it never calls the model callback with an empty id.

The root `resolveModel` export (string-returning, reads `.squad/config.json`) is now a compatible adapter over the central resolver, so it no longer returns a literal `auto`. `AgentLifecycleManager.spawnAgent` now applies persistent `.squad/config.json` preferences (`agentModelOverrides`, `defaultModel`, `economyMode`) and records provenance on `AgentHandle.modelResolution`, OTel span attributes and an `agent:milestone` `model.resolved` event. New helpers: `isModelPreference`, `persistentConfigModel`. Coordinator spawn guidance and `model-selection-reference.md` no longer hard-code model IDs; spawn acknowledgments show model, source and rationale, with catalog IDs kept in a separate appendix. `AgentLifecycleManager.spawnAgent` accepts `sessionModel` and `unavailableModels`; an exhausted chain omits `model` from the session config. Under a cost policy, an explicit over-ceiling pick keeps the forward-only fallback cursor. Availability fallback also honors the active cost ceiling (`config.costPolicy` or `sessionCostPolicy`): catalog-known candidates above it are skipped, so an unavailable out-of-catalog pick (for example `hydrafusion`) falls back only to an in-ceiling entry or omits `model`; an available explicit pick still passes through unchanged.
5 changes: 5 additions & 0 deletions .changeset/economy-model-fallback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bradygaster/squad-sdk": patch
---

Allow automatic economy-profile model resolutions to retry available cheaper-tier models after exhausting their selected tier.
5 changes: 5 additions & 0 deletions .changeset/economy-status-model-ids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bradygaster/squad-cli": patch
---

Update `squad economy` status examples to match the current economy model substitutions.
5 changes: 5 additions & 0 deletions .changeset/hydrafusion-opt-in.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bradygaster/squad-sdk": minor
---

Add opt-in HydraFusion support (#2014). `hydrafusion` and `hydrafusion-max` are catalog entries marked `preview` (premium tier) and are excluded from every default chain and GA profile. A new opt-in `hydrafusion` quality profile sends architecture, research, verification, review, security and design tasks to `hydrafusion` first, then the quality-first premium chain; Scribe and mechanical work stay on the fast tier. `hydrafusion-max` is used only when named explicitly. If HydraFusion is unavailable (live model list, or `createSession` rejecting a profile-picked `hydrafusion`, for example under org policy), `AgentLifecycleManager.spawnAgent` falls forward to the premium chain within the cost ceiling instead of failing the spawn, and tells the user once (console warning plus an `agent:milestone` `model.unavailable` event). `ModelRegistry.getRecommendedModels` never recommends preview entries; they stay available through explicit catalog lookup.
9 changes: 9 additions & 0 deletions .changeset/quality-model-profiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@bradygaster/squad-sdk": minor
---

Quality-profile and public-catalog aware model selection (#1598). Task-aware selection now runs under a quality profile: `quality-first` (the new default), `balanced` or `economy` (explicit opt-in). Under `quality-first`, architecture, research, verification, review, security, design and visual work use the premium tier; code, prompts, docs, writing and planning use standard; mechanical work (Scribe, git, release) stays fast. The `default` layer now uses the head of the standard chain, or the economy default under `economy`. The profile comes from a session profile (`sessionProfile`), `economyMode: true`, or the persistent `.squad/config.json` `modelProfile` (new `readModelProfile` / `writeModelProfile`, `isModelSelectionProfile`, `MODEL_SELECTION_PROFILES`, `PROFILE_TASK_TIERS`, `resolveModelProfile`). `ResolvedModel.profile`, rationales, the `model.profile` span attribute and the `model.resolved` event report the active profile. Profiles never change explicit user-override, config, session or charter models, and cost ceilings still apply. `economyMode` stays compatible: an explicit `economyMode: false` cancels a persisted `economy` profile. `readEconomyMode` (and `squad economy`) also reports enabled for `modelProfile: "economy"`, and `writeEconomyMode(dir, false)` (`squad economy off`) also removes a persisted `economy` profile, leaving other profiles unchanged.

`resolveAgentModel` and `AgentLifecycleManager.spawnAgent` accept `availableModels`, the runtime's live model list. When supplied, it is authoritative for availability: a missing recommended model falls forward through its chain, and a missing explicit model falls back visibly.

The model catalog, fallback chains (`MODELS.FALLBACK_CHAINS`, `DEFAULT_FALLBACK_CHAINS`, `DEFAULT_CONFIG.models.tiers`) and `ECONOMY_MODEL_MAP` now list only public GA models from the GitHub Copilot supported-models table, with tiers placed by the Copilot model-picker category. Added: `claude-opus-5.5`, `gpt-6.1-sol`, `gpt-6-sol`, `gemini-4-argon`, `claude-sonnet-5.5`, `grok-4.7`, `grok-4.6`, `claude-haiku-5.5`, `gpt-6-luna`, `gemini-3.8-flash`, `mai-code-1.1-flash`. Removed from recommendations, catalog and fallback chains: `claude-opus-4.7`, `claude-opus-4.6`, `claude-sonnet-4.6`, `claude-sonnet-4.5`, `gemini-3.1-pro`. These IDs are still passed through unchanged when a user names one explicitly.
12 changes: 7 additions & 5 deletions .github/agents/squad.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,13 @@ After routing determines WHO handles work, select a **response MODE** (Direct /
### Per-Agent Model Selection
Resolve a model before every spawn. Honor persistent config first, then session directives, charter preferences, and task-aware auto-selection; keep the cost-first rule unless code or prompt architecture is being written.
Resolve a model before every spawn with the central resolver precedence (first match wins): **user-override** (explicit per-spawn directive) → **config** (`.squad/config.json` `agentModelOverrides.{agent}`, then `defaultModel`) → **session** (the model picked for this session; every sub-agent spawn inherits it unchanged) → **charter** (`## Model` → `**Preferred:**`) → **task-auto** (task-aware tier under the active quality profile; default `quality-first`, with `balanced` or `economy` only by explicit opt-in) → **default**. `auto` at any layer means no preference; continue to the next. Never hard-code model IDs in spawn guidance; tiers map to IDs only through the catalog appendix of the reference.
Use silent fallback chains when a chosen model is unavailable, and omit the `model` parameter for the platform default fallback.
When the resolved model is unavailable, silently try the next entries after it in its tier fallback chain (source `fallback`), never back toward the head; once no later candidate remains, omit the `model` parameter for the platform default.
**On-demand reference:** Read `.squad/templates/model-selection-reference.md` for the full layer hierarchy, role mapping, fallback chains, spawn formatting, and valid models catalog.
Every spawn acknowledgment shows the model, its source and a short rationale: `{emoji} {Name} ({model} · {source}) — {task summary} — {rationale}`.
**On-demand reference:** Read `.squad/templates/model-selection-reference.md` for the full precedence, role-to-tier mapping, fallback rules, spawn formatting, and the model catalog appendix.
### Per-Agent Reasoning Effort
Expand All @@ -424,7 +426,7 @@ When the resolved reasoning effort is not `auto` or default, include it in the a
**Spawn output format — show the model choice and effort:**
Follow `.squad/templates/model-selection-reference.md` for the base model-selection rules. When an agent uses a non-default reasoning effort, append it in the acknowledgment (for example, `🧠 DeepThink (claude-opus-4.7-1m-internal · xhigh) — deep architecture analysis`).
Follow `.squad/templates/model-selection-reference.md` for the base model-selection rules. When an agent uses a non-default reasoning effort, append it in the acknowledgment (for example, `🧠 DeepThink ({model} · charter · xhigh) — deep architecture analysis — charter preference`).
### Per-Agent Context Tier
Expand All @@ -451,7 +453,7 @@ When the resolved context tier is not `auto` or default, include it in the agent
**Spawn output format — show the model choice and tier:**
Follow `.squad/templates/model-selection-reference.md` for the base model-selection rules. When an agent uses a non-default context tier, append it in the acknowledgment (for example, `🧠 DeepThink (claude-opus-5 · long context) — 1M-token window for deep architecture analysis`).
Follow `.squad/templates/model-selection-reference.md` for the base model-selection rules. When an agent uses a non-default context tier, append it in the acknowledgment (for example, `🧠 DeepThink ({model} · charter · long context) — deep architecture analysis — 1M-token window`).
### Client Compatibility
Expand Down
Loading
Loading