Skip to content

refactor(types): canonicalize shared provider settings identifiers - #1109

Open
WebMad wants to merge 1 commit into
Zoo-Code-Org:mainfrom
WebMad:refactor/944-canonical-provider-settings
Open

refactor(types): canonicalize shared provider settings identifiers#1109
WebMad wants to merge 1 commit into
Zoo-Code-Org:mainfrom
WebMad:refactor/944-canonical-provider-settings

Conversation

@WebMad

@WebMad WebMad commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace raw discriminator literals in shared provider settings schemas with providerIdentifiers
  • use computed canonical identifier keys in modelIdKeysByProvider
  • canonicalize keys and repeated id values in MODELS_BY_PROVIDER
  • derive provider exclusions from typeof providerIdentifiers.<provider>
  • add regression coverage that keeps provider-indexed settings aligned with the canonical registry

Implements item 1 from #944 (comment).

Test plan

  • pnpm exec vitest run src/__tests__/provider-settings.test.ts src/__tests__/provider-identifiers.test.ts from packages/types
  • pnpm exec eslint src/provider-settings.ts src/__tests__/provider-identifiers.test.ts --max-warnings=0 from packages/types
  • pnpm run check-types from packages/types
  • repository commit/push hooks, including workspace lint and type checking

Summary by CodeRabbit

  • Bug Fixes

    • Improved consistency of provider identification across model settings and provider-specific configurations.
    • Ensured provider mappings use canonical identifiers, reducing the risk of mismatched or invalid model associations.
  • Tests

    • Added coverage to verify provider identifiers remain aligned across supported model configurations.
    • Confirmed designated providers are correctly handled in model ID mappings.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@WebMad, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 01681801-78cd-4586-9655-4d310a9e0861

📥 Commits

Reviewing files that changed from the base of the PR and between fe11b3b and 9819602.

📒 Files selected for processing (2)
  • packages/types/src/__tests__/provider-identifiers.test.ts
  • packages/types/src/provider-settings.ts
📝 Walkthrough

Walkthrough

The change replaces hard-coded provider identifiers in provider settings and model mappings with providerIdentifiers constants. Tests now verify alignment between canonical identifiers, provider-indexed model settings, and model collection provider IDs.

Changes

Provider identifier consistency

Layer / File(s) Summary
Canonical provider settings and model mappings
packages/types/src/provider-settings.ts
Provider-specific schemas, modelIdKeysByProvider, and MODELS_BY_PROVIDER now use providerIdentifiers constants. Provider entries and exclusions remain unchanged.
Provider mapping consistency validation
packages/types/src/__tests__/provider-identifiers.test.ts
Tests verify canonical provider keys, excluded providers, and matching provider IDs in MODELS_BY_PROVIDER entries.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested labels: awaiting-review

Suggested reviewers: taltas, edelauna

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the canonicalization of shared provider settings identifiers.
Description check ✅ Passed The description explains the implementation and test procedure, but it omits the template headings and pre-submission checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WebMad
WebMad force-pushed the refactor/944-canonical-provider-settings branch 3 times, most recently from 4f9941b to 0bb9e56 Compare August 3, 2026 20:38
@WebMad
WebMad force-pushed the refactor/944-canonical-provider-settings branch from 0bb9e56 to 9819602 Compare August 3, 2026 20:42
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant