mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
fix(tui): hide reasoning panels immediately
Make /reasoning hide update the thinking section visibility so existing and live reasoning blocks disappear without waiting for config sync.
This commit is contained in:
parent
456955c2e4
commit
d8afafd22b
5 changed files with 78 additions and 2 deletions
|
|
@ -76,6 +76,45 @@ describe('createSlashHandler', () => {
|
|||
})
|
||||
})
|
||||
|
||||
it('applies /reasoning hide to the thinking section immediately', async () => {
|
||||
patchUiState({ sections: { thinking: 'expanded' }, showReasoning: true, sid: 'sid-abc' })
|
||||
const ctx = buildCtx({
|
||||
gateway: {
|
||||
...buildGateway(),
|
||||
rpc: vi.fn(() => Promise.resolve({ value: 'hide' }))
|
||||
}
|
||||
})
|
||||
|
||||
expect(createSlashHandler(ctx)('/reasoning hide')).toBe(true)
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(getUiState().showReasoning).toBe(false)
|
||||
expect(getUiState().sections.thinking).toBe('hidden')
|
||||
})
|
||||
expect(ctx.gateway.rpc).toHaveBeenCalledWith('config.set', {
|
||||
key: 'reasoning',
|
||||
session_id: 'sid-abc',
|
||||
value: 'hide'
|
||||
})
|
||||
})
|
||||
|
||||
it('applies /reasoning show to the thinking section immediately', async () => {
|
||||
patchUiState({ sections: { thinking: 'hidden' }, showReasoning: false, sid: 'sid-abc' })
|
||||
const ctx = buildCtx({
|
||||
gateway: {
|
||||
...buildGateway(),
|
||||
rpc: vi.fn(() => Promise.resolve({ value: 'show' }))
|
||||
}
|
||||
})
|
||||
|
||||
expect(createSlashHandler(ctx)('/reasoning show')).toBe(true)
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(getUiState().showReasoning).toBe(true)
|
||||
expect(getUiState().sections.thinking).toBe('expanded')
|
||||
})
|
||||
})
|
||||
|
||||
it('opens the skills hub locally for bare /skills', () => {
|
||||
const ctx = buildCtx()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue