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:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user