mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-30 01:41:43 +00:00
fix(tui): keep stream cadence responsive while typing
This commit is contained in:
parent
381121025e
commit
bbd950efcf
4 changed files with 19 additions and 13 deletions
|
|
@ -2,7 +2,6 @@ import {
|
|||
REASONING_PULSE_MS,
|
||||
STREAM_BATCH_MS,
|
||||
STREAM_IDLE_BATCH_MS,
|
||||
STREAM_SCROLLING_BATCH_MS,
|
||||
STREAM_TYPING_BATCH_MS
|
||||
} from '../config/timing.js'
|
||||
import type { SessionInterruptResponse, SubagentEventPayload } from '../gatewayTypes.js'
|
||||
|
|
@ -16,7 +15,6 @@ import {
|
|||
} from '../lib/text.js'
|
||||
import type { ActiveTool, ActivityItem, Msg, SubagentProgress } from '../types.js'
|
||||
|
||||
import { getInteractionMode } from './interactionMode.js'
|
||||
import { resetFlowOverlays } from './overlayStore.js'
|
||||
import { pushSnapshot } from './spawnHistoryStore.js'
|
||||
import { getTurnState, patchTurnState, resetTurnState } from './turnStore.js'
|
||||
|
|
@ -504,15 +502,12 @@ class TurnController {
|
|||
return
|
||||
}
|
||||
|
||||
const interaction = getInteractionMode()
|
||||
const delay = interaction === 'scrolling' ? STREAM_SCROLLING_BATCH_MS : interaction === 'typing' ? STREAM_TYPING_BATCH_MS : this.streamDelay
|
||||
|
||||
this.streamTimer = setTimeout(() => {
|
||||
this.streamTimer = null
|
||||
const raw = this.bufRef.trimStart()
|
||||
const visible = hasReasoningTag(raw) ? splitReasoning(raw).text : raw
|
||||
patchTurnState({ streaming: visible })
|
||||
}, delay)
|
||||
}, this.streamDelay)
|
||||
}
|
||||
|
||||
startMessage() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue