PUBLIC BETA OFFER

Save 50% off on an Eligible Learning PlanValid for 1-month plan, 3-month plan, 12-month plan · Code LPXBETA50 · Ends Dec 6, 2026

GH-700: Diagnose Agent Workflow Failures Before Retrying

Isolate trigger, compiler, authentication, permission, tool, consumption and runtime faults using actual run evidence, then authorize one narrow correction and verify a bounded retry.

Guide

Content version 1.0

GH-700: Diagnose Agent Workflow Failures Before Retrying

GH-700: Diagnose Agent Workflow Failures Before Retrying

Diagnose an agent workflow failure by identifying its execution mechanism and last confirmed successful stage, then comparing the actual error, tool activity and configuration with the task's intended inputs and effects. Separate a trigger that never started work from a compiler failure, failed authentication, denied access, missing tool, consumption limit or runtime fault. Correct the smallest supported cause and authorize a bounded retry only after checking what the earlier attempt already changed.

This diagnostic method uses official documentation checked on November 14, 2026. GitHub Agentic Workflows, Copilot cloud automations and a local Copilot CLI session have different configuration and execution paths. A successful compile or completed retry establishes neither business correctness nor reversal of earlier effects; output acceptance remains a separate decision.

Preserve evidence before changing the system

Begin an incident record with the intended task, repository or external resource, execution environment, workflow or automation identity, relevant revision and time window. Record whether a run actually exists. Keep the original diagnostic and the last successful step before editing configuration; otherwise, a later successful attempt can conceal the initial cause.

For a supported Copilot cloud-agent session, the session log shows the tools used and validation activity. Its overview also exposes progress, token usage and session length. Inspect the tool result associated with the failed action rather than relying only on the agent's final explanation. A proposal to update an issue is different from a successful tool result and an observed issue update.

As an operational recommendation, separate three evidence fields: what the system reported, what the operator independently observed, and the current explanation. Mark an explanation as a hypothesis until a check distinguishes it from competing causes. Avoid copying credential values or sensitive business data into an incident summary.

Classify the failure at its actual stage

Use this triage table to select the next check. Each symptom can have more than one cause, so preserve competing explanations until the evidence distinguishes them.

Observation Evidence to inspect Narrow next step
A Copilot cloud automation has no expected session Enabled state, selected trigger and filters, event actor restrictions and periodic AI credit limits Establish whether the event qualified and a new start was permitted before changing the task prompt.
A gh-aw source does not compile First compiler diagnostic, YAML field/type, paths and imports Repair the named source defect, then compile again; do not treat it as an agent reasoning failure.
A gh-aw run cannot authenticate its AI engine Actual engine, repository ownership and applicable authentication configuration Verify the documented engine-specific credential or organization-billing setup rather than adding repository write access.
A GitHub read operation is denied or a tool is absent Required read scope, enabled toolset and any narrower tool allowlist Determine whether access or tool exposure is missing; request only a justified change.
A Model Context Protocol (MCP) integration fails Actual client's server status, transport, required configuration and credentials Inspect that integration's configuration; do not transplant another client's file or grant every tool.
A cloud automation stops at its consumption allowance Per-run limit and actual run state Confirm the limit event and remaining approved allowance before authorizing another attempt.
Execution starts but fails later Last successful operation, failing tool result and affected resources Isolate the failed dependency or operation; check for partial effects before retrying.

Cloud automation event filters can exclude activity from Copilot or users without repository write access. A daily, weekly or monthly automation limit prevents additional starts after it is reached; it does not stop an already running session. The per-run limit addresses that different boundary. Diagnose these configured conditions before declaring a trigger broken.

Follow the mechanism-specific diagnostic path

Separate gh-aw compilation, inference and resource access

GitHub Agentic Workflows compiles Markdown source into a companion .lock.yml Actions workflow. If compilation fails, inspect the source and exact diagnostic. The official error reference groups schema, compilation, runtime, engine, MCP and toolset errors. A strict-mode diagnostic should be evaluated against the selected compiler options and configuration; weakening the control is not a default repair.

