fix(cli-run): deduplicate tool headers and message counter resets on repeated events

Guard against duplicate tool header/output rendering when both tool.execute
and message.part.updated fire for the same tool, and prevent message counter
resets when message.updated fires multiple times for the same assistant message.

🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
This commit is contained in:
YeonGyu-Kim
2026-02-18 02:01:08 +09:00
parent 3313ec3e4f
commit d9751bd5cb
3 changed files with 206 additions and 10 deletions
+3
View File
@@ -37,6 +37,8 @@ export interface EventState {
textAtLineStart: boolean
/** Whether reasoning stream is currently at line start (for padding) */
thinkingAtLineStart: boolean
/** Current assistant message ID — prevents counter resets on repeated message.updated for same message */
currentMessageId: string | null
}
export function createEventState(): EventState {
@@ -63,5 +65,6 @@ export function createEventState(): EventState {
lastThinkingSummary: "",
textAtLineStart: true,
thinkingAtLineStart: false,
currentMessageId: null,
}
}