Skip to content

Commit 10cb270

Browse files
jahoomaclaude
andcommitted
Address review: hide /end-session in non-freebuff, recover from model_locked
- Add end-session to FREEBUFF_ONLY_COMMANDS so non-freebuff users can't invoke it (would have shown a confusing "returning to waiting room" message with no underlying state to act on). - When the waiting room receives model_locked from a switch attempt that raced with admission, silently revert the local model selection to the active session's model and re-tick. Previously polling halted and the screen had no render branch, leaving the UI blank. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent ba8eaf2 commit 10cb270

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

cli/src/commands/command-registry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ const FREEBUFF_REMOVED_COMMANDS = new Set([
179179
const FREEBUFF_ONLY_COMMANDS = new Set([
180180
'connect',
181181
'plan',
182+
'end-session',
182183
])
183184

184185
const ALL_COMMANDS: CommandDefinition[] = [

cli/src/hooks/use-freebuff-session.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,17 @@ export function useFreebuffSession(): UseFreebuffSessionResult {
317317
if (cancelled) return
318318
hasPosted = true
319319

320+
// Race recovery: user picked a different model in the waiting room at
321+
// the exact moment the server admitted them with the original model.
322+
// Silently revert the local selection and re-tick so the next call
323+
// (a GET) lands the actual active session. Users who really want to
324+
// switch can /end-session deliberately.
325+
if (next.status === 'model_locked') {
326+
useFreebuffModelStore.getState().setSelectedModel(next.currentModel)
327+
schedule(0)
328+
return
329+
}
330+
320331
if (previousStatus === 'queued' && next.status === 'active') {
321332
playAdmissionSound()
322333
}

0 commit comments

Comments
 (0)