🤖 Add Haiku 4-5 support and centralize default model logic #267
+1,236
−333
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
Adds support for Claude Haiku 4-5 (released today) and simplifies default model selection by centralizing logic in the LRU system.
Changes
Haiku 4-5 Support
haiku: "anthropic:claude-haiku-4-5"to MODEL_ABBREVIATIONSmodels-extra.ts:Centralized Default Model Logic
Problem:
defaultModelwas imported in 7+ files, spreading model prescription throughout the codebase.Solution: Created
getDefaultModelFromLRU()helper that reads the most recently used model from the LRU cache. This is now the single source of truth for default model selection.Architecture:
Updated files:
src/hooks/useModelLRU.ts- AddedgetDefaultModelFromLRU()helpersrc/hooks/useSendMessageOptions.ts- Use LRU instead of hardcoded defaultsrc/utils/messages/sendOptions.ts- Use LRU for non-hook contextssrc/hooks/useAIViewKeybinds.ts- Use LRU for keybind fallbacksModel Ordering
sonnetfirstBenefits
✅ Less prescriptive: Most recently used model becomes the default
✅ Single source of truth: Only
useModelLRU.tsimportsdefaultModel✅ Cross-workspace memory: Using Haiku in workspace A makes it default for workspace B
✅ Natural discovery: As users try models, they automatically become defaults
Testing
defaultModelnow)Generated with
cmux