Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cli/src/commands/__tests__/router-input.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ describe('command-registry', () => {
expect(credits).toBeDefined()
expect(credits?.name).toBe('usage')

const modelDefault = findCommand('model:default')
expect(modelDefault).toBeDefined()
expect(modelDefault?.name).toBe('mode:default')

const quit = findCommand('quit')
expect(quit).toBeDefined()
expect(quit?.name).toBe('exit')
Expand Down Expand Up @@ -270,6 +274,18 @@ describe('command-registry', () => {
}
})

test('mode commands expose model aliases for slash suggestions', () => {
const modeCommands = SLASH_COMMANDS.filter((cmd) =>
cmd.id.startsWith('mode:'),
)
expect(modeCommands.length).toBeGreaterThan(0)

for (const command of modeCommands) {
const modeName = command.id.slice('mode:'.length)
expect(command.aliases).toContain(`model:${modeName}`)
}
})

test('connect command is not available in codebuff (freebuff-only)', () => {
const hasConnectSlashCommand = SLASH_COMMANDS.some(
(cmd) => cmd.id === 'connect',
Expand Down
1 change: 1 addition & 0 deletions cli/src/commands/command-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ const ALL_COMMANDS: CommandDefinition[] = [
...(IS_FREEBUFF ? [] : AGENT_MODES).map((mode) =>
defineCommandWithArgs({
name: `mode:${mode.toLowerCase()}`,
aliases: [`model:${mode.toLowerCase()}`],
handler: (params, args) => {
const trimmedArgs = args.trim()

Expand Down
1 change: 1 addition & 0 deletions cli/src/data/slash-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const MODE_COMMANDS: SlashCommand[] = IS_FREEBUFF
id: `mode:${mode.toLowerCase()}`,
label: `mode:${mode.toLowerCase()}`,
description: `Switch to ${mode} mode`,
aliases: [`model:${mode.toLowerCase()}`],
}))

const FREEBUFF_REMOVED_COMMAND_IDS = new Set([
Expand Down
Loading