For an unclear compiler failure, the documented diagnostic command is:

gh aw compile --verbose

This command can help expose the failure; it is not a runtime test. After a source correction, inspect the changed source and generated lock file together using GH-700: Author and Compile GitHub Agentic Workflows.

For inference authentication, the built-in Actions token route is documented for the Copilot engine in an organization-owned repository with a Copilot plan and the required organization policy. The workflow must opt into the copilot-requests permission with the value write. Personal repositories and third-party engines use their applicable credential route. That inference permission does not grant repository mutation.

Read permissions and available tools are also distinct. A permitted API operation may still be unavailable through the selected toolset; a visible tool can still lack the necessary read scope. The error reference documents gh aw mcp inspect with a workflow argument for examining available tools. Compare its result with the intended operation before broadening configuration. A required write effect belongs in the reviewed safe-output design, rather than an attempt to disable the GitHub MCP server's documented read-only enforcement.

Inspect MCP in the client that actually failed

In Copilot CLI, the /mcp command displays configured servers and their current status. The terminal command copilot mcp get with the server name reports its type, status and available tools. Check the relevant server before reinstalling it or changing unrelated workflow permissions.

A local STDIO server starts a process; HTTP and SSE configurations connect to remote servers. The selected transport determines which command, endpoint and authentication settings need inspection. Copilot CLI does not read the VS Code .vscode/mcp.json file as its own configuration. A connection that works in VS Code therefore does not establish that the CLI has loaded it. Likewise, a gh-aw MCP configuration error must be checked against that workflow's supported configuration, not repaired by copying a local client's settings wholesale.

For a Copilot cloud automation, repository administrators configure external MCP servers and the automation selects available tools. A repository resource-write restriction on GitHub tools does not restrict MCP resources reached through server credentials. Restore a missing capability only after confirming the intended target and credential reach.

Authorize a bounded retry with a clear success check

Consider an illustrative weekly dependency report that starts but cannot read the required issue details. A successful model response does not prove that issue retrieval worked. The operator should preserve the failed tool result, identify whether the required tool is exposed and whether its read operation is authorized, and ask the configuration owner to correct only the demonstrated deficiency. This is a diagnostic example, not an observed run or a prescribed permission increase.

Before retrying, define the smallest input set that can test the explanation and the evidence that would refute it. For this example, require a report statement traceable to a known issue and comment, with missing access reported explicitly. Confirm whether the previous attempt created a report issue or other effect so that the retry does not duplicate it. If the required access is not approved, escalate the requirement instead of repeating the attempt with broader credentials.

A cloud automation's documented test flow can simulate a selected trigger and starts a real session with the selected tools. Treat such a test as an authorized execution with possible usage and effects, not a harmless preview. If active work must first be contained, use GH-700: Steer and Stop Agent Runs Without Assuming Rollback and verify the observed result before retrying.

After the retry, compare the original error with the new tool result, actual resource state and output evidence. Retain both attempts. If the same cause remains unproven or the task would need new authority, stop the retry loop and send the evidence to the accountable owner.

Monitor recurrence and useful outcomes together

Keep a small operating record of failure stage, supported cause, corrective change, retry result, observed effects and owner. Maintain this as an operator record; it is not a built-in Copilot dashboard. Count recurring faults by cause so that repeated authentication failures are not hidden inside a generic unsuccessful-run total.

Copilot's usage views depend on the plan. The AI usage page reports model consumption and costs, but generally does not attribute consumed credits to exact prompts, sessions or features at a per-request level. Do not manufacture that attribution by joining unrelated timestamps. Use available run and automation evidence at its supported granularity.

Finally, ask whether the recovered output satisfies the original business requirement. A run can finish with technically valid but incomplete evidence. Continue with GH-700: Verify Business Outputs and Bound Agent Critique Loops for that acceptance decision.

Authoritative Sources

7 views