mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
chore(tui): tighten todo-fix comments, drop dead archive call
- gateway handler: turnController always archives in recordMessageComplete, so the post-complete archiveTodosAtTurnEnd().forEach is dead code. Drop it and the now-unused import. - turnController: collapse archive prepend into a single spread expression. - gateway server: one-line comment for the tool.start todo skip.
This commit is contained in:
parent
c2ca02fcff
commit
635948d0e0
3 changed files with 10 additions and 22 deletions
|
|
@ -11,7 +11,6 @@ import { applyDelegationStatus, getDelegationState } from './delegationStore.js'
|
|||
import type { GatewayEventHandlerContext } from './interfaces.js'
|
||||
import { patchOverlayState } from './overlayStore.js'
|
||||
import { turnController } from './turnController.js'
|
||||
import { archiveTodosAtTurnEnd } from './turnStore.js'
|
||||
import { getUiState, patchUiState } from './uiStore.js'
|
||||
|
||||
const NO_PROVIDER_RE = /\bNo (?:LLM|inference) provider configured\b/i
|
||||
|
|
@ -537,12 +536,6 @@ export function createGatewayEventHandler(ctx: GatewayEventHandlerContext): (ev:
|
|||
const { finalMessages, finalText, wasInterrupted } = turnController.recordMessageComplete(ev.payload ?? {})
|
||||
|
||||
if (!wasInterrupted) {
|
||||
// Defensive: turnController.recordMessageComplete already prepends
|
||||
// the archive at the head of finalMessages. This is a no-op in the
|
||||
// normal path (state.todos is empty) but covers any edge where
|
||||
// todos linger past the controller archive.
|
||||
archiveTodosAtTurnEnd().forEach(appendMessage)
|
||||
|
||||
const msgs: Msg[] = finalMessages.length ? finalMessages : [{ role: 'assistant', text: finalText }]
|
||||
msgs.forEach(appendMessage)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue