fix: show Snowflake Cortex in provider list before authentication#447
fix: show Snowflake Cortex in provider list before authentication#447anandgupta42 merged 2 commits intomainfrom
Conversation
Snowflake Cortex was invisible in the UI because it has no env var trigger (env: []) and is plugin-auth only — it only appeared after the user had already completed the auth flow, making it undiscoverable. - Add Provider.all() to expose the full internal provider database (including unauthenticated custom providers like Snowflake Cortex) - Inject custom providers into GET /provider so Snowflake Cortex appears in the UI before auth, letting users find and authenticate it - Add tests: Provider.all() unauthenticated, disabled_providers and enabled_providers config filtering for custom providers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review.
Tip: disable this comment in your organization's Code Review settings.
📝 WalkthroughWalkthroughThe Provider namespace now exposes its internal database through a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/opencode/test/provider/snowflake.test.ts (1)
661-715: Test filtering logic differs slightly from route implementation.The route uses
filteredProviders(from ModelsDev) in its de-duplication check, but these tests only check againstconnected. Sincesnowflake-cortexisn't in ModelsDev anyway, this doesn't affect test correctness, but the comment "Simulate the route filtering" is slightly misleading.Consider adding a comment noting this simplification:
// Simulate route filtering with enabled_providers - // (snowflake-cortex is not in the enabled list, so it should be excluded) + // Simplified: only checks connected, not filteredProviders (from ModelsDev) + // since snowflake-cortex is a custom provider not in ModelsDev anyway const enabled = new Set(["anthropic"])🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/opencode/test/provider/snowflake.test.ts` around lines 661 - 715, The test simulates route filtering but uses connected (from Provider.list()) instead of the route's de-duplication set filteredProviders (from ModelsDev); update the test comments around Provider.all/Provider.list to explicitly state this simplification and that filteredProviders is used in the actual route de-duplication logic so readers know why the test uses connected rather than the exact route implementation (refer to Provider.all, Provider.list, and filteredProviders / ModelsDev in the comment).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/opencode/test/provider/snowflake.test.ts`:
- Around line 661-715: The test simulates route filtering but uses connected
(from Provider.list()) instead of the route's de-duplication set
filteredProviders (from ModelsDev); update the test comments around
Provider.all/Provider.list to explicitly state this simplification and that
filteredProviders is used in the actual route de-duplication logic so readers
know why the test uses connected rather than the exact route implementation
(refer to Provider.all, Provider.list, and filteredProviders / ModelsDev in the
comment).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 954ffcfe-6b2f-4b7e-9664-23416255b488
📒 Files selected for processing (3)
packages/opencode/src/provider/provider.tspackages/opencode/src/server/routes/provider.tspackages/opencode/test/provider/snowflake.test.ts
Summary
env: []) and is plugin-auth only — it only appeared after the user had already completed the auth flow, making it undiscoverableProvider.all()to expose the full internal provider database (including unauthenticated custom providers)GET /providerso Snowflake Cortex appears in thealllist before auth, letting users find and authenticate it from the UITest plan
Provider.all()returnssnowflake-cortexregardless of auth statedisabled_providers: ["snowflake-cortex"]suppresses it from the listenabled_providers: ["anthropic"]suppresses it from the listProvider.list()still returns nothing until authenticated (existing behaviour unchanged)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Tests