fix: keep tui /quit behavior aligned with cli exit flow

This commit is contained in:
adybag14-cyber 2026-05-08 19:29:42 +01:00 committed by Teknium
parent 0ec052ca24
commit 6f7b698a08

View file

@ -26,6 +26,14 @@ describe('createSlashHandler', () => {
expect(ctx.transcript.sys).toHaveBeenCalledWith('ui redrawn')
})
it('exits locally for /quit', () => {
const ctx = buildCtx()
expect(createSlashHandler(ctx)('/quit')).toBe(true)
expect(ctx.session.die).toHaveBeenCalledTimes(1)
expect(ctx.gateway.gw.request).not.toHaveBeenCalled()
})
it('routes /status to live session.status instead of slash worker', async () => {
patchUiState({ sid: 'sid-abc' })
const rpc = vi.fn(() => Promise.resolve({ output: 'Hermes TUI Status' }))