feat: add custom AI provider icons and instance-based model picker grouping - #27026
Merged
Conversation
Docs preview📖 View docs preview for |
DanielleMaywood
marked this pull request as ready for review
July 6, 2026 21:38
ibetitsmike
approved these changes
Jul 6, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Custom AI providers (e.g. an anthropic-compatible provider named "Hyper") were shown under their provider type label ("Anthropic") in the chat model picker, and providers had no way to set a custom icon.
Changes
Model picker grouping/labels
Custom provider icons
iconcolumn toai_providers, plumbed through queries, audit table,codersdk(AIProvider, create/update requests,AIProviderSummary,ChatProviderConfig,UserChatProviderConfig), and handlers.IconPickerFieldas the MCP servers page, pre-filled with the current type-based icon. The page header avatar live-previews the picked icon.ProviderIconand the providers list prefer the custom icon over the type mapping.Shared
IconPickerFieldfixInputGroupAddon's click handler, which refocused the text input (stealing focus from the picker's search box and dismissing the popover). Fixed with astopPropagationon the popover content; verified in a real browser on both the provider and MCP server forms.Out of scope: the type-based icon maps on the AI Gateway pages and ChatModelAdminPanel are unchanged; they render historical usage by provider type.
Testing
make gen,make fmt,make lint,pnpm check,tscTestAIProvidersCRUD,TestUserAIProviderKeysmodelOptions.test.ts,ModelSelector.test.tsx,providerFormApiMap.test.ts; new/updated Storybook storiesDecision log
providerId/providerLabel/providerIcontoModelSelectorOptionrather than repurposing the existingprovider(type) field, which is still used for icon fallback and selection semantics.icon(matching the templates pattern) rather thanicon_url; the form reuses the MCP page'sIconPickerFieldper review feedback, replacing the initialIconFieldapproach.onFocusOutsideguard inIconPickerFieldwas removed once theInputGroupAddonfocus-steal root cause was found; the surviving fix is a singlestopPropagation.ProviderFormnotifies the page header of icon changes via a directonIconChangecallback in the change handler (nouseEffecton state).🤖 This PR was generated by Coder Agents on behalf of @DanielleMaywood.