Exclude slackbot-only models from /openrouter/models by default#149
Draft
kiloconnect[bot] wants to merge 2 commits intomainfrom
Draft
Exclude slackbot-only models from /openrouter/models by default#149kiloconnect[bot] wants to merge 2 commits intomainfrom
kiloconnect[bot] wants to merge 2 commits intomainfrom
Conversation
Add includeSlackbotOnly query parameter to opt in to including
slackbot-only models in the response. The useModelSelectorList hook
accepts an optional { includeSlackbotOnly } parameter that passes
the query param through to the API.
Contributor
Author
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (6 files)
|
…dels in cron sync - /api/organizations/[id]/models: filter out slackbot_only by default, with ?includeSlackbotOnly=true query param to opt back in - /api/cron/sync-model-stats: explicitly include slackbot_only models since stats sync needs the complete model set - /api/organizations/[id]/defaults: already uses default filtering (no slackbot_only), which is correct for default model selection
Contributor
Author
|
| Consumer | File | Should filter slackbot_only? | Action taken |
|---|---|---|---|
/api/openrouter/models |
src/app/api/openrouter/models/route.ts |
✅ Yes — user-facing model selector | Already filtered (PR #149) |
/api/organizations/[id]/models |
src/app/api/organizations/[id]/models/route.ts → organization-settings-router.ts |
✅ Yes — org model selector, same use case | Updated: filters by default, ?includeSlackbotOnly=true to opt in |
/api/organizations/[id]/defaults |
src/app/api/organizations/[id]/defaults/route.ts |
✅ Yes — picks a default model for the org | No change needed: already uses default getEnhancedOpenRouterModels() which filters out slackbot_only |
/api/cron/sync-model-stats |
src/app/api/cron/sync-model-stats/route.ts |
❌ No — needs complete model set for stats sync | Updated: explicitly passes { includeSlackbotOnly: true } to preserve current behavior |
| : '/api/openrouter/models'; | ||
| const response = await fetch( | ||
| organizationId ? `/api/organizations/${organizationId}/models` : '/api/openrouter/models' | ||
| organizationId ? `/api/organizations/${organizationId}/models` : modelsUrl |
Contributor
Author
There was a problem hiding this comment.
WARNING: includeSlackbotOnly option is ignored when organizationId is set
useModelSelectorList() adds includeSlackbotOnly to the query key and builds a URL for /api/openrouter/models, but when organizationId is present it fetches /api/organizations/:id/models without forwarding the query param. That makes includeSlackbotOnly a no-op for org-scoped requests (likely the common case).
Suggested change
| organizationId ? `/api/organizations/${organizationId}/models` : modelsUrl | |
| organizationId ? `/api/organizations/${organizationId}/models${includeSlackbotOnly ? '?includeSlackbotOnly=true' : ''}` : modelsUrl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
/openrouter/modelsand/api/organizations/[id]/modelsendpoints now exclude slackbot-only models (e.g.anthropic/claude-opus-4.6:slackbot,minimax/minimax-m2.1:slackbot) by default. These models are only relevant for Kilo for Slack integrations and should not appear in the standard model selector.Changes
Backend
src/lib/providers/openrouter/index.ts:enhancedModelList()andgetEnhancedOpenRouterModels()now accept an{ includeSlackbotOnly }option. When false (default), models withslackbot_only: trueare filtered out.src/app/api/openrouter/models/route.ts: Reads?includeSlackbotOnly=truequery parameter and passes it through.src/app/api/organizations/[id]/models/route.ts: Reads?includeSlackbotOnly=truequery parameter and passes it through to the tRPClistAvailableModelsprocedure.src/routers/organizations/organization-settings-router.ts:listAvailableModelsacceptsincludeSlackbotOnlyin its input and passes it togetEnhancedOpenRouterModels().src/app/api/cron/sync-model-stats/route.ts: Explicitly passes{ includeSlackbotOnly: true }to preserve complete model set for stats syncing.Frontend
src/app/api/openrouter/hooks.ts:useModelSelectorList()accepts an optional second argument{ includeSlackbotOnly }. When true, appends the query param to the fetch URL. The query key includes this flag so React Query caches them separately.Usage
Built for Christiaan by Kilo for Slack