mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(web): hide unsupported Codex slash commands in remote mode (#357)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { findUnsupportedCodexBuiltinSlashCommand, getBuiltinSlashCommands } from './codexSlashCommands'
|
||||
|
||||
describe('getBuiltinSlashCommands', () => {
|
||||
it('does not expose codex built-ins in remote web mode', () => {
|
||||
expect(getBuiltinSlashCommands('codex')).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('findUnsupportedCodexBuiltinSlashCommand', () => {
|
||||
it('detects unsupported codex built-ins', () => {
|
||||
expect(findUnsupportedCodexBuiltinSlashCommand('/status', [])).toBe('status')
|
||||
expect(findUnsupportedCodexBuiltinSlashCommand(' /diff ', [])).toBe('diff')
|
||||
})
|
||||
|
||||
it('ignores regular messages and unknown commands', () => {
|
||||
expect(findUnsupportedCodexBuiltinSlashCommand('show me status', [])).toBeNull()
|
||||
expect(findUnsupportedCodexBuiltinSlashCommand('/custom-status', [])).toBeNull()
|
||||
})
|
||||
|
||||
it('does not block custom commands that override the same name', () => {
|
||||
expect(findUnsupportedCodexBuiltinSlashCommand('/status', [
|
||||
{ name: 'status', source: 'project', content: 'project status prompt' }
|
||||
])).toBeNull()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user