fix(tui): stream legacy thinking deltas visibly

This commit is contained in:
Brooklyn Nicholson 2026-04-26 04:42:04 -05:00
parent bc17310442
commit 7d68ea9501
2 changed files with 20 additions and 1 deletions

View file

@ -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'