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
13 changes: 13 additions & 0 deletions .changeset/refresh-model-catalog-1080.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@bradygaster/squad-sdk": minor
---

Refresh the model catalog to GitHub Copilot CLI-reachable IDs and prune dead fallback IDs.

- MODEL_CATALOG now lists only currently-valid, CLI-reachable models (13 total) and drops removed IDs (gpt-4.1, gpt-5, gpt-5.1*, gpt-5.2*, gemini-3-pro-preview, claude-sonnet-4, claude-opus-4.5, claude-opus-4.6-fast).
- Fallback chains (runtime constants + SDK defaults), schema defaults, and the economy-mode map are updated to real IDs only, fixing routing that pointed at models no longer offered.
- Adds an optional `githubCategory` cost-ceiling field (lightweight/versatile/powerful) to `ModelInfo`, sourced from the models API `model_picker_category`. This is a separate cost axis from the existing quality `tier`; the two are intentionally not conflated.
- No hardcoded per-token USD pricing is added for new entries, and no `included`/zero-credit flag is introduced.
- `validateConfigDetailed` now emits a non-blocking `warnings` entry when `config.models.defaultModel` is a non-empty string that is not present in the current `MODEL_CATALOG`, helping users catch stale model IDs in config files without blocking config load.

Refs #1080, #1183.
22 changes: 11 additions & 11 deletions .copilot/skills/model-selection/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Before spawning an agent, the coordinator determines which model to use. This sk

Check these layers in order — first match wins:

**Layer 1 — User Override:** Did the user specify a model? ("use opus", "save costs", "use gpt-5.2-codex for this"). If yes, use that model. Session-wide directives ("always use haiku") persist until contradicted.
**Layer 1 — User Override:** Did the user specify a model? ("use opus", "save costs", "use gpt-5.3-codex for this"). If yes, use that model. Session-wide directives ("always use haiku") persist until contradicted.

**Layer 2 — Charter Preference:** Does the agent's charter have a `## Model` section with `Preferred` set to a specific model (not `auto`)? If yes, use that model.

Expand All @@ -27,7 +27,7 @@ Check these layers in order — first match wins:
| Writing code (implementation, refactoring, test code, bug fixes) | `claude-sonnet-4.6` | Standard | Quality and accuracy matter for code. Use standard tier. |
| Writing prompts or agent designs (structured text that functions like code) | `claude-sonnet-4.6` | Standard | Prompts are executable — treat like code. |
| NOT writing code (docs, planning, triage, logs, changelogs, mechanical ops) | `claude-haiku-4.5` | Fast | Cost first. Haiku handles non-code tasks. |
| Visual/design work requiring image analysis | `claude-opus-4.5` | Premium | Vision capability required. Overrides cost rule. |
| Visual/design work requiring image analysis | `claude-opus-4.6` | Premium | Vision capability required. Overrides cost rule. |
Comment thread
primetimetank21 marked this conversation as resolved.

**Role-to-model mapping** (applying cost-first principle):

Expand All @@ -47,7 +47,7 @@ Check these layers in order — first match wins:
- **Bump UP to premium:** architecture proposals, reviewer gates, security audits, multi-agent coordination (output feeds 3+ agents)
- **Bump DOWN to fast/cheap:** typo fixes, renames, boilerplate, scaffolding, changelogs, version bumps
- **Switch to code specialist (`gpt-5.3-codex`):** large multi-file refactors, complex implementation from spec, heavy code generation (500+ lines)
- **Switch to analytical diversity (`gemini-3-pro-preview`):** code reviews where a second perspective helps, security reviews, architecture reviews after a rejection
- **Switch to analytical diversity (`gemini-2.5-pro`):** code reviews where a second perspective helps, security reviews, architecture reviews after a rejection

**Layer 4 — Default:** If nothing else matched, use `claude-haiku-4.5`. Cost wins when in doubt, unless code is being produced.

Expand All @@ -56,9 +56,9 @@ Check these layers in order — first match wins:
If a spawn fails because the selected model is unavailable (plan restriction, org policy, rate limit, deprecation, or any other reason), silently retry with the next model in the chain. Do NOT tell the user about fallback attempts. Maximum 3 retries before jumping to the nuclear fallback.

```
Premium: claude-opus-4.6 → claude-opus-4.6-fast → claude-opus-4.5 → claude-sonnet-4.6 → (omit model param)
Standard: claude-sonnet-4.6 → gpt-5.4 → claude-sonnet-4.5 → gpt-5.3-codex → claude-sonnet-4 → (omit model param)
Fast: claude-haiku-4.5 → gpt-5.1-codex-mini → gpt-4.1 → gpt-5-mini → (omit model param)
Premium: claude-opus-4.6 → claude-sonnet-4.6 → (omit model param)
Standard: claude-sonnet-4.6 → gpt-5.4 → claude-sonnet-4.5 → gpt-5.3-codex → (omit model param)
Fast: claude-haiku-4.5 → gpt-5.4-mini → gpt-5-mini → (omit model param)
```

`(omit model param)` = call the `task` tool WITHOUT the `model` parameter. The platform uses its built-in default. This is the nuclear fallback — it always works.
Expand Down Expand Up @@ -101,9 +101,9 @@ Include tier annotation only when the model was bumped or a specialist was chose

### Valid Models

**Premium:** `claude-opus-4.6`, `claude-opus-4.6-fast`, `claude-opus-4.5`
**Standard:** `claude-sonnet-4.6`, `claude-sonnet-4.5`, `claude-sonnet-4`, `gpt-5.4`, `gpt-5.3-codex`, `gpt-5.2-codex`, `gpt-5.2`, `gpt-5.1-codex-max`, `gpt-5.1-codex`, `gpt-5.1`, `gpt-5`, `gemini-3-pro-preview`
**Fast/Cheap:** `claude-haiku-4.5`, `gpt-5.1-codex-mini`, `gpt-5-mini`, `gpt-4.1`
**Premium:** `claude-opus-4.6`, `claude-opus-4.7`, `claude-opus-4.8`
**Standard:** `claude-sonnet-4.6`, `claude-sonnet-4.5`, `claude-sonnet-5`, `gpt-5.4`, `gpt-5.3-codex`, `gpt-5.5`, `gemini-2.5-pro`
Comment thread
primetimetank21 marked this conversation as resolved.
**Fast/Cheap:** `claude-haiku-4.5`, `gpt-5.4-mini`, `gpt-5-mini`

## Examples

Expand All @@ -122,8 +122,8 @@ Include tier annotation only when the model was bumped or a specialist was chose
- Role: Backend Dev
- Task: "refactor 15 auth-related files to use new token system"
- Layer 3 base: `claude-sonnet-4.5`
- Task complexity: heavy multi-file refactor → switch to `gpt-5.2-codex`
- Spawn: `🔧 Fenster (gpt-5.2-codex · code specialist) — refactoring auth to new token system`
- Task complexity: heavy multi-file refactor → switch to `gpt-5.3-codex`
- Spawn: `🔧 Fenster (gpt-5.3-codex · code specialist) — refactoring auth to new token system`

**Example 4: Scribe logging**
- Role: Scribe
Expand Down
1 change: 1 addition & 0 deletions .github/agents/squad.agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Squad
description: "Your AI team. Describe what you're building, get a team of specialists that live in your repo."
tools: ["*"]
---

<!-- version: 0.0.0-source -->
Expand Down
20 changes: 10 additions & 10 deletions .squad-templates/model-selection-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Before spawning an agent, determine which model to use. Check these layers in or
| Writing code (implementation, refactoring, test code, bug fixes) | `claude-sonnet-4.6` | Standard | Quality and accuracy matter for code. Use standard tier. |
| Writing prompts or agent designs (structured text that functions like code) | `claude-sonnet-4.6` | Standard | Prompts are executable — treat like code. |
| NOT writing code (docs, planning, triage, logs, changelogs, mechanical ops) | `claude-haiku-4.5` | Fast | Cost first. Haiku handles non-code tasks. |
| Visual/design work requiring image analysis | `claude-opus-4.5` | Premium | Vision capability required. Overrides cost rule. |
| Visual/design work requiring image analysis | `claude-opus-4.6` | Premium | Vision capability required. Overrides cost rule. |

**Role-to-model mapping** (applying cost-first principle):

