(
workspaceLog: Logger,
streamInfo: WorkspaceStreamInfo,
part: { toolCallId: string; toolName: string },
output: unknown,
orphanCount: number,
trackedToolCallCount: number
)
| 1752 | } |
| 1753 | |
| 1754 | private logOrphanToolResult( |
| 1755 | workspaceLog: Logger, |
| 1756 | streamInfo: WorkspaceStreamInfo, |
| 1757 | part: { toolCallId: string; toolName: string }, |
| 1758 | output: unknown, |
| 1759 | orphanCount: number, |
| 1760 | trackedToolCallCount: number |
| 1761 | ): void { |
| 1762 | if (orphanCount > MAX_ORPHAN_TOOL_RESULT_WARNINGS_PER_STREAM) { |
| 1763 | return; |
| 1764 | } |
| 1765 | |
| 1766 | workspaceLog.warn( |
| 1767 | "[streamManager] Received tool-result without matching tool-call map entry; persisting fallback output", |
| 1768 | { |
| 1769 | messageId: streamInfo.messageId, |
| 1770 | model: streamInfo.model, |
| 1771 | toolCallId: part.toolCallId, |
| 1772 | toolName: part.toolName, |
| 1773 | orphanCount, |
| 1774 | trackedToolCallCount, |
| 1775 | isWebSearch: part.toolName === "web_search", |
| 1776 | ...summarizeToolResultForLog(output), |
| 1777 | } |
| 1778 | ); |
| 1779 | |
| 1780 | if (orphanCount === MAX_ORPHAN_TOOL_RESULT_WARNINGS_PER_STREAM) { |
| 1781 | workspaceLog.warn( |
| 1782 | "[streamManager] Suppressing additional orphan tool-result warnings for this stream", |
| 1783 | { |
| 1784 | messageId: streamInfo.messageId, |
| 1785 | model: streamInfo.model, |
| 1786 | suppressedAfter: orphanCount, |
| 1787 | } |
| 1788 | ); |
| 1789 | } |
| 1790 | } |
| 1791 | |
| 1792 | /** |
| 1793 | * Emit nested tool events from PTC code_execution. |
no test coverage detected