You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 fix: validate /compact model format before persisting message (#1109)
Fixes janky `/compact` slash-command behavior where commands with
invalid model formats would show up in chat history even though the
request failed.
## Changes
- **Backend validation (agentSession.ts)**: Validate model format before
persisting user message to history. Invalid model strings (missing
provider prefix) are now rejected before the message is saved,
preventing orphaned compaction request messages.
- **Frontend validation (chatCommands.ts)**: Fail fast in `/compact`
handler when model format is invalid, showing a clear toast error with
example format.
- **Helper function**: Add `isValidModelFormat()` to check for
`provider:model-id` format (supports colons in model ID for ollama-style
names).
- **Preference poisoning fix**: Stop eagerly saving compaction model to
localStorage, preventing invalid model values from affecting future
`/compact` commands.
## Testing
- Added unit tests for `isValidModelFormat()`
- Updated integration test for invalid model format error handling
_Generated with `mux`_
0 commit comments