mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-02 02:01:47 +00:00
fix(tui): stream legacy thinking deltas visibly
This commit is contained in:
parent
bc17310442
commit
7d68ea9501
2 changed files with 20 additions and 1 deletions
|
|
@ -123,6 +123,20 @@ describe('createGatewayEventHandler', () => {
|
|||
expect(appended[0]?.toolTokens).toBeGreaterThan(0)
|
||||
})
|
||||
|
||||
it('streams legacy thinking.delta into visible reasoning state', () => {
|
||||
vi.useFakeTimers()
|
||||
const appended: Msg[] = []
|
||||
const streamed = 'short streamed reasoning'
|
||||
|
||||
createGatewayEventHandler(buildCtx(appended))({ payload: { text: streamed }, type: 'thinking.delta' } as any)
|
||||
vi.runOnlyPendingTimers()
|
||||
|
||||
expect(getTurnState().reasoning).toBe(streamed)
|
||||
expect(getTurnState().reasoningActive).toBe(true)
|
||||
expect(getTurnState().reasoningTokens).toBe(estimateTokensRough(streamed))
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('ignores fallback reasoning.available when streamed reasoning already exists', () => {
|
||||
const appended: Msg[] = []
|
||||
const streamed = 'short streamed reasoning'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue