Skip to content

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

Open
Romboter wants to merge 1 commit into
stephenleo:mainfrom
Romboter:feat/model-family-style-map
Open

feat(model): add family_style map for new model families#195
Romboter wants to merge 1 commit 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>
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.

1 participant