()
| 583 | const streamedToolHashes = new Set<string>(); |
| 584 | |
| 585 | const buildAssistantPayload = () => { |
| 586 | const trimmedAssistant = agentBuffer.trim(); |
| 587 | const thinkingContent = thinkingSegments |
| 588 | .map((segment) => segment.trim()) |
| 589 | .filter((segment) => segment.length > 0) |
| 590 | .map((segment) => `<thinking>${segment}</thinking>`) |
| 591 | .join('\n\n'); |
| 592 | |
| 593 | const parts: string[] = []; |
| 594 | if (thinkingContent) { |
| 595 | parts.push(thinkingContent); |
| 596 | } |
| 597 | if (trimmedAssistant) { |
| 598 | parts.push(trimmedAssistant); |
| 599 | } |
| 600 | return parts.join('\n\n').trim(); |
| 601 | }; |
| 602 | |
| 603 | const streamAssistantDraft = (force = false) => { |
| 604 | const combined = buildAssistantPayload(); |
no outgoing calls
no test coverage detected