This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Merged
Conversation
- Created scripts/update-models.ts to fetch and filter models from models.dev API - Added pnpm update-models command to package.json - Generated initial models.json with 39 models from 3 providers - Filtered to only include anthropic, groq, and openrouter providers - Added tsx as dev dependency for TypeScript execution Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- Refactored types/models.ts with new Provider and Model interfaces - Added support for OAuth authentication alongside API keys - Created useModels hook for favorites management and model data loading - Added comprehensive auth utils with OAuth PKCE flow implementation - Updated apiKeys.ts to use new auth system for backward compatibility - Created OAuthCallback component for OAuth flow completion - Added support for OpenRouter OAuth configuration Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
…th support - Refactored ModelSelector to use new favorites-based system with search and filtering - Added star ratings for favorite models with local storage persistence - Added search functionality to filter models by name/provider - Added "Tools Only" and "Favorites" filter toggles - Updated authentication to support OAuth PKCE flow alongside API keys - Added OpenRouter OAuth support with proper error handling - Updated ConversationThread, ModelSelectionModal, and ApiKeyModal to use new Provider type - Added OAuth success message handling in ChatApp - Updated useStreamResponse to support OpenRouter via @ai-sdk/openai - Fixed all TypeScript compilation errors for new model system - Added proper auth headers for all three providers (Groq, Anthropic, OpenRouter) Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- Fixed unused import in useStreamResponse.ts - Added .env.example for OpenRouter OAuth configuration - Created comprehensive MODEL_SELECTOR_GUIDE.md with usage instructions - Documented all features including favorites, search, filtering, and OAuth - Added setup instructions for OpenRouter OAuth - Included troubleshooting guide and local storage details Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- Refactored ModelSelector to show providers first, then starred models - Created ProviderModelsModal for provider-specific model selection and starring - Removed search/filter complexity from main dropdown - Added handleProviderSelect to route between OAuth/API key flows - OAuth providers show model selection after successful authentication - API key providers show model selection after key entry - Starred models appear grayed out when provider not configured - Clicking unconfigured starred model redirects to provider setup - Added OAuth success message handling to auto-open provider models - Clean two-step workflow: configure provider → select/star models Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- Replaced the old flat model list in ModelSelectionModal with provider-first design - Shows 3 provider cards (Anthropic, Groq, OpenRouter) with auth status - Added starred models section below providers (empty initially) - OAuth flow for OpenRouter, API key modals for Anthropic/Groq - Provider selection leads to ProviderModelsModal for browsing and starring - Grayed out starred models when provider not configured - Click unconfigured starred model redirects to provider setup - OAuth success automatically opens provider models modal - Clean, intuitive workflow: Select Provider → Configure Auth → Browse Models → Star Favorites Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- Updated authorization URL from /oauth/authorize to /auth
- Changed token URL to /api/v1/auth/keys
- Removed client_id requirement (OpenRouter doesn't use it)
- Removed scopes (OpenRouter doesn't use them)
- Updated OAuth flow to use callback_url instead of redirect_uri
- Changed token exchange to use JSON body instead of form data
- Handle OpenRouter's response format {key: "..."} instead of {access_token: "..."}
- Made state parameter optional for OpenRouter (they don't use it)
- Updated sessionStorage handling for providers without state parameter
- Simplified .env.example to remove client_id requirement
Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a
Co-authored-by: Amp <amp@ampcode.com>
- **Fixed multiple useModels hook instances**: Removed duplicate hook from ModelSelectionModal and consolidated all model state management in ChatApp - **Fixed auto-starring**: Models are now automatically starred when selected from any UI (provider modal or favorites list) - **Fixed favorites persistence**: Starred models now properly persist in localStorage and are restored on page refresh - **Fixed selected model highlighting**: Currently selected model is now highlighted in the starred models list with blue border, ring effect, and checkmark - **Improved prop passing**: Pass all model-related functions (addToFavorites, toggleFavorite, isFavorite, getFavoriteModels) down through ChatApp → ConversationThread → ModelSelectionModal - **Removed debug logs**: Cleaned up console.log statements added during debugging The root cause was multiple instances of the useModels hook running simultaneously, causing state conflicts where one instance would load favorites correctly but another would reset them to an empty array. Now there's a single source of truth for all model state in ChatApp. This fixes the specific issues where: 1. Selected models weren't being auto-starred 2. Starred models list was forgotten on page refresh 3. Selected model highlighting wasn't working in the modal Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- **Improved UX**: Replaced stacked modals with a single modal that switches between views - **Added back navigation**: Provider models view now has a back button in the top left to return to main view - **Unified modal structure**: Single modal container with conditional rendering for main vs provider views - **Added search functionality**: Provider models view includes a search bar to filter models - **Better visual hierarchy**: Provider view shows provider logo and name in header - **Removed ProviderModelsModal**: Consolidated functionality into ModelSelectionModal - **Enhanced interaction**: Cleaner navigation flow without modal stacking Main view shows: - List of providers with authentication status - Starred models section Provider view shows: - Back button + provider logo/name in header - Search bar for filtering models - List of provider's models with star/select actions - Model count at bottom This creates a much more intuitive navigation experience similar to mobile app patterns, avoiding the confusing nested modal behavior. Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- **Fixed height constraints**: Modal now uses flexbox layout with proper height management - **Added flex-shrink-0 to header**: Prevents header from shrinking and maintains fixed height - **Added flex-1 min-h-0 to content**: Allows content area to take remaining space and scroll properly - **Improved responsive behavior**: Modal content now scrolls vertically when overflowing on smaller screens Key changes: - Modal container: Added `flex flex-col` for vertical layout - Header: Added `flex-shrink-0` to maintain fixed height - Content area: Added `flex-1 min-h-0` to fill remaining space and enable scrolling This ensures that: 1. Header stays fixed at top 2. Content area takes remaining vertical space 3. Content scrolls independently when overflowing 4. Works properly on all screen sizes, including small screens with many models Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
- **Improved UX consistency**: Provider model rows now behave like starred model rows - **Full row clickable**: Click anywhere in the row to select and star the model - **Event handling**: Star button uses stopPropagation to prevent row click when toggling favorites - **Visual clarity**: Replaced "Select" button with subtle "Click to select" hint - **Added cursor pointer**: Clear visual indication that rows are clickable Changes: - Added `cursor-pointer` and `onClick` to model rows in provider view - Star button now stops event propagation to allow independent toggling - Removed separate "Select" button for cleaner, more consistent interface - Added "Click to select" text hint on the right side This creates a consistent interaction pattern across both: - Main view starred models (click row to select) - Provider view models (click row to select and star) Users can now efficiently browse and select models with single clicks, while still having granular control over favorites via the star button. Amp-Thread: https://ampcode.com/threads/T-918d21db-3d47-4c6f-a3d8-96a60b59674a Co-authored-by: Amp <amp@ampcode.com>
commit: |
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.
Using the PKCE popup: https://openrouter.ai/docs/use-cases/oauth-pkce
Also refactored the way the model selector, works. Looking great!