( toolUseContext: ToolUseContext, )
| 2852 | } |
| 2853 | |
| 2854 | async function getDiagnosticAttachments( |
| 2855 | toolUseContext: ToolUseContext, |
| 2856 | ): Promise<Attachment[]> { |
| 2857 | // Diagnostics are only useful if the agent has the Bash tool to act on them |
| 2858 | if ( |
| 2859 | !toolUseContext.options.tools.some(t => toolMatchesName(t, BASH_TOOL_NAME)) |
| 2860 | ) { |
| 2861 | return [] |
| 2862 | } |
| 2863 | |
| 2864 | // Get new diagnostics from the tracker (IDE diagnostics via MCP) |
| 2865 | const newDiagnostics = await diagnosticTracker.getNewDiagnostics() |
| 2866 | if (newDiagnostics.length === 0) { |
| 2867 | return [] |
| 2868 | } |
| 2869 | |
| 2870 | return [ |
| 2871 | { |
| 2872 | type: 'diagnostics', |
| 2873 | files: newDiagnostics, |
| 2874 | isNew: true, |
| 2875 | }, |
| 2876 | ] |
| 2877 | } |
| 2878 | |
| 2879 | /** |
| 2880 | * Get LSP diagnostic attachments from passive LSP servers. |
no test coverage detected