Skip to content

Commit 1bedbc8

Browse files
committed
cli: Change mode label FAST to DEFAULT
1 parent 8fb815f commit 1bedbc8

File tree

9 files changed

+50
-37
lines changed

9 files changed

+50
-37
lines changed

cli/src/__tests__/unit/agent-mode-toggle.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { createHoverToggleControllerForTest } from '../mocks/hover-toggle-contro
66
import type { AgentMode } from '../../utils/constants'
77

88
describe('AgentModeToggle - buildExpandedSegments', () => {
9-
const modes: AgentMode[] = ['FAST', 'MAX', 'PLAN']
9+
const modes: AgentMode[] = ['DEFAULT', 'MAX', 'PLAN']
1010

1111
for (const mode of modes) {
1212
test(`returns segments with active indicator for ${mode}`, () => {
@@ -29,17 +29,17 @@ describe('AgentModeToggle - buildExpandedSegments', () => {
2929

3030
describe('AgentModeToggle - resolveAgentModeClick', () => {
3131
test('clicking active indicator returns closeActive', () => {
32-
const action = resolveAgentModeClick('FAST', 'active-FAST', true)
32+
const action = resolveAgentModeClick('DEFAULT', 'active-DEFAULT', true)
3333
expect(action).toEqual({ type: 'closeActive' })
3434
})
3535

3636
test('with onSelectMode provided, clicking different mode selects it', () => {
37-
const action = resolveAgentModeClick('FAST', 'MAX', true)
37+
const action = resolveAgentModeClick('DEFAULT', 'MAX', true)
3838
expect(action).toEqual({ type: 'selectMode', mode: 'MAX' })
3939
})
4040

4141
test('without onSelectMode, clicking different mode toggles', () => {
42-
const action = resolveAgentModeClick('FAST', 'PLAN', false)
42+
const action = resolveAgentModeClick('DEFAULT', 'PLAN', false)
4343
expect(action).toEqual({ type: 'toggleMode', mode: 'PLAN' })
4444
})
4545
})

cli/src/__tests__/unit/segmented-control.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,27 @@ const theme: ChatTheme = {
6969
describe('SegmentedControl - processSegments', () => {
7070
test('computes width from label using string-width', () => {
7171
const segments: Segment[] = [
72-
{ id: 'FAST', label: 'FAST' },
72+
{ id: 'DEFAULT', label: 'DEFAULT' },
7373
{ id: 'MAX', label: 'MAX' },
7474
{ id: 'PLAN', label: 'PLAN' },
7575
]
7676

7777
const processed = processSegments(segments, null, false, theme)
7878
const widths = processed.map((s) => s.width)
7979
expect(widths).toEqual([
80-
stringWidth(' FAST '),
80+
stringWidth(' DEFAULT '),
8181
stringWidth(' MAX '),
8282
stringWidth(' PLAN '),
8383
])
8484
})
8585

8686
test('applies defaultHighlighted when nothing hovered', () => {
8787
const segments: Segment[] = [
88-
{ id: 'FAST', label: 'FAST' },
88+
{ id: 'DEFAULT', label: 'DEFAULT' },
8989
{ id: 'MAX', label: 'MAX' },
9090
{
91-
id: 'active-FAST',
92-
label: '> FAST',
91+
id: 'active-DEFAULT',
92+
label: '> DEFAULT',
9393
isSelected: true,
9494
defaultHighlighted: true,
9595
},
@@ -100,13 +100,13 @@ describe('SegmentedControl - processSegments', () => {
100100
processed.map((p) => [p.id, p]),
101101
)
102102

103-
expect(map['active-FAST'].leftBorderColor).toBe(theme.foreground)
104-
expect(map['FAST'].leftBorderColor).toBe(theme.border)
103+
expect(map['active-DEFAULT'].leftBorderColor).toBe(theme.foreground)
104+
expect(map['DEFAULT'].leftBorderColor).toBe(theme.border)
105105
})
106106

107107
test('hovering a segment highlights it', () => {
108108
const segments: Segment[] = [
109-
{ id: 'FAST', label: 'FAST' },
109+
{ id: 'DEFAULT', label: 'DEFAULT' },
110110
{ id: 'MAX', label: 'MAX' },
111111
{ id: 'PLAN', label: 'PLAN' },
112112
]
@@ -117,12 +117,12 @@ describe('SegmentedControl - processSegments', () => {
117117

118118
expect(map.MAX.isHovered).toBe(true)
119119
expect(map.MAX.leftBorderColor).toBe(theme.foreground)
120-
expect(map.FAST.leftBorderColor).toBe(theme.border)
120+
expect(map.DEFAULT.leftBorderColor).toBe(theme.border)
121121
})
122122

123123
test('disabled segments use muted text and border colors', () => {
124124
const segments: Segment[] = [
125-
{ id: 'FAST', label: 'FAST', disabled: true },
125+
{ id: 'DEFAULT', label: 'DEFAULT', disabled: true },
126126
{ id: 'MAX', label: 'MAX' },
127127
]
128128
const [fast, max] = processSegments(segments, null, false, theme)

cli/src/chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const MAX_VIRTUALIZED_TOP_LEVEL = 60
4545
const VIRTUAL_OVERSCAN = 12
4646

4747
const DEFAULT_AGENT_IDS = {
48-
FAST: 'base2-fast',
48+
DEFAULT: 'base2',
4949
MAX: 'base2-max',
5050
PLAN: 'base2-plan',
5151
} as const

cli/src/components/agent-mode-toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { Segment } from './segmented-control'
88
import type { AgentMode } from '../utils/constants'
99

1010
const MODE_LABELS: Record<AgentMode, string> = {
11-
FAST: 'FAST',
11+
DEFAULT: 'DEFAULT',
1212
MAX: 'MAX',
1313
PLAN: 'PLAN',
1414
}

cli/src/components/build-mode-buttons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const BuildModeButtons = ({
5555
onMouseOut={() => setHoveredButton(null)}
5656
>
5757
<text wrapMode="none">
58-
<span fg={theme.foreground}>Build FAST</span>
58+
<span fg={theme.foreground}>Build DEFAULT</span>
5959
</text>
6060
</box>
6161
<box

cli/src/hooks/use-chat-input.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ export const useChatInput = ({
3232
// Collapsed content is: " < " + LABEL + " " inside a bordered box.
3333
// Full width = contentWidth + 2 (vertical borders). We also include the
3434
// inter-element gap (the right container has paddingLeft: 2).
35-
const MODE_LABELS = { FAST: 'FAST', MAX: 'MAX', PLAN: 'PLAN' } as const
35+
const MODE_LABELS = { DEFAULT: 'DEFAULT', MAX: 'MAX', PLAN: 'PLAN' } as const
3636
const collapsedContentWidth = stringWidth(` < ${MODE_LABELS[agentMode]} `)
3737
const collapsedBoxWidth = collapsedContentWidth + 2 // account for │ │
3838
const gapWidth = 2 // paddingLeft on the toggle container
3939
const estimatedToggleWidth = collapsedBoxWidth + gapWidth
4040
const inputWidth = Math.max(1, separatorWidth - estimatedToggleWidth)
4141

4242
const handleBuildFast = useCallback(() => {
43-
setAgentMode('FAST')
43+
setAgentMode('DEFAULT')
4444
setInputValue({
4545
text: BUILD_IT_TEXT,
4646
cursorPosition: BUILD_IT_TEXT.length,
4747
lastEditDueToNav: true,
4848
})
4949
setTimeout(() => {
5050
if (sendMessageRef.current) {
51-
sendMessageRef.current({ content: BUILD_IT_TEXT, agentMode: 'FAST' })
51+
sendMessageRef.current({ content: BUILD_IT_TEXT, agentMode: 'DEFAULT' })
5252
}
5353
setInputValue({ text: '', cursorPosition: 0, lastEditDueToNav: false })
5454
}, 0)

cli/src/hooks/use-send-message.ts

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const updateBlocksRecursively = (
5050
})
5151
}
5252

53-
5453
export type SendMessageTimerEvent =
5554
| {
5655
type: 'start'
@@ -358,7 +357,8 @@ export const useSendMessage = ({
358357

359358
// Check if mode changed and insert divider if needed
360359
// Also show divider on first message (when lastMessageMode is null)
361-
const shouldInsertDivider = lastMessageMode === null || lastMessageMode !== agentMode
360+
const shouldInsertDivider =
361+
lastMessageMode === null || lastMessageMode !== agentMode
362362

363363
// Add user message to UI first
364364
const userMessage: ChatMessage = {
@@ -370,7 +370,7 @@ export const useSendMessage = ({
370370

371371
applyMessageUpdate((prev) => {
372372
let newMessages = [...prev]
373-
373+
374374
// Insert mode divider if mode changed
375375
if (shouldInsertDivider) {
376376
const dividerMessage: ChatMessage = {
@@ -387,9 +387,9 @@ export const useSendMessage = ({
387387
}
388388
newMessages.push(dividerMessage)
389389
}
390-
390+
391391
newMessages.push(userMessage)
392-
392+
393393
if (postUserMessage) {
394394
newMessages = postUserMessage(newMessages)
395395
}
@@ -398,10 +398,10 @@ export const useSendMessage = ({
398398
}
399399
return newMessages
400400
})
401-
401+
402402
// Update last message mode
403403
setLastMessageMode(agentMode)
404-
404+
405405
await yieldToEventLoop()
406406

407407
// Auto-collapse previous message toggles to minimize clutter.
@@ -727,8 +727,8 @@ export const useSendMessage = ({
727727
: undefined
728728

729729
const fallbackAgent =
730-
agentMode === 'FAST'
731-
? 'base2-fast'
730+
agentMode === 'DEFAULT'
731+
? 'base2'
732732
: agentMode === 'MAX'
733733
? 'base2-max'
734734
: 'base2-plan'
@@ -1024,7 +1024,10 @@ export const useSendMessage = ({
10241024
const next = new Set(prev)
10251025
next.delete(tempId)
10261026
// Only collapse if parent is NOT main agent (i.e., it's a nested agent)
1027-
if (event.parentAgentId && event.parentAgentId !== MAIN_AGENT_ID) {
1027+
if (
1028+
event.parentAgentId &&
1029+
event.parentAgentId !== MAIN_AGENT_ID
1030+
) {
10281031
next.add(event.agentId)
10291032
}
10301033
return next
@@ -1124,8 +1127,13 @@ export const useSendMessage = ({
11241127

11251128
setStreamingAgents((prev) => new Set(prev).add(event.agentId))
11261129
// Only collapse if parent is NOT main agent (i.e., it's a nested agent)
1127-
if (event.parentAgentId && event.parentAgentId !== MAIN_AGENT_ID) {
1128-
setCollapsedAgents((prev) => new Set(prev).add(event.agentId))
1130+
if (
1131+
event.parentAgentId &&
1132+
event.parentAgentId !== MAIN_AGENT_ID
1133+
) {
1134+
setCollapsedAgents((prev) =>
1135+
new Set(prev).add(event.agentId),
1136+
)
11291137
}
11301138
}
11311139
}
@@ -1427,7 +1435,12 @@ export const useSendMessage = ({
14271435

14281436
if (!runState.output || runState.output.type === 'error') {
14291437
logger.warn(
1430-
{ errorMessage: runState.output?.type === 'error' ? runState.output.message : 'No output from agent run' },
1438+
{
1439+
errorMessage:
1440+
runState.output?.type === 'error'
1441+
? runState.output.message
1442+
: 'No output from agent run',
1443+
},
14311444
'Agent run failed',
14321445
)
14331446
return

cli/src/state/chat-store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const initialState: ChatStoreState = {
7878
isChainInProgress: false,
7979
slashSelectedIndex: 0,
8080
agentSelectedIndex: 0,
81-
agentMode: 'FAST',
81+
agentMode: 'DEFAULT',
8282
hasReceivedPlanResponse: false,
8383
lastMessageMode: null,
8484
}
@@ -161,12 +161,12 @@ export const useChatStore = create<ChatStore>()(
161161

162162
toggleAgentMode: () =>
163163
set((state) => {
164-
if (state.agentMode === 'FAST') {
164+
if (state.agentMode === 'DEFAULT') {
165165
state.agentMode = 'MAX'
166166
} else if (state.agentMode === 'MAX') {
167167
state.agentMode = 'PLAN'
168168
} else {
169-
state.agentMode = 'FAST'
169+
state.agentMode = 'DEFAULT'
170170
}
171171
}),
172172

cli/src/utils/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export const shouldHideAgent = (agentId: string): boolean => {
1313
*/
1414
export const MAIN_AGENT_ID = 'main-agent'
1515

16-
const agentModes = ['FAST', 'MAX', 'PLAN'] as const
16+
const agentModes = ['DEFAULT', 'MAX', 'PLAN'] as const
1717
export type AgentMode = (typeof agentModes)[number]

0 commit comments

Comments
 (0)