feat(config): validate agent model IDs with actionable error UX - #37
Merged
Conversation
- valid_models_for() now validates model IDs against researched whitelists sourced from: docs.anthropic.com (Claude), developers.openai.com/codex (Codex), and packages/core/src/config/models.ts (Gemini CLI) - Error message is multi-line with a bulleted list of valid IDs and a pointer to .squad/models.md, instead of a comma-separated one-liner - Added .squad/models.md as a human-readable lookup with source URLs - Added !.squad/models.md to .gitignore so the file is tracked for repo contributors - squad-station init now writes .squad/models.md from an embedded template (include_str!) if absent in the project, so end users always get the reference file alongside the validation error message - README points users to .squad/models.md when unsure about model IDs Tests: 411 passing (+2 for write_models_md_if_absent). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- write_models_md_if_absent: replace exists() + write() with atomic OpenOptions::create_new(true) + write_all to close the TOCTOU window where a concurrent init could overwrite a just-written file - Docstring: note that existing .squad/models.md is preserved on upgrade while the Rust whitelist stays authoritative, so the file may lag - .squad/models.md: caveat on the Codex source URL noting it may not be canonical and to re-verify against platform.openai.com if broken Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lippy Replace nested `if` inside `"bmad"` and `"gsd"` match arms with match guards (`arm if condition =>`). Semantics are identical; the guard form makes the intent explicit and satisfies the collapsible_match lint fired by Rust 1.95.0 CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
valid_models_for()insrc/config.rsnow validates model IDs against researched whitelists for all three providers.squad/models.md, instead of a one-liner.squad/models.md— human-readable lookup file with inline source URLssquad-station initauto-generates.squad/models.mdin every project (viainclude_str!) so end users always get the reference file.gitignoreexception for.squad/models.mdso repo contributors also get itREADME.mdpoints users to.squad/models.mdwhen unsure about model IDsSources (fetched 2026-04-24)
claude-opus-4-7,claude-sonnet-4-6,claude-haiku-4-5-20251001+ legacygpt-5.5/5.4/5.4-mini/5.3-codex/5.3-codex-spark/5.2,o4-minigemini-2.5-pro/flash/flash-lite,gemini-3*-preview+ aliases (auto,pro,flash,flash-lite)Test plan
cargo test— 411 passing (+2 forwrite_models_md_if_absent)cargo clippy --all-targets— cleancargo fmt --check— cleansquad-station initin a fresh project, verify.squad/models.mdis createdsquad.yml, verify error message shows bulleted list +.squad/models.mdreferenceNotes
o4-miniis included despite not appearing on the official Codex models page — it is the documented default in Codex CLI (see bug: o4-mini is not in the list of available models; yet it is the default openai/codex#486). Flagged with an inline comment.valid_models_for)..squad/models.mdis a human reference only and is not parsed at runtime — keeps init safe on fresh projects where.squad/does not yet exist.🤖 Generated with Claude Code