Repository navigation
Improve diagnostics for missing terminal outputs - #66557
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
…-diagnostics # Conflicts: # actions/setup/js/handle_agent_failure.cjs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Merged |
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review. Note You can configure setup steps for Copilot code review separately from Copilot cloud agent with a |
There was a problem hiding this comment.
🟡 Changes recommended
Structured retries and engine errors can be omitted, diagnostics may be truncated, and deduplication remains limited to 24 hours.
4 open findings
What changed in this PR
Improves missing-terminal-output failure issues with safe diagnostics and cause-based grouping.
Changes:
- Classifies failures and records exit code, engine error type, and retries.
- Propagates validated collector metadata into failure handling.
- Deduplicates issues by workflow and classified cause.
| File | Description |
|---|---|
actions/setup/js/load_agent_output.cjs |
Validates collector diagnostics metadata. |
actions/setup/js/load_agent_output.test.cjs |
Tests metadata preservation. |
actions/setup/js/handle_agent_failure.cjs |
Adds cause-based titles, matching, and log suppression. |
actions/setup/js/handle_agent_failure.test.cjs |
Tests titles, reuse, and suppression. |
actions/setup/js/empty_output_outcome.cjs |
Classifies failures and builds safe diagnostics. |
actions/setup/js/empty_output_outcome.test.cjs |
Tests classification and diagnostic extraction. |
actions/setup/js/collect_ndjson_output.cjs |
Persists collector diagnostics. |
actions/setup/js/collect_ndjson_output.test.cjs |
Updates collected-output expectations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| for (const command of extractDeniedCommands(attributedDiagnostics)) diagnostics.add(`Permission denied: ${command}`); | ||
| const engineSummary = agentErrorSummaryText(safeStdio); | ||
| if (engineSummary) diagnostics.add(engineSummary); | ||
| const engineErrorType = engineSummary.match(/\(([a-z][a-z0-9_]*)\)/)?.[1] || ""; |
| const isRequestRejection = ["invalid_safe_outputs", "safeoutputs_cli_error"].includes(reason) || executionCategories.some(category => REQUEST_REJECTION_ERROR_CATEGORIES.has(category)) || errorCodes.some(code => code >= 400 && code < 500); | ||
| const isEngineOutage = reason === "engine_driver_failure" || executionCategories.some(category => ["agentic_engine_timeout", "capi_server_error", "sandbox_runtime_crash"].includes(category)) || errorCodes.some(code => code >= 500); | ||
| const failureCause = isPromptExhaustion ? "prompt_exhaustion" : isRequestRejection ? "request_rejection" : isEngineOutage ? "engine_outage" : "prompt_exhaustion"; | ||
| const retryEvents = events.filter(event => event.type === "claude.api_retry" || (event.type === "system" && event.data.subtype === "api_retry")); |
| diagnostics.add(`Failure classification: ${failureCause}`); | ||
| if (engineErrorType) { | ||
| diagnostics.add(`Last engine error type: ${engineErrorType}`); | ||
| } else if (reason === "engine_driver_failure") { | ||
| diagnostics.add("Last engine error type: unknown"); | ||
| } | ||
| diagnostics.add(`Retry attempts observed: ${retryCount}${retryStatusCodes.length ? ` (HTTP ${retryStatusCodes.join(", HTTP ")})` : ""}`); | ||
| const details = [...diagnostics].slice(0, 20).join("\n"); |
| const failureCauseQuery = typeof failureCause === "string" ? ` "failure_cause: ${failureCause}"` : ""; | ||
| const searchQuery = `repo:${owner}/${repo} is:issue is:open label:agentic-workflows created:>=${since} ` + `"gh-aw-agentic-workflow:" "workflow_id: ${escapedWorkflowId}"${failureCauseQuery} in:body`; |
|
🎉 This pull request is included in a new release. Release: |

Missing terminal safe outputs and engine-driver failures currently provide too little context for maintainers to distinguish outages, rejected requests, and prompt exhaustion. Failure issues should include useful diagnostics without exposing potentially sensitive driver messages, and repeated failures should consolidate by workflow and cause.
Example: