Skip to content

fix(otel): emit agent sub-span for cancelled workflow runs#28172

Merged
pelikhan merged 3 commits intomainfrom
copilot/otel-advisor-emit-agent-sub-span
Apr 23, 2026
Merged

fix(otel): emit agent sub-span for cancelled workflow runs#28172
pelikhan merged 3 commits intomainfrom
copilot/otel-advisor-emit-agent-sub-span

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

When a workflow is manually cancelled before agent_output.json is written, agentEndMs remained null and the gh-aw.agent.agent sub-span was suppressed — leaving no duration signal in the trace.

Changes

  • send_otlp_span.cjs: Extend the statSync fallback to include isAgentCancelled alongside isAgentFailure, so agentEndMs = nowMs() is set and the agent sub-span is emitted for cancelled runs.
// Before
if (isAgentFailure && jobName === "agent" && ...)

// After
if ((isAgentFailure || isAgentCancelled) && jobName === "agent" && ...)
  • send_otlp_span.test.cjs: Add test case asserting two-span emission (gh-aw.agent.agent + gh-aw.agent.conclusion) when agent_output.json is absent and conclusion is "cancelled".

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 gh repo view --json owner,name --jq .owner.login + "/" + .name 64/pkg/tool/linux_amd64/vet GOINSECURE 3661962/b011/asm-unsafeptr=false ache/go/1.25.8/x-unreachable=false 64/pkg/tool/linu/tmp/go-build2782606069/b114/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 131392068 .cfg 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/link -c ger.test EgAi/JW5fl0E13YyEocudEgAi x_amd64/vet -n1 b/gh-aw/pkg/acticonfig --end-of-options--get-regexp x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 131392068 .cfg .cfg GOINSECURE contextprotocol/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -c 2606069/b395/_pkg_.a log ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -n1 --format=format:run --end-of-optionsdownload ache/go/1.25.8/x12345 (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (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, .object.type] | @tsv -v 64/pkg/tool/linuremote.origin.url /usr/bin/git y_with_explicit_git .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git 3661962/b002/_pknode SK0W/BJGJRDpSI4w/opt/hostedtoolcache/node/24.14.1/x64/bin/npm ck git (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, .object.type] | @tsv GOMODCACHE x_amd64/compile /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json GO111MODULE x_amd64/vet node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript1604128912/001/test-inlined-imports-enabled-with-env-temgit x_amd64/vet ache/node/24.14.1/x64/bin/node -json GO111MODULE x_amd64/vet ache/node/24.14.1/x64/bin/node (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, .object.type] | @tsv se 2606069/b087/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -I /tmp/go-build343diff -I ache/go/1.25.8/x--name-only -o st-1985102404/.github/workflows -trimpath 1/x64/bin/node -p crypto/hmac -lang=go1.25 /opt/hostedtoolcache/go/1.25.8/xTest User (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git sRemoteWithRealGtr sRemoteWithRealG\n .cfg git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git or.md 2606069/b240/vetrev-parse ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git /tmp/go-build278git (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, .object.type] | @tsv ithub/workflows/archie.md -tests 2606069/b465=> -json b/gh-aw/pkg/typerev-parse x_amd64/compile git -C 88qG/8AJ7Y7dVpgtqOdVA88qG (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, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linuTest User /usr/bin/git /tmp/go-build343git -trimpath /opt/hostedtoolc-m git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuremote.origin.url /usr/bin/git -bool -buildtags 2606069/b316/vet--show-toplevel git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/asm GOINSECURE GOMOD GOMODCACHE x_amd64/asm env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build2782606069/b438/importcfg -pack /tmp/go-build2782606069/b438/_testmain.go env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json g/catmsg.go x_amd64/compile GOINSECURE GOMOD bytealg/equal_wa--show-toplevel x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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, .object.type] | @tsv --show-toplevel F6buppr/4AZU-IsIremote.origin.url /usr/bin/git ortcfg .cfg 64/pkg/tool/linu--show-toplevel /usr/bin/git conf�� --get-regexp ^remote\..*\.gh-resolved$ /usr/bin/git ortcfg .cfg 64/pkg/tool/linu--show-toplevel 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, .object.type] | @tsv k/gh-aw/gh-aw/pkg/cli remote /usr/bin/gh hyphen1442622368git hyphen1442622368rev-parse x_amd64/compile gh api /repos/actions/github-script/git/ref/tags/v9 --jq om/org2/repo2.git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel 64/pkg/tool/linuremote.origin.url /usr/bin/git tmatter-with-envgit b-AbBFuh- 64/pkg/tool/linu--show-toplevel /usr/bin/git remo�� -v 64/pkg/tool/linufeature-branch /usr/bin/git ortcfg .cfg 64/pkg/tool/linu--show-toplevel git (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, .object.type] | @tsv --show-toplevel -dwarf=false /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link go1.25.8 -c=4 -nolocalimports /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuremote -o runs/20260423-215735-35517/test-3588689961 -importcfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet s/test.md -w -buildmode=exe /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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, .object.type] | @tsv c533454f..HEAD ings.cjs 64/bin/git --verify --quiet 86_64/git forks.js k/gh�� -u st/suppress-warn-w _modules/.bin/gi-buildmode=exe it t de_modules/.bin/--require st/dist/workers//home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv a797ce1a..HEAD Second commit in full mode test $name) { hasDiscussionsEnabled } } user.email e commit ode_modules/.bin-m git show�� a797ce1a..HEAD fb0650ef3747a3b1c533454f 1/x64/bin/node /tmp/bare-incremgit gin/token-option-C bin/git 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv -m Second commit in full mode test ache/uv/0.11.7/x86_64/git user.email e commit modules/@npmcli/--require git show�� a797ce1a..HEAD st/suppress-warn--conditions 1/x64/bin/node /tmp/bare-increm/usr/bin/gh gin/token-optionapi /git st/dist/workers/-f (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/compile /opt/hostedtoolcache/node/24.14.1/x64/bin/node ortcfg 0kiaYELPw 64/pkg/tool/linu--show-toplevel /opt/hostedtoolcache/node/24.14.1/x64/bin/node /tmp�� Actor: ${{ github.actor }}, Repo: ${{ github.repository }} XFDo5AA/4Ab4WdaLInitial commit /usr/bin/git ortcfg .cfg 64/pkg/tool/linu--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv /tmp/gh-aw-test-runs/20260423-215735-35517/test-test-logs/run-12346 remote /usr/bin/git -json GO111MODULE x_amd64/compile git -C /tmp/gh-aw-test-runs/20260423-215735-35517/test-131392068 remote /usr/bin/git -json GO111MODULE x_amd64/link git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv ithub/workflows/agentic-optimization-kit.md rev-parse /usr/bin/git go1.25.8 -c=4 -nolocalimports git -C /tmp/gh-aw-test-runs/20260423-215735-35517/test-131392068 rev-parse /usr/bin/git 01 GO111MODULE x_amd64/compile git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3661962/b245/_pkg_.a GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE t/internal/strinrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linurev-parse (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3661962/b257/_pkg_.a DUdE/2oEXO76xEThYfB4YDUdE x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/sha256 GOMODCACHE 64/pkg/tool/linuTest User env 563653668 t2Bi/LbyKJAzlPTfrrG8ct2Bi ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 om/modelcontextprotocol/go-sdk@v1.5.0/internal/m-ifaceassert 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuTest User ortc�� 131392068 stmain.go .cfg GOINSECURE contextprotocol/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-importcfg (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE fips140 GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3661962/b219/_pkg_.a i2Jk/kxQktkbJrdZm0O72i2Jk .cfg GOINSECURE g/x/text/unicoderev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/check GOMODCACHE 64/pkg/tool/linux_amd64/vet env 131392068 .cfg .cfg GOINSECURE contextprotocol/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE hlite 3661962/b013/sym--show-toplevel pBvTgXO/G1KutSxXHjoE8hqd2SJr env 3661962/b241/_pkg_.a _zAe/m6K4S-499xrKjIdi_zAe x_amd64/link GOINSECURE t/internal/langurev-parse GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 1414129313/custom/workflows Kv-X/SrddFjc3EqPBzwz7Kv-X 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 3661962/b007/symuser.name 64/pkg/tool/linuTest User ache�� 1048085975/.github/workflows GO111MODULE ache/go/1.25.8/x64/pkg/tool/linu-lang=go1.25 GOINSECURE /semver GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuremote (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/drbg GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3661962/b236/_pkg_.a NNuM/NZNs7zEf3uyY_7BzNNuM 64/pkg/tool/linux_amd64/compile GOINSECURE osh-tekuri/jsonsrev-parse GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name rg/x/text@v0.36.0/internal/language/common.go 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 3661962/b013/symabis 64/pkg/tool/linux_amd64/vet env 1048085975/.github/workflows r73k/ZR15bOYtzO_sNGC5r73k .cfg GOINSECURE b/gh-aw/pkg/giturev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-extld=gcc (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE entropy GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3661962/b237/_pkg_.a .cfg ache/go/1.25.8/x64/pkg/tool/linu-test.short=true GOINSECURE t/message GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu--jq (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 3661962/b007/symuser.email 64/pkg/tool/linutest@example.com env 1048085975/.github/workflows 7Ps3/Xuna8G_bMUX3GMM57Ps3 ache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe GOINSECURE g/x/net/http/httrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-extld=gcc (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/aes/gcm GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3661962/b235/_pkg_.a ho52/RILG8Ja3npv64jHUho52 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE osh-tekuri/jsonsrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path 10571954/001' 10571954/001' -importcfg /tmp/go-build2782606069/b419/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/fileutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/tar.go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (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 x_amd64/vet env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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 b/gh-aw/pkg/slicrev-parse GOMODCACHE 64/pkg/tool/linux_amd64/vet env 3661962/b191/_pkg_.a GO111MODULE .test GOINSECURE (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build2782606069/b404/cli.test /tmp/go-build2782606069/b404/cli.test -test.testlogfile=/tmp/go-build2782606069/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE x_amd64/asm env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linuTest User /usr/bin/git 5735-35517/test-git -trimpath ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ortcfg /usr/bin/git g/logger/doc.go g/logger/logger.-lh x_amd64/vet git (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, .object.type] | @tsv se 2606069/b011/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuTest User 3661�� crypto/internal/boring/sig pkg/mod/github.com/segmentio/asm@v1.1.3/cpu/arm/arm.go .cfg -I /tmp/go-build343rev-parse -I ache/go/1.25.8/x64/pkg/tool/linuremote.myorg.url (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv go GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env Gitmain_branch410571954/001' Gitmain_branch410571954/001' x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env g_.a @v1.1.3/base64/b-ifaceassert x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD sm_wasm.s x_amd64/vet env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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, .object.type] | @tsv se 2606069/b006/vet.cfg ck GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet sRem�� se 2606069/b156/vet.cfg .cfg -p unicode/utf16 -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linuremote1 (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 b/gh-aw/pkg/loggconfig GOMODCACHE 64/pkg/tool/linuTest User (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 x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -o 12/001/test-frontmatter-with-nested-objects.md -Eee/499QsILxkBjFfa_H-Eee .cfg -buildmode=exe -buildid=wpqmYUj/tmp/test-import-3165366324.js -s ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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 0571954/001' 0571954/001' x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch 3661962/b235/_pkg_.a ho52/RILG8Ja3npv64jHUho52 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE osh-tekuri/jsonsrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git conf�� --local --get ode_modules/.bin/git modules/@npmcli//usr/lib/git-core/git git /git git add . git tions/setup/node_modules/.bin/git -M main bin/git git (dns block)

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

When a workflow run is manually cancelled while the agent is executing,
agent_output.json may not exist because the process was killed before
writing output. The statSync fallback that sets agentEndMs = nowMs() was
previously only applied for isAgentFailure ("failure" | "timed_out").

Include isAgentCancelled in the condition so the dedicated agent sub-span
is also emitted for cancelled runs, giving on-call engineers visibility
into how long the agent ran before cancellation.

Also add a corresponding test case for the cancelled scenario.

Fixes #[issue]

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7424f8db-1e3b-431d-bf7a-fec3562805db

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve OTel instrumentation to emit sub-span for cancelled runs fix(otel): emit agent sub-span for cancelled workflow runs Apr 23, 2026
Copilot AI requested a review from pelikhan April 23, 2026 22:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

Smoke CI completed successfully!

@github-actions
Copy link
Copy Markdown
Contributor

✅ smoke-ci: safeoutputs CLI comment + comment-memory run (24861145209)

Generated by Smoke CI for issue #28172 ·

@github-actions
Copy link
Copy Markdown
Contributor

Comment Memory

`````` CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing ``````

Note

This comment is managed by comment memory.

What this comment does

It stores persistent context for this thread in the <gh-aw-comment-memory> block at the top of this comment.
Edit only the text in that block; workflow metadata and the footer are regenerated automatically.