Expand All @@ -32,7 +32,7 @@ Before spawning an agent, determine which model to use. Check these layers in or
| Lead / Architect | auto (per-task) | Mixed: code review needs quality, planning needs cost | Architecture proposals → premium; triage/planning → haiku |
| Prompt Engineer | auto (per-task) | Mixed: prompt design is like code, research is not | Prompt architecture → sonnet; research/analysis → haiku |
| Copilot SDK Expert | `claude-sonnet-4.6` | Technical analysis that often touches code | Pure research → `claude-haiku-4.5` |
| Designer / Visual | `claude-opus-4.5` | Vision-capable model required | — (never downgrade — vision is non-negotiable) |
| Designer / Visual | `claude-opus-4.6` | Vision-capable model required | — (never downgrade — vision is non-negotiable) |
| DevRel / Writer | `claude-haiku-4.5` | Docs and writing — not code | — |
| Scribe / Logger | `claude-haiku-4.5` | Mechanical file ops — cheapest possible | — (never bump Scribe) |
| Git / Release | `claude-haiku-4.5` | Mechanical ops — changelogs, tags, version bumps | — (never bump mechanical ops) |
Expand All @@ -41,7 +41,7 @@ Before spawning an agent, determine which model to use. Check these layers in or
- **Bump UP to premium:** architecture proposals, reviewer gates, security audits, multi-agent coordination (output feeds 3+ agents)
- **Bump DOWN to fast/cheap:** typo fixes, renames, boilerplate, scaffolding, changelogs, version bumps
- **Switch to code specialist (`gpt-5.3-codex`):** large multi-file refactors, complex implementation from spec, heavy code generation (500+ lines)
- **Switch to analytical diversity (`gemini-3-pro-preview`):** code reviews where a second perspective helps, security reviews, architecture reviews after a rejection
- **Switch to analytical diversity (`gemini-2.5-pro`):** code reviews where a second perspective helps, security reviews, architecture reviews after a rejection

**Layer 4 — Default:** If nothing else matched, use `claude-haiku-4.5`. Cost wins when in doubt, unless code is being produced.

Expand All @@ -50,9 +50,9 @@ Before spawning an agent, determine which model to use. Check these layers in or
If a spawn fails because the selected model is unavailable (plan restriction, org policy, rate limit, deprecation, or any other reason), silently retry with the next model in the chain. Do NOT tell the user about fallback attempts. Maximum 3 retries before jumping to the nuclear fallback.

```
Premium: claude-opus-4.6 → claude-opus-4.5 → claude-sonnet-4.6 → claude-sonnet-4.5 → (omit model param)
Standard: claude-sonnet-4.6 → claude-sonnet-4.5 → gpt-5.4 → gpt-5.3-codex → claude-sonnet-4 → (omit model param)
Fast: claude-haiku-4.5 → gpt-5.4-mini → gpt-5.1-codex-mini → gpt-4.1 → (omit model param)
Premium: claude-opus-4.6 → claude-sonnet-4.6 → claude-sonnet-4.5 → (omit model param)
Standard: claude-sonnet-4.6 → claude-sonnet-4.5 → gpt-5.4 → gpt-5.3-codex → (omit model param)
Fast: claude-haiku-4.5 → gpt-5.4-mini → gpt-5-mini → (omit model param)
```

`(omit model param)` = call the `task` tool WITHOUT the `model` parameter. The platform uses its built-in default. This is the nuclear fallback — it always works.
Expand Down Expand Up @@ -86,7 +86,7 @@ When spawning, include the model in your acknowledgment:

