Skip to content

feat(catalog): ✨ Normalize provider model suffixes - #150

Merged
jorben merged 1 commit into
masterfrom
feat/catalog-model-normalizer
Apr 28, 2026
Merged

feat(catalog): ✨ Normalize provider model suffixes#150
jorben merged 1 commit into
masterfrom
feat/catalog-model-normalizer

Conversation

@jorben

@jorben jorben commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add catalog model ID normalization for provider suffixes like :deepseek, :free, and -free.
  • Wrap loaded catalog metadata stores so automatic model fetch and manual model enrichment share the same normalized matching behavior.
  • Add focused Rust tests for one-pass normalization of routed and free model IDs.

Test Plan

  • cargo fmt --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml catalog_model_id_normalizer
  • cargo test --manifest-path src-tauri/Cargo.toml settings

🤖 Generated with TiyCode

@github-actions

Copy link
Copy Markdown

AI Code Review Summary

PR: #150 (feat(catalog): ✨ Normalize provider model suffixes)
Preferred language: English

Overall Assessment

No blocking issue was detected in the reviewed diff; keep focused regression testing before merge.

Major Findings by Severity

No major issues identified from the reviewed diff.

Actionable Suggestions

  • Add an empty-string guard in normalize_alias_for_catalog_match to avoid injecting empty aliases.
  • Expand unit tests in catalog_model_id_normalizer to cover whitespace, multi-colon, and empty-alias scenarios.

Potential Risks

  • Catalog lookups may include empty aliases if alias strings normalize to empty, potentially causing incorrect matching behavior.

Test Suggestions

  • Add unit tests for normalize_alias_for_catalog_match with inputs that yield empty strings.
  • Add unit tests for suffix_token_for_catalog_match and normalize_suffix_token with whitespace-heavy inputs.
  • Verify catalog model resolution integration tests still pass with the NormalizingCatalogMetadataStore wrapper.

File-Level Coverage Notes

  • src-tauri/src/core/catalog_model_id_normalizer.rs: Well-structured new module with clean delegation pattern and clear normalization logic. Minor concerns about empty alias handling and test coverage for edge cases. (The RecordingCatalogStore test double is a nice pattern for verifying normalized parameters.)
  • src-tauri/src/core/mod.rs: Trivial addition of module declaration; no risk. (Standard module registration.)
  • src-tauri/src/core/settings_manager.rs: Straightforward integration of NormalizingCatalogMetadataStore wrapper around the existing catalog store. No regressions introduced. (The wrapper is applied consistently on both the no-refresh and refresh paths.)

Inline Downgraded Items (processed but not inline)

  • None

Coverage Status

  • Target files: 3
  • Covered files: 3
  • Uncovered files: 0
  • No-patch/binary covered as file-level: 0
  • Findings with unknown confidence (N/A): 0

Uncovered list:

  • None

No-patch covered list:

  • None

Runtime/Budget

  • Rounds used: 1/4
  • Planned batches: 1
  • Executed batches: 1
  • Sub-agent runs: 1
  • Planner calls: 1
  • Reviewer calls: 1
  • Model calls: 2/64
  • Structured-output summary-only degradation: NO

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 0
  • Findings with unknown confidence: 0
  • Inline comments attempted: 1
  • Target files: 3
  • Covered files: 3
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

@@ -0,0 +1,278 @@
use std::borrow::Cow;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed for this PR diff. No concrete inline issue was selected after aggregation.

@jorben
jorben merged commit 3139692 into master Apr 28, 2026
4 checks passed
@jorben
jorben deleted the feat/catalog-model-normalizer branch April 28, 2026 08:56
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