fix: Skip empty thinking chunks (#793)

These carried a signature but we don't need that in the updates if it is
empty.
This commit is contained in:
Ben Brandt
2026-06-19 12:18:36 +02:00
committed by GitHub
parent 9f38cb67df
commit 15fdf26fc7
2 changed files with 60 additions and 7 deletions

View File

@@ -3919,13 +3919,17 @@ export function toAcpNotifications(
break;
case "thinking":
case "thinking_delta":
update = {
sessionUpdate: "agent_thought_chunk",
content: {
type: "text",
text: chunk.thinking,
},
};
// Recent models default `thinking.display` to "omitted", which streams
// signature-only thinking blocks whose text is empty.
if (chunk.thinking.length > 0) {
update = {
sessionUpdate: "agent_thought_chunk",
content: {
type: "text",
text: chunk.thinking,
},
};
}
break;
case "tool_use":
case "server_tool_use":