```
🔧 Fenster (claude-sonnet-4.6) — refactoring auth module
🎨 Redfoot (claude-opus-4.5 · vision) — designing color system
🎨 Redfoot (claude-opus-4.6 · vision) — designing color system
📋 Scribe (claude-haiku-4.5 · fast) — logging session
⚡ Keaton (claude-opus-4.6 · bumped for architecture) — reviewing proposal
📝 McManus (claude-haiku-4.5 · fast) — updating docs
Expand All @@ -96,6 +96,6 @@ Include tier annotation only when the model was bumped or a specialist was chose

**Valid models (current platform catalog):**

Premium: `claude-opus-4.6`, `claude-opus-4.6-1m` (Internal only), `claude-opus-4.5`
Standard: `claude-sonnet-4.6`, `claude-sonnet-4.5`, `claude-sonnet-4`, `gpt-5.4`, `gpt-5.3-codex`, `gpt-5.2-codex`, `gpt-5.2`, `gpt-5.1-codex-max`, `gpt-5.1-codex`, `gpt-5.1`, `gemini-3-pro-preview`
Fast/Cheap: `claude-haiku-4.5`, `gpt-5.4-mini`, `gpt-5.1-codex-mini`, `gpt-5-mini`, `gpt-4.1`
Premium: `claude-opus-4.6`, `claude-opus-4.7`, `claude-opus-4.8`, `claude-opus-4.6-1m` (Internal only)
Standard: `claude-sonnet-4.6`, `claude-sonnet-4.5`, `claude-sonnet-5`, `gpt-5.4`, `gpt-5.3-codex`, `gpt-5.5`, `gemini-2.5-pro`
Fast/Cheap: `claude-haiku-4.5`, `gpt-5.4-mini`, `gpt-5-mini`
8 changes: 3 additions & 5 deletions .squad-templates/ralph-circuit-breaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Premium models burn quota fast:
| `gpt-5.4` | 50x | Very high |
| `gpt-5.4-mini` | **0x** | **Free — unlimited** |
Comment thread
primetimetank21 marked this conversation as resolved.
| `gpt-5-mini` | **0x** | **Free — unlimited** |
| `gpt-4.1` | **0x** | **Free — unlimited** |

## Circuit Breaker States

Expand All @@ -43,7 +42,6 @@ Premium models burn quota fast:
- Fall back through the free-tier model chain:
1. `gpt-5.4-mini`
2. `gpt-5-mini`
3. `gpt-4.1`
- Start cooldown timer (default: 10 minutes)
- When cooldown expires → transition to HALF-OPEN

Expand All @@ -58,7 +56,7 @@ Premium models burn quota fast:
{
"state": "closed",
"preferredModel": "claude-sonnet-4.6",
"fallbackChain": ["gpt-5.4-mini", "gpt-5-mini", "gpt-4.1"],
"fallbackChain": ["gpt-5.4-mini", "gpt-5-mini"],
"currentFallbackIndex": 0,
"cooldownMinutes": 10,
"openedAt": null,
Expand Down Expand Up @@ -87,7 +85,7 @@ function Get-CircuitBreakerState {
$default = @{
state = "closed"
preferredModel = "claude-sonnet-4.6"
fallbackChain = @("gpt-5.4-mini", "gpt-5-mini", "gpt-4.1")
fallbackChain = @("gpt-5.4-mini", "gpt-5-mini")
currentFallbackIndex = 0
cooldownMinutes = 10
openedAt = $null
Expand Down Expand Up @@ -294,7 +292,7 @@ Override defaults by editing `.squad/ralph-circuit-breaker.json`:
| Field | Default | Description |
|-------|---------|-------------|
| `preferredModel` | `claude-sonnet-4.6` | Model to use when circuit is closed |
| `fallbackChain` | `["gpt-5.4-mini", "gpt-5-mini", "gpt-4.1"]` | Ordered fallback models (all free-tier) |
| `fallbackChain` | `["gpt-5.4-mini", "gpt-5-mini"]` | Ordered fallback models (all free-tier) |
| `cooldownMinutes` | `10` | How long to wait before testing recovery |

## Metrics
Expand Down
12 changes: 6 additions & 6 deletions .squad/skills/economy-mode/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ When economy mode is **active**, Layer 3 auto-selection uses this table instead

| Task Output | Normal Mode | Economy Mode |
|-------------|-------------|--------------|
| Writing code (implementation, refactoring, bug fixes) | `claude-sonnet-4.5` | `gpt-4.1` or `gpt-5-mini` |
| Writing prompts or agent designs | `claude-sonnet-4.5` | `gpt-4.1` or `gpt-5-mini` |
| Docs, planning, triage, changelogs, mechanical ops | `claude-haiku-4.5` | `gpt-4.1` or `gpt-5-mini` |
| Architecture, code review, security audits | `claude-opus-4.5` | `claude-sonnet-4.5` |
| Scribe / logger / mechanical file ops | `claude-haiku-4.5` | `gpt-4.1` |
| Writing code (implementation, refactoring, bug fixes) | `claude-sonnet-4.5` | `gpt-5-mini` |
| Writing prompts or agent designs | `claude-sonnet-4.5` | `gpt-5-mini` |
| Docs, planning, triage, changelogs, mechanical ops | `claude-haiku-4.5` | `gpt-5-mini` |
| Architecture, code review, security audits | `claude-opus-4.6` | `claude-sonnet-4.5` |
| Scribe / logger / mechanical file ops | `claude-haiku-4.5` | `gpt-5-mini` |

**Prefer `gpt-4.1` over `gpt-5-mini`** when the task involves structured output or agentic tool use. Prefer `gpt-5-mini` for pure text generation tasks where latency matters.
**Prefer `gpt-5-mini`** for all economy-mode tasks where cost is the priority.

## AGENT WORKFLOW

Expand Down
6 changes: 3 additions & 3 deletions .squad/skills/model-selection/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ After resolving the model and including it in the spawn template, this skill is
If a model is unavailable (rate limit, plan restriction), retry within the same tier:

```
Premium: claude-opus-4.6 → claude-opus-4.6-fastclaude-opus-4.5 → claude-sonnet-4.6
Standard: claude-sonnet-4.6 → gpt-5.4 → claude-sonnet-4.5 → gpt-5.3-codex → claude-sonnet-4
Fast: claude-haiku-4.5 → gpt-5.1-codex-mini → gpt-4.1 → gpt-5-mini
Premium: claude-opus-4.6 → claude-sonnet-4.6 → (omit model param)
Standard: claude-sonnet-4.6 → gpt-5.4 → claude-sonnet-4.5 → gpt-5.3-codex → (omit model param)
Fast: claude-haiku-4.5 → gpt-5.4-mini → gpt-5-mini → (omit model param)
```

**Never fall UP in tier.** A fast task won't land on a premium model via fallback.
2 changes: 1 addition & 1 deletion packages/squad-cli/src/cli-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async function main(): Promise<void> {
console.log(` Usage: start [--tunnel] [--port <n>] [--command <cmd>]`);
console.log(` [copilot flags...]`);
console.log(` Examples: start --tunnel --yolo`);
console.log(` start --tunnel --model claude-sonnet-4`);
console.log(` start --tunnel --model claude-sonnet-4.6`);
console.log(` start --tunnel --command "gh copilot"`);
console.log(` ${BOLD}nap${RESET} Context hygiene (compress, prune, archive .squad/ state)`);
console.log(` Usage: nap [--deep] [--dry-run]`);
Expand Down
4 changes: 2 additions & 2 deletions packages/squad-cli/src/cli/commands/economy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export async function runEconomy(cwd: string, subArgs: string[]): Promise<void>
if (enabled) {
console.log(` When active, auto-selected models are downgraded:`);
console.log(` ${DIM}claude-opus-4.6 → claude-sonnet-4.5 (architecture/review)${RESET}`);
console.log(` ${DIM}claude-sonnet-4.6 → gpt-4.1 (code writing)${RESET}`);
console.log(` ${DIM}claude-haiku-4.5 → gpt-4.1 (docs/mechanical)${RESET}`);
console.log(` ${DIM}claude-sonnet-4.6 → gpt-5-mini (code writing)${RESET}`);
console.log(` ${DIM}claude-haiku-4.5 → gpt-5-mini (docs/mechanical)${RESET}`);
console.log(` Explicit overrides (config.json, charter) are never changed.\n`);
} else {
console.log(` Usage: squad economy on | off\n`);
Expand Down
2 changes: 1 addition & 1 deletion packages/squad-cli/src/cli/core/command-help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const COMMAND_HELP: Record<string, HelpPrinter> = {
console.log(` ${BOLD}--command <cmd>${RESET} Override the agent command (default: copilot)\n`);
console.log(`Examples:`);
console.log(` squad start --tunnel --yolo`);
console.log(` squad start --tunnel --model claude-sonnet-4`);
console.log(` squad start --tunnel --model claude-sonnet-4.6`);
console.log(` squad start --tunnel --command "gh copilot"\n`);
},

Expand Down
2 changes: 1 addition & 1 deletion packages/squad-cli/src/cli/shell/error-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function rateLimitGuidance(opts?: { retryAfter?: number; model?: string }
recovery: [
retryStr,
'Enable economy mode to switch to cheaper models: `squad economy on`',
'Or set a different model: add `"defaultModel": "gpt-4.1"` to .squad/config.json',
'Or set a different model: add `"defaultModel": "gpt-5-mini"` to .squad/config.json',
],
};
}
Expand Down
Loading
Loading