Skip to content

feat(model): add family_style map for new model families - #195

Merged
stephenleo merged 2 commits into
stephenleo:mainfrom
Romboter:feat/model-family-style-map
Jul 25, 2026
Merged

feat(model): add family_style map for new model families#195
stephenleo merged 2 commits into
stephenleo:mainfrom
Romboter:feat/model-family-style-map

Conversation

@Romboter

@Romboter Romboter commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Adds a family_style config map to [cship.model], so users can style new model families (e.g. Fable) the moment they ship, without waiting on a cship release. Complements the existing haiku_style/sonnet_style/opus_style fields, which still take priority for back-compat.

  • Case-insensitive substring matching — mirrors the existing haiku/sonnet/opus behavior; matched against model.id (fallback: display_name).
  • Longest matching key wins on overlap — if two family_style entries both substring-match the same model, the more specific (longer) key is used instead of relying on HashMap's unspecified iteration order.
  • Empty keys ignored — an empty key would otherwise match every model; logged once via tracing::warn!, mirroring the FILL_WARNED pattern in renderer.rs.
  • Docs updated: docs/configuration.md — field reference, precedence order, and both TOML forms (dotted-key and table).

Verification

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test ✅ (487 unit + 73 integration)
  • cargo build --release

🤖 Generated with Claude Code

Allow users to style model families cship does not hardcode, such as
Fable, through config alone. Legacy haiku_style, sonnet_style, and
opus_style entries still take priority for compatibility.

Family matching is case-insensitive, empty keys are ignored with a
warn-once diagnostic, and the longest matching key wins on overlap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…dling

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stephenleo
stephenleo merged commit 0aee72f into stephenleo:main Jul 25, 2026
3 checks passed
@stephenleo stephenleo mentioned this pull request Aug 4, 2026
stephenleo added a commit that referenced this pull request Aug 4, 2026
Bumps to 1.8.1 and closes out the Unreleased section, adding the
missing changelog entries for the config JSON schema (#197) and the
model family_style map (#195).

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants