* Load report_incomplete messages from agent output * @param {Array } [items] - Optional pre-loaded agent output items. When provided, avoids re-reading the output file. * @returns {Array<{reason: string, details?: string}>} Array of report_incomplete messages
(items)
| 1484 | * @returns {Array<{reason: string, details?: string}>} Array of report_incomplete messages |
| 1485 | */ |
| 1486 | function loadReportIncompleteMessages(items) { |
| 1487 | try { |
| 1488 | let resolvedItems = items; |
| 1489 | if (!resolvedItems) { |
| 1490 | const { loadAgentOutput } = require("./load_agent_output.cjs"); |
| 1491 | const agentOutputResult = loadAgentOutput(); |
| 1492 | if (!agentOutputResult.success || !agentOutputResult.items) { |
| 1493 | return []; |
| 1494 | } |
| 1495 | resolvedItems = agentOutputResult.items; |
| 1496 | } |
| 1497 | |
| 1498 | const messages = []; |
| 1499 | for (const item of resolvedItems) { |
| 1500 | if (item.type === "report_incomplete" && item.reason) { |
| 1501 | messages.push({ |
| 1502 | reason: item.reason, |
| 1503 | details: item.details || null, |
| 1504 | }); |
| 1505 | } |
| 1506 | } |
| 1507 | |
| 1508 | return messages; |
| 1509 | } catch (error) { |
| 1510 | core.warning(`Failed to load report_incomplete messages: ${getErrorMessage(error)}`); |
| 1511 | return []; |
| 1512 | } |
| 1513 | } |
| 1514 | |
| 1515 | /** |
| 1516 | * Build report_incomplete context string for display in failure issues/comments. |
no test coverage detected