fix: hide system_update_todos messages from chat UI

System-generated todo updates (e.g. cost syncs) will now be processed
silently without showing a 'Todo List Updated' notification, reducing
chat noise. User edits remain visible.
This commit is contained in:
Toray Altas 2026-01-17 18:34:38 -05:00
parent 25848e6df6
commit 5bead50ced

View file

@ -127,13 +127,19 @@ interface ChatRowContentProps extends Omit<ChatRowProps, "onHeightChange"> {}
const ChatRow = memo( const ChatRow = memo(
(props: ChatRowProps) => { (props: ChatRowProps) => {
const { isLast, onHeightChange, message } = props const { isLast, onHeightChange, message } = props
// Some message types update state but should not be visible in the chat history.
// We still render a row for Virtuoso compatibility, but hide it so it takes up no space.
const shouldHideRow = message.type === "say" && message.say === "system_update_todos"
// Store the previous height to compare with the current height // Store the previous height to compare with the current height
// This allows us to detect changes without causing re-renders // This allows us to detect changes without causing re-renders
const prevHeightRef = useRef(0) const prevHeightRef = useRef(0)
const [chatrow, { height }] = useSize( const [chatrow, { height }] = useSize(
<div className="px-[15px] py-[10px] pr-[6px]"> <div
<ChatRowContent {...props} /> className={shouldHideRow ? "hidden" : "px-[15px] py-[10px] pr-[6px]"}
aria-hidden={shouldHideRow ? true : undefined}>
{shouldHideRow ? null : <ChatRowContent {...props} />}
</div>, </div>,
) )
@ -1419,7 +1425,7 @@ export const ChatRowContent = ({
case "user_edit_todos": case "user_edit_todos":
return <UpdateTodoListToolBlock userEdited onChange={() => {}} /> return <UpdateTodoListToolBlock userEdited onChange={() => {}} />
case "system_update_todos": case "system_update_todos":
return <UpdateTodoListToolBlock userEdited={false} onChange={() => {}} /> return null
case "tool" as any: case "tool" as any:
// Handle say tool messages // Handle say tool messages
const sayTool = safeJsonParse<ClineSayTool>(message.text) const sayTool = safeJsonParse<ClineSayTool>(message.text)