| 9 | import type { StreamingContext } from '@/lib/copilot/request/types' |
| 10 | |
| 11 | function makeContext(): StreamingContext { |
| 12 | return { |
| 13 | chatId: undefined, |
| 14 | requestId: undefined, |
| 15 | executionId: undefined, |
| 16 | runId: undefined, |
| 17 | messageId: 'msg-1', |
| 18 | accumulatedContent: '', |
| 19 | finalAssistantContent: '', |
| 20 | sawMainToolCall: false, |
| 21 | contentBlocks: [], |
| 22 | toolCalls: new Map(), |
| 23 | pendingToolPromises: new Map(), |
| 24 | awaitingAsyncContinuation: undefined, |
| 25 | currentThinkingBlock: null, |
| 26 | subagentThinkingBlocks: new Map(), |
| 27 | isInThinkingBlock: false, |
| 28 | subAgentContent: {}, |
| 29 | subAgentToolCalls: {}, |
| 30 | pendingContent: '', |
| 31 | streamComplete: false, |
| 32 | wasAborted: false, |
| 33 | errors: [], |
| 34 | trace: new TraceCollector(), |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | describe('buildToolCallSummaries', () => { |
| 39 | it.concurrent('keeps pending tools as pending instead of defaulting to success', () => { |