Skip to content

refactor(types): use canonical provider identifiers in categories#989

Open
WebMad wants to merge 2 commits into
Zoo-Code-Org:mainfrom
WebMad:feat/953-provider-category-collections
Open

refactor(types): use canonical provider identifiers in categories#989
WebMad wants to merge 2 commits into
Zoo-Code-Org:mainfrom
WebMad:feat/953-provider-category-collections

Conversation

@WebMad

@WebMad WebMad commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • derive provider category collections from the canonical provider identifier registry introduced by feat(types): centralize provider identifiers #952
  • preserve existing category membership, ordering, public types, and runtime behavior
  • add focused coverage for category values and type guards

Testing

  • focused provider identifier tests: 8 passed
  • @roo-code/types type checking passed
  • @roo-code/types lint passed

Relates to #953 and #944.

Summary by CodeRabbit

  • Improvements
    • Provider category lists and the related provider type sets now derive from the canonical provider identifiers, ensuring consistent supported classifications across dynamic, local, internal, custom, and faux providers.
  • Tests
    • Expanded validation to confirm category collections match the canonical identifier exports exactly.
    • Added checks that each category type guard correctly accepts its own identifiers, rejects unknown providers, and remains mutually exclusive with other categories.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 47eda302-bd9b-4ca3-8a1b-dface0d50549

📥 Commits

Reviewing files that changed from the base of the PR and between 8369dec and 853f8f2.

📒 Files selected for processing (1)
  • packages/types/src/__tests__/provider-identifiers.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/types/src/tests/provider-identifiers.test.ts

📝 Walkthrough

Walkthrough

Provider category arrays now derive their values from canonical providerIdentifiers constants. Tests verify category memberships and validate each category-specific type guard against matching, unknown, and cross-category identifiers.

Changes

Provider registry alignment

Layer / File(s) Summary
Canonical category collections
packages/types/src/provider-settings.ts
Dynamic, local, internal, custom, and faux provider arrays now reference providerIdentifiers values.
Category collection and guard tests
packages/types/src/__tests__/provider-identifiers.test.ts
Tests assert ordered category contents and verify type guards accept matching identifiers while rejecting unknown and cross-category identifiers.

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

Possibly related issues

Possibly related PRs

  • Zoo-Code-Org/Zoo-Code#952 — Refactors provider-related exports around the centralized providerIdentifiers registry and extends corresponding tests.

Suggested labels: awaiting-review

Suggested reviewers: edelauna

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but it omits the required linked issue section and several template sections. Add the required 'Related GitHub Issue' block with Closes: #123 and fill in the missing template sections, especially checklist and reviewer notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main refactor to canonical provider identifiers in categories.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/types/src/__tests__/provider-identifiers.test.ts`:
- Around line 114-139: Extend the “preserves provider category type guards” test
to assert each guard rejects known identifiers belonging to every other provider
category, using representative entries from providerIdentifiers such as ollama.
Keep the existing positive and unknown-provider assertions, and ensure all
category guards have cross-category negative coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dc8187a5-c035-470b-b70f-3951b5ed5d0f

📥 Commits

Reviewing files that changed from the base of the PR and between c24a8c5 and 8369dec.

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

Comment thread packages/types/src/__tests__/provider-identifiers.test.ts
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 22, 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