Generated by Smoke CI for issue #28172 ·

@pelikhan pelikhan marked this pull request as ready for review April 23, 2026 22:07
Copilot AI review requested due to automatic review settings April 23, 2026 22:07
@pelikhan pelikhan merged commit 1506b76 into main Apr 23, 2026
33 checks passed
@pelikhan pelikhan deleted the copilot/otel-advisor-emit-agent-sub-span branch April 23, 2026 22:09
Copy link
Copy Markdown
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 fixes missing trace duration signal for manually-cancelled agent workflow runs by ensuring the dedicated agent sub-span is still emitted even when agent_output.json was never written.

Changes:

  • Extend the agent_output.json mtime fallback so cancelled agent runs also set agentEndMs = nowMs() and emit gh-aw.agent.agent.
  • Add a Vitest case covering the “cancelled + missing agent_output.json” path, asserting two-span emission and correct parent/child linkage.
Show a summary per file
File Description
actions/setup/js/send_otlp_span.cjs Includes cancelled runs in the missing-agent_output.json fallback so the agent sub-span is emitted with a duration.
actions/setup/js/send_otlp_span.test.cjs Adds coverage ensuring cancelled agent runs emit both the agent sub-span and the conclusion span when mtime is unavailable.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 80/100

Excellent

Metric Value
New/modified tests analyzed 1
✅ Design tests (behavioral contracts) 1 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 1 (100%)
Duplicate test clusters 0
Test inflation detected Yes (32 test lines / 5 prod lines ≈ 6.4:1)
🚨 Coding-guideline violations None

Test Classification Details

Test File Classification Issues Detected
emits a dedicated agent span on cancelled when agent_output mtime is unavailable actions/setup/js/send_otlp_span.test.cjs ✅ Design Minor: test inflation (6.4:1 ratio)

Flagged Tests — Requires Review

No tests require review. The single new test is well-structured and covers the behavioral contract directly.

The test inflation flag (6.4:1) is a false positive in this context: the production change is a small targeted fix (5 lines changed in a catch-block condition), and the corresponding test is appropriately comprehensive to verify the new cancellation path end-to-end. This is not copy-paste inflation.


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 0 tests
  • 🟨 JavaScript (*.test.cjs, *.test.js): 1 test (vitest)

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). The new test directly verifies the behavioral contract introduced by the fix: when agent_output.json is absent and the conclusion is cancelled, a dedicated agent sub-span is emitted with correct span hierarchy, timing, status code, and message.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

References: §24861294937

🧪 Test quality analysis by Test Quality Sentinel · ● 335.5K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 80/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). The single new test covers the behavioral contract for the cancellation fix directly.

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.

[otel-advisor] OTel improvement: emit agent execution sub-span for cancelled workflow runs

3 participants