Skip to content

feat: detect agent timeout and report it with frontmatter hint in failure issue/comment#19307

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-agent-timeout-detection
Mar 3, 2026
Merged

feat: detect agent timeout and report it with frontmatter hint in failure issue/comment#19307
pelikhan merged 2 commits intomainfrom
copilot/add-agent-timeout-detection

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

When a GitHub Actions job times out, its conclusion is timed_out — not failure. The failure handler was silently skipping timeout cases entirely, leaving no trace in the failure tracking issue.

Changes

  • pkg/workflow/notify_comment.go: Passes GH_AW_TIMEOUT_MINUTES (the compiled timeout value) as an env var to the handle_agent_failure step.

  • actions/setup/js/handle_agent_failure.cjs:

    • Treats timed_out conclusion as a reportable failure (previously skipped)
    • Adds buildTimeoutContext() — returns empty string unless timed out; when timed out, emits a markdown block with the current duration and a suggested frontmatter fix at currentMinutes + 10
    • Injects timeout_context into both comment and issue template contexts
  • actions/setup/md/agent_failure_{issue,comment}.md: Added {timeout_context} placeholder between {missing_safe_outputs_context} and {fork_context}.

Example output when timeout occurs

**⏱️ Agent Timed Out**: The agent job exceeded the maximum allowed execution time (20 minutes).

To increase the timeout, add or update the `timeout-minutes` setting in your workflow's frontmatter:

​```yaml
---
timeout-minutes: 30
---
​```

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:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw k/gh-aw/gh-aw/ac-c k/gh-aw/gh-aw/ac"prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error k/gh-aw/gh-aw/actions/setup/js/safe_outputs_branch_detection.tes/sys/fs/cgroup k/gh�� h ../../../.prettierignore k/gh-aw/gh-aw/actions/setup/js/safe_outputs_tools_loader.test.cjs sh k/gh-aw/gh-aw/acnode k/gh-aw/gh-aw/ac/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/prettier k/gh-aw/gh-aw/ac--write k/gh-aw/gh-aw/ac../../../**/*.json (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw k/gh-aw/gh-aw/ac-c k/gh-aw/gh-aw/ac"prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error k/gh-aw/gh-aw/actions/setup/js/safe_outputs_branch_detection.tes/sys/fs/cgroup k/gh�� h ../../../.prettierignore k/gh-aw/gh-aw/actions/setup/js/safe_outputs_tools_loader.test.cjs nfig/composer/vendor/bin/bash k/gh-aw/gh-aw/acnode k/gh-aw/gh-aw/ac/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/prettier k/gh-aw/gh-aw/ac--write k/gh-aw/gh-aw/ac../../../**/*.json (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw k/gh-aw/gh-aw/ac-c k/gh-aw/gh-aw/ac"prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error k/gh-aw/gh-aw/actions/setup/js/safe_outputs_branch_detection.tes--noheadings k/gh�� h ../../../.prettierignore k/gh-aw/gh-aw/actions/setup/js/safe_outputs_tools_loader.test.cjs ash k/gh-aw/gh-aw/acnode k/gh-aw/gh-aw/ac/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/prettier k/gh-aw/gh-aw/ac--write k/gh-aw/gh-aw/ac../../../**/*.json (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel go /opt/hostedtoolcache/node/24.13.1/x64/bin/node -json GO111MODULE 64/bin/go node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript4263278230/001/test-frontmatter-with-arrays.md go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel x_amd64/vet /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /usr/bin/git /tmp/shared-actigit rev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git -u origin (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha jpq_JbW5I GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE rtcfg env g/timeutil/format.go g/timeutil/format_test.go ache/go/1.25.0/x64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha ithub/workflows/agent-persona-explorer.md git tartedAt,updatedAt,event,headBranch,headSha,displayTitle --show-toplevel x_amd64/link /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel s9ZXZGY/X4XoDkfirev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/sed --show-toplevel git /usr/bin/git sed (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel sh /usr/bin/git npx prettier --cgit GOPROXY 64/bin/go git conf�� user.email test@example.com /usr/bin/git ub/workflows scripts/**/*.js 64/bin/go /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE til.test git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha "prettier" --write '**/*.cjs' '**/*.ts' '**/*.js-f ave-search x_amd64/vet enerate_aw_info.git anitize_content.rev-parse g/logger/slog_ad--show-toplevel x_amd64/vet -c ithub/workflows g/workflow/playwright_mcp_integration_test.go 64/pkg/tool/linux_amd64/vet .*status\|getRungit tions/setup/js/urev-parse tions/setup/js/v--show-toplevel 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha ithub/workflows (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -bool -buildtags /usr/bin/gh -errorsas -ifaceassert -nilfunc gh run list --json (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ithub/workflows (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha k/gh-aw/gh-aw/.github/workflows (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha "prettier" --write '**/*.cjs' '*-errorsas (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha "prettier" --write '**/*.cjs' '*-errorsas (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha list (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha runs/20260303-014721-35128/test-121776100/custom/workflows git /usr/bin/git --show-toplevel x_amd64/compile /usr/bin/git git rev-�� --show-toplevel l /usr/bin/git --show-toplevel go /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha ithub/workflows dd_workflow_run_comment.cjs x_amd64/vet l anitize_content.rev-parse n-dir/bash x_amd64/vet -c ithub/workflows g/workflow/playwright_mcp_integration_test.go 64/pkg/tool/linux_amd64/vet g/workflow/safe_git g/workflow/mcp_grev-parse run-script/lib/n--show-toplevel 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/go-build359273072/b415/_pkg_.a -trimpath /usr/bin/git -p github.com/githurev-parse -lang=go1.25 /usr/bin/git remo�� -v l /opt/hostedtoolcache/node/24.13.1/x64/bin/node -c=4 -nolocalimports -importcfg node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --noprofile l Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git /opt/hostedtoolcache/node/24.13.1/x64/bin/node --show-toplevel go /usr/bin/git node (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha audit-workflows.md GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 4513-30665/test-920292492 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel git ache/go/1.25.0/x64/bin/bash --show-toplevel go /usr/bin/docker git rev-�� 4046237768 docker /usr/bin/git test/concurrent-git go /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /usr/sbin/bash git rev-�� --show-toplevel bash /usr/bin/bash --noprofile git /usr/bin/git bash (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha h ../../../.pret.prettierignore k/gh-aw/gh-aw/pk--log-level=error 64/bin/bash k/gh-aw/gh-aw/pknode k/gh-aw/gh-aw/pk/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/pre�� k/gh-aw/gh-aw/pk--write k/gh-aw/gh-aw/pk../../../**/*.json k/gh�� w/js/**/*.json' --ignore-path k/gh-aw/gh-aw/pk../../../.prettierignore cal/bin/bash k/gh-aw/gh-aw/pkgit k/gh-aw/gh-aw/pk-C k/gh-aw/gh-aw/pk/home/REDACTED/work/gh-aw/gh-aw/.github/workflows k/gh-aw/gh-aw/pkrev-parse (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go stlo�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 --auto 1/x64/bin/node --detach go /opt/hostedtoolc--show-toplevel git t-ha�� vaScript1029114506/001/test-frontmatter-with-nested-objects.md node /usr/bin/git /tmp/TestHashCongit node 273072/b439/vet.--git-dir git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 systemd-tmpfiles /usr/bin/git GOMODCACHE go /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --git-dir 0354184/b409/impinit /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 git /usr/bin/git --show-current go DiscussionsEnabl--show-toplevel git rev-�� --show-toplevel git /usr/bin/git user.email test@example.comrev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 git /usr/bin/git image:v1.0.0 Test commit /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel node /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 /usr/lib/git-core/git /usr/bin/git v1.0.0 --auto /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel tCvyK1taGOl6 /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 ache/go/1.25.0/x64/pkg/tool/linux_amd64/link /usr/bin/git 273072/b433/workgit -test.v=true 273072/b433/impo--show-toplevel git rev-�� --show-toplevel 7kYzzjWkWLkcX/OA5j_T5I34lbiIQeqNV-/fkB95gE-Fdk14EYrRnf-/qlGQ3Hq7kYzzjWkWLkcX /usr/bin/git ry=1 node che/go-build/1f/--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 -10 /usr/bin/git --oneline -1 /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel node 273072/b432/vet.--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE MaA1-RkpWPSL m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha h ../../../.prettierignore failure\|failure.*status\|getRunFailure\|RunFailure nfig/composer/vendor/bin/bash (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 2240290474/.github/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git 4513-30665/test-git GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha xterm-color git /usr/bin/git 376337810 node /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel node /usr/bin/git git (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel go 64/bin/node -json GO111MODULE ache/go/1.25.0/x--show-toplevel git 1/x6�� --show-toplevel go /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --get-regexp ^remote\..*\.gh-resolved$ 64/bin/node --oneline -10 /usr/bin/git git 1/x6�� --show-toplevel git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion --show-toplevel npx /usr/bin/git 5j_T5I34lbiIQeqNV-/fkB95gE-Fdk14EYrRnf-/qlGQ3Hq7kYzzjWkWLkcX rev-�� --show-toplevel git 1f27291056cb36fc44d050ac9966c6c803bea5dc4d2ff3268f13857a91bd6eef-d --show-toplevel node /usr/bin/gh git (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD erignore go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE erignore env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git 920292492 GO111MODULE ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--noprofile git (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build359273072/b383/cli.test /tmp/go-build359273072/b383/cli.test -test.testlogfile=/tmp/go-build359273072/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go k/gh�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go (http block)
    • Triggering command: /tmp/go-build648155400/b359/cli.test /tmp/go-build648155400/b359/cli.test -test.testlogfile=/tmp/go-build648155400/b359/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.run=Test --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE cfg git (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel go /usr/bin/git 920292492 GO111MODULE ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/22593949999/job/65458968824

Add code to detect that the agent timed out and update the agent failure issue/comment with this information and a frontmatter hint on how to increase the time out.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…tmatter hint

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add detection for agent timeout and update failure comment feat: detect agent timeout and report it with frontmatter hint in failure issue/comment Mar 3, 2026
@pelikhan pelikhan marked this pull request as ready for review March 3, 2026 02:02
Copilot AI review requested due to automatic review settings March 3, 2026 02:02
@pelikhan pelikhan merged commit 6244646 into main Mar 3, 2026
108 checks passed
@pelikhan pelikhan deleted the copilot/add-agent-timeout-detection branch March 3, 2026 02:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds detection and reporting of GitHub Actions job timeouts (timed_out conclusion) in the agent failure handler, which previously silently skipped timeout cases.

Changes:

  • pkg/workflow/notify_comment.go: Extracts the compiled timeout-minutes frontmatter value and passes it as the GH_AW_TIMEOUT_MINUTES env var to the handle_agent_failure step.
  • actions/setup/js/handle_agent_failure.cjs: Treats timed_out conclusion as a reportable failure and adds buildTimeoutContext() to emit a markdown block with the current duration and a suggested timeout-minutes increase of +10 minutes.
  • actions/setup/md/agent_failure_{issue,comment}.md: Adds {timeout_context} placeholder in the failure templates.
  • ~100 .lock.yml files: Regenerated to include the new GH_AW_TIMEOUT_MINUTES env var in each workflow's conclusion job.

Reviewed changes

Copilot reviewed 162 out of 162 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/workflow/notify_comment.go Extracts and passes GH_AW_TIMEOUT_MINUTES to the failure handler step
actions/setup/js/handle_agent_failure.cjs Adds timed_out handling, buildTimeoutContext() helper, and injects timeout_context into both comment and issue template contexts
actions/setup/md/agent_failure_issue.md Adds {timeout_context} placeholder in issue failure template
actions/setup/md/agent_failure_comment.md Adds {timeout_context} placeholder in comment failure template
*.lock.yml (many files) Regenerated with GH_AW_TIMEOUT_MINUTES set to each workflow's configured timeout value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return "";
}

const currentMinutes = parseInt(timeoutMinutes || "20", 10);
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The buildTimeoutContext function uses a hardcoded default of "20" minutes as fallback when timeoutMinutes is empty:

const currentMinutes = parseInt(timeoutMinutes || "20", 10);

This fallback is fragile and couples the JS code to the default timeout constant defined in Go (constants.DefaultAgenticWorkflowTimeout). If the default is ever changed in Go, the JS fallback will silently produce incorrect timeout suggestions. Since GH_AW_TIMEOUT_MINUTES is always set by tools.go (which applies the same default), the fallback should never actually be reached, but if it ever were triggered (e.g., in a code path that doesn't call applyDefaultTools), it would silently suggest an incorrect value rather than alerting the user.

Copilot uses AI. Check for mistakes.
Comment on lines +436 to +454
function buildTimeoutContext(isTimedOut, timeoutMinutes) {
if (!isTimedOut) {
return "";
}

const currentMinutes = parseInt(timeoutMinutes || "20", 10);
const suggestedMinutes = currentMinutes + 10;

let ctx = "\n**⏱️ Agent Timed Out**: The agent job exceeded the maximum allowed execution time";
ctx += ` (${currentMinutes} minutes).`;
ctx += "\n\nTo increase the timeout, add or update the `timeout-minutes` setting in your workflow's frontmatter:\n\n";
ctx += "```yaml\n";
ctx += "---\n";
ctx += `timeout-minutes: ${suggestedMinutes}\n`;
ctx += "---\n";
ctx += "```\n\n";

return ctx;
}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The buildTimeoutContext function is defined but not exported via module.exports. The rest of the actions/setup/js/ codebase has comprehensive unit tests in .test.cjs files, and helper functions are typically exported to enable testing. buildTimeoutContext should be covered by tests for at least: (1) when isTimedOut is false, (2) when isTimedOut is true with a specific timeoutMinutes value, and (3) when isTimedOut is true with an empty timeoutMinutes. The function should be exported to allow testability.

Copilot uses AI. Check for mistakes.
Comment on lines +191 to +195
// Pass timeout minutes value so the failure handler can provide an actionable hint when timed out
timeoutValue := strings.TrimPrefix(data.TimeoutMinutes, "timeout-minutes: ")
if timeoutValue != "" {
agentFailureEnvVars = append(agentFailureEnvVars, fmt.Sprintf(" GH_AW_TIMEOUT_MINUTES: %q\n", timeoutValue))
}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

There is no test coverage in notify_comment_test.go for the new GH_AW_TIMEOUT_MINUTES environment variable that is now emitted by buildConclusionJob. The existing tests in notify_comment_test.go check for the presence or absence of other env vars (e.g. GH_AW_AGENT_CONCLUSION, GH_AW_SAFE_OUTPUT_MESSAGES). A test verifying that GH_AW_TIMEOUT_MINUTES is correctly included in the generated step YAML when TimeoutMinutes is set (and omitted when it's empty) should be added.

Copilot uses AI. Check for mistakes.
github-actions bot pushed a commit that referenced this pull request Mar 3, 2026
- Fix safe-outputs.md: update section heading from deprecated `app:`
  to `github-app:` to match the rename in #19295
- Add 'Workflow Job Timed Out' entry to common-issues.md documenting
  the new timeout detection and frontmatter hint from #19307

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

3 participants