Merge origin/main into bb/tui-parity-mutating-commands

Resolve session command merge conflict and keep the branch current with main so PR #16656 is mergeable.
This commit is contained in:
Brooklyn Nicholson 2026-04-27 12:51:11 -05:00
commit 8bd5d0667a
8 changed files with 27 additions and 23 deletions

View file

@ -16,17 +16,9 @@ import { patchOverlayState } from '../../overlayStore.js'
import { patchUiState } from '../../uiStore.js'
import type { SlashCommand } from '../types.js'
const GLOBAL_MODEL_FLAG_RE = /(?:^|\s)--global(?:\s|$)/
const TUI_SESSION_MODEL_RE = new RegExp(`(?:^|\\s)${TUI_SESSION_MODEL_FLAG}(?:\\s|$)`)
const TUI_SESSION_STRIP_RE = new RegExp(`\\s*${TUI_SESSION_MODEL_FLAG}\\b\\s*`, 'g')
const persistedModelArg = (arg: string) => {
const trimmed = arg.trim()
return !trimmed || GLOBAL_MODEL_FLAG_RE.test(trimmed) ? trimmed : `${trimmed} --global`
}
const stripTuiSessionFlag = (trimmed: string) => trimmed.replace(TUI_SESSION_STRIP_RE, ' ').replace(/\s+/g, ' ').trim()
const modelValueForConfigSet = (arg: string) => {
@ -40,7 +32,7 @@ const modelValueForConfigSet = (arg: string) => {
return stripTuiSessionFlag(trimmed)
}
return persistedModelArg(trimmed)
return trimmed
}
export const sessionCommands: SlashCommand[] = [