Detect step-level engine timeout in detect_copilot_errors.cjs#25896
Detect step-level engine timeout in detect_copilot_errors.cjs#25896
Conversation
Add SIGTERM/SIGKILL/SIGINT signal detection to the Copilot error detection step. When GitHub Actions cancels a step due to timeout-minutes, the runner sends signals to the process group. The copilot_driver logs these signals, and detect_copilot_errors.cjs now detects them and sets a copilot_timeout output. The copilot_timeout output flows through the same pipeline as inference_access_error and mcp_policy_error: 1. detect_copilot_errors.cjs sets the output 2. compiler_main_job.go adds it to agent job outputs 3. notify_comment.go forwards GH_AW_COPILOT_TIMEOUT to conclusion job 4. handle_agent_failure.cjs uses it for timeout detection This fixes the case where a step-level timeout (timeout-minutes on the Copilot CLI step) was not detected as a timeout in the conclusion job, because agentConclusion was "failure" rather than "timed_out". Agent-Logs-Url: https://github.com/github/gh-aw/sessions/919be85a-8564-45a3-a5a8-0a42711335c3 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| GH_AW_WORKFLOW_ID_SANITIZED: agentperformanceanalyzer | ||
| outputs: | ||
| checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} | ||
| copilot_timeout: ${{ steps.detect-copilot-errors.outputs.copilot_timeout || 'false' }} |
There was a problem hiding this comment.
@copilot make it generic: "agentic_engine_timeout"
There was a problem hiding this comment.
Renamed to agentic_engine_timeout across all files and also broadened the regex to match signal=SIG(TERM|KILL|INT) from any engine's log output (no longer scoped to [copilot-driver]). Commit 679f3c6.
Make the timeout detection generic (engine-agnostic) instead of Copilot-specific. The regex pattern now matches signal=SIG(TERM|KILL|INT) from any engine's log output, not just [copilot-driver] lines. Renamed across: - detect_copilot_errors.cjs: AGENTIC_ENGINE_TIMEOUT_PATTERN, agenticEngineTimeout - handle_agent_failure.cjs: GH_AW_AGENTIC_ENGINE_TIMEOUT - compiler_main_job.go: agentic_engine_timeout output - notify_comment.go: GH_AW_AGENTIC_ENGINE_TIMEOUT env var - Golden files and all 187 recompiled lock files Agent-Logs-Url: https://github.com/github/gh-aw/sessions/55bb5f99-cdf0-4023-8b5a-7ea12f527c68 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes missing detection for step-level timeouts (timeout-minutes on the Copilot CLI step) by adding a log-based timeout signal and plumbing it through the workflow outputs/env so the conclusion job can treat it as a timeout (in addition to job-level timed_out).
Changes:
- Added
AGENTIC_ENGINE_TIMEOUT_PATTERNtodetect_copilot_errors.cjsand a newagentic_engine_timeoutoutput. - Plumbed
agentic_engine_timeoutthrough the agent job outputs and into the conclusion job viaGH_AW_AGENTIC_ENGINE_TIMEOUT, and updated timeout detection logic inhandle_agent_failure.cjs. - Updated/regen’d workflow golden fixtures and workflow lock files to include the new output/env wiring.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/detect_copilot_errors.cjs | Adds signal-based timeout detection and emits agentic_engine_timeout output. |
| actions/setup/js/detect_copilot_errors.test.cjs | Adds unit tests for the new timeout regex + detectErrors output. |
| actions/setup/js/handle_agent_failure.cjs | Treats step-level (signal-detected) timeouts as timeouts in conclusion handling. |
| pkg/workflow/compiler_main_job.go | Exposes agentic_engine_timeout as an agent job output for Copilot engine workflows. |
| pkg/workflow/notify_comment.go | Forwards GH_AW_AGENTIC_ENGINE_TIMEOUT to the conclusion job for Copilot engine workflows. |
| pkg/workflow/copilot_engine_execution.go | Updates documentation for the Copilot error detection step to include the new output. |
| pkg/workflow/testdata/wasm_golden/WasmBinary/basic-copilot.golden | Golden fixture updated to include agentic_engine_timeout output. |
| pkg/workflow/testdata/wasm_golden/WasmBinary/with-imports.golden | Golden fixture updated to include agentic_engine_timeout output. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden | Golden fixture updated to include agentic_engine_timeout output. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden | Golden fixture updated to include agentic_engine_timeout output. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden | Golden fixture updated to include agentic_engine_timeout output. |
| .github/workflows/ace-editor.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/agent-performance-analyzer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/agent-persona-explorer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/agentic-observability-kit.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/archie.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/architecture-guardian.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/artifacts-summary.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/auto-triage-issues.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/bot-detection.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/brave.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/breaking-change-checker.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/ci-coach.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/cli-consistency-checker.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/code-scanning-fixer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/code-simplifier.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/contribution-check.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/constraint-solving-potd.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/copilot-cli-deep-research.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/copilot-pr-merged-report.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/copilot-pr-nlp-analysis.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/copilot-pr-prompt-analysis.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/copilot-token-audit.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/copilot-token-optimizer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/craft.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-architecture-diagram.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-assign-issue-to-user.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-cli-performance.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-cli-tools-tester.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-community-attribution.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-compiler-quality.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-file-diet.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-firewall-report.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-integrity-analysis.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-issues-report.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-malicious-code-scan.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-mcp-concurrency-analysis.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-news.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-performance-summary.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-regulatory.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-repo-chronicle.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-safe-output-integrator.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-secrets-analysis.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-semgrep-scan.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-syntax-error-quality.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-team-status.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-testify-uber-super-expert.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/daily-workflow-updater.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/dead-code-remover.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/delight.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/dependabot-burner.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/dependabot-go-checker.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/dev-hawk.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/dev.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/dictation-prompt.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/discussion-task-miner.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/docs-noob-tester.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/draft-pr-cleanup.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/example-permissions-warning.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/firewall-escape.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/firewall.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/functional-pragmatist.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/github-remote-mcp-auth-test.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/glossary-maintainer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/gpclean.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/issue-monster.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/issue-triage-agent.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/jsweep.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/layout-spec-maintainer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/mcp-inspector.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/mergefest.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/metrics-collector.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/notion-issue-summary.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/org-health-report.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/pdf-summary.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/plan.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/poem-bot.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/portfolio-analyst.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/pr-nitpick-reviewer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/pr-triage-agent.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/python-data-charts.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/q.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/refactoring-cadence.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/refiner.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/release.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/repo-audit-analyzer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/repo-tree-map.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/repository-quality-improver.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/research.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/security-compliance.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/security-review.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/slide-deck-maintainer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-copilot-arm.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-copilot.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-create-cross-repo-pr.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-multi-pr.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-project.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-service-ports.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-temporary-id.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-test-tools.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-update-cross-repo-pr.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-workflow-call-with-inputs.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/smoke-workflow-call.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/stale-repo-identifier.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/sub-issue-closer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/super-linter.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/technical-doc-writer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/terminal-stylist.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/test-dispatcher.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/test-project-url-default.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/test-quality-sentinel.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/test-workflow.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/tidy.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/ubuntu-image-analyzer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/update-astro.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/video-analyzer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/weekly-blog-post-writer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/weekly-editors-health-check.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/weekly-issue-summary.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/weekly-safe-outputs-spec-review.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/workflow-generator.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/workflow-health-manager.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/workflow-normalizer.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
| .github/workflows/workflow-skill-extractor.lock.yml | Regenerated lock file to wire agentic_engine_timeout output/env. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 134/134 changed files
- Comments generated: 2
| * - agentic_engine_timeout: The agentic engine process was killed by a | ||
| * signal (SIGTERM/SIGKILL/SIGINT), typically due to the step | ||
| * timeout-minutes limit being reached. |
| // Check if the agent timed out. | ||
| // A job-level timeout sets agentConclusion to "timed_out". | ||
| // A step-level timeout (timeout-minutes on the engine execution step) is detected by | ||
| // the detect-copilot-errors step which checks for SIGTERM/SIGKILL/SIGINT signals | ||
| // in the engine output and sets the agentic_engine_timeout output. | ||
| const isTimedOut = agentConclusion === "timed_out" || agenticEngineTimeout; |
|
@copilot review comments |
Add 6 tests verifying the isTimedOut classification logic that combines job-level timeout (agentConclusion === "timed_out") with step-level engine timeout (agenticEngineTimeout from signal detection). This ensures the key scenario — agentConclusion === "failure" with GH_AW_AGENTIC_ENGINE_TIMEOUT=true — is explicitly covered. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c0fb085d-caf5-4e11-9ee5-a08b5f31ee9d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed both review comments:
|
Step-level timeouts (
timeout-minuteson the engine execution step) were not detected as timeouts. The conclusion job only checkedagentConclusion === "timed_out", which only fires for job-level timeouts. Step-level timeouts produceagentConclusion === "failure", so the timeout context and messaging were silently skipped.Detection
AGENTIC_ENGINE_TIMEOUT_PATTERNtodetect_copilot_errors.cjs— matchessignal=SIGTERM|SIGKILL|SIGINTin the agent stdio log (signals sent by the runner when a step exceedstimeout-minutes). The pattern is engine-agnostic, detecting timeout signals from any engine.agentic_engine_timeoutoutput, alongside existinginference_access_errorandmcp_policy_errorPlumbing
compiler_main_job.go— addedagentic_engine_timeoutto agent job outputsnotify_comment.go— forwardsGH_AW_AGENTIC_ENGINE_TIMEOUTenv var to the conclusion jobhandle_agent_failure.cjs— timeout check is nowagentConclusion === "timed_out" || agenticEngineTimeout, catching both job-level and step-level timeoutsTests
detect_copilot_errors.test.cjscovering SIGTERM/SIGKILL/SIGINT patterns, embedded-in-log matching, non-copilot engine signals, and negative casesagentic_engine_timeoutoutput