Skip to content

Improve diagnostics for missing terminal outputs - #66557

Merged
pelikhan merged 5 commits into
mainfrom
copilot/aw-10-improve-diagnostics
Oct 7, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/aw-10-improve-diagnostics

Conversation

Copilot AI commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Safe diagnostics: Include the driver exit code, generic engine error type, retry count/statuses, and classified cause. Raw driver messages are omitted.
  • Cause-based deduplication: Reuse an open failure issue for the same workflow and classified cause, regardless of other changing failure categories.

Example:

Failure classification: engine_outage
Driver exit code: 1
Last engine error type: capi_server_error
Retry attempts observed: 2 (HTTP 502, HTTP 503)

Copilot AI and others added 3 commits October 7, 2026 12:56
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 AI changed the title [WIP] Improve diagnostics for missing terminal outputs Improve diagnostics for missing terminal outputs Oct 7, 2026
Copilot AI requested a review from pelikhan October 7, 2026 13:01
@pelikhan

pelikhan commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

@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>

Copilot AI commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Merged main and resolved the conflict in handle_agent_failure.cjs, preserving both changes. Merge commit: 98fcaef28c.

@pelikhan
pelikhan marked this pull request as ready for review October 7, 2026 16:12
Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:12

Copilot AI commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Install Go language server (gopls)

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 copilot-code-review.yml file. Read the docs for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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"));
Comment on lines +181 to 188
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");
Comment on lines +544 to +545
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`;
@pelikhan
pelikhan merged commit 60924f7 into main Oct 7, 2026
12 of 13 checks passed
@pelikhan
pelikhan deleted the copilot/aw-10-improve-diagnostics branch October 7, 2026 16:43
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AW Top 10] 01 Improve diagnostics for missing terminal outputs

3 participants