Skip to content

feat: add gen_ai.usage token breakdown to conclusion spans#29987

Merged
pelikhan merged 3 commits intomainfrom
copilot/otel-improvement-add-gen-ai-usage-token-breakdown
May 3, 2026
Merged

feat: add gen_ai.usage token breakdown to conclusion spans#29987
pelikhan merged 3 commits intomainfrom
copilot/otel-improvement-add-gen-ai-usage-token-breakdown

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 3, 2026

The four GenAI token-usage attributes were only emitted on the child gh-aw.agent.agent span, forcing an extra join to answer basic observability questions (input vs. output tokens, cache hit rate, high-burn workflows) from the parent conclusion span.

Changes

  • send_otlp_span.cjs: Hoists agent_usage.json read outside the agent sub-span if-block; adds the four gen_ai.usage.* attributes to the conclusion span's attributes array with the same > 0 guards. Removes duplicate additions from agentAttributes — the agent sub-span inherits them via [...attributes].

  • send_otlp_span.test.cjs: Adds describe("token breakdown enrichment in conclusion span") with four tests covering: all attrs present with/without an agent sub-span, attrs absent when agent_usage.json is missing, zero-value attrs omitted.

The conclusion span now carries the full per-category token breakdown alongside gh-aw.effective_tokens, enabling single-span queries in Grafana Tempo, Honeycomb, and Datadog without correlating child spans.

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 ortcfg.link GOINSECURE GOMOD GOMODCACHE m1RSUMDWpuEBLQ2voW/3t_w0SZJGzytOO6wl66L/5tVqSsRE--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 util 64/bin/go x_amd64/link -o t_NmpAeXU -trimpath ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -p log/slog/internainit -lang=go1.25 J_/CWrYu2czG7Ca7ylQP4Z8/vCNYLdc7D8RXanEmFBss (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 GOWORK 64/bin/go ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet sRem�� 3405487/b212/importcfg -trimpath ser.test -p path -lang=go1.25 ser.test (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/vet GOINSECURE GOMOD ys_wasm.s x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name --show-toplevel git /prettier ithub-script/gitbash git bject.type] | @t--noprofile git rev-�� json' --ignore-path ../../../.pr**/*.json git /usr/bin/git ithub-script/gitnode git bject.type] | @t/tmp/TestHashStability_SameInputSameOutput3043636627/001/stability-test.md git (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 --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git -bool -buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv --show-toplevel sh /usr/bin/git npx prettier --cgit git /home/REDACTED/.ca--show-toplevel git rev-�� --show-toplevel sh /usr/bin/git ithub-script/gitgh git ache/node/24.14./repos/actions/github-script/git/ref/tags/v9 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 64/src/runtime/r--show-toplevel x_amd64/vet /usr/bin/git ed-imports-enablgit .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/infocmp hub/workflows .cfg 64/pkg/tool/linu--show-toplevel infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 ache/go/1.25.8/xconfig sv th .prettierignogit infocmp bin/sh git conf�� user.name Test User r,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,disp--show-toplevel 48/001/test-frongit flow-12345 DiscussionsEnabl--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 node bject.type] | @tsv /tmp/TestHashCongit x_amd64/compile /tmp/go-build249--show-toplevel git rev-�� --show-toplevel /tmp/go-build249--jq /usr/bin/infocmp s/test.md -test.v=true ache/node/24.14./repos/actions/github-script/git/ref/tags/v9 infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git /tmp/TestHashCongit x_amd64/compile /usr/bin/git git rev-�� /ref/tags/v9 git sv --show-toplevel x_amd64/vet /usr/bin/git gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 git bject.type] | @tsv /usr/bin/git infocmp /usr/bin/git git rev-�� --show-toplevel git /usr/bin/infocmp /tmp/TestGuardPogh config (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 3550-35932/test-3976699434 /tmp/go-build2496848616/b066/vet.cfg 1/x64/bin/node -goversion go1.25.8 -c=4 /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuorigin t-ha�� ithub/workflows/ace-editor.md =my-default /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linutest@example.com (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git /tmp/TestParseDegit /tmp/TestParseDerev-parse /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link /usr/bin/git ErrorFormatting1git -importcfg /usr/bin/git 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 git /usr/bin/git --show-toplevel ache/go/1.25.8/xrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/infocmp --show-toplevel ache/go/1.25.8/xrev-parse /usr/bin/git infocmp (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 t0 -tests 1/x64/bin/node m0s GO111MODULE (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv poJ_/sX9FX53sm1OTZ6jdpoJ_ remote ache/node/24.14.1/x64/bin/node -json GO111MODULE x_amd64/compile ache/node/24.14.1/x64/bin/node 1083�� uts.enforce_all == 'true' s/1/artifacts /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu-f -json GO111MODULE x_amd64/vet /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 -extld=gcc sv -json GO111MODULE x_amd64/vet git remo�� GOMODCACHE x_amd64/vet /usr/bin/git g_.a GO111MODULE x_amd64/vet git (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 /ref/tags/v9 infocmp sv xterm-color x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 infocmp sv xterm-color git clusion,workflow/repos/actions/github-script/git/ref/tags/v9 git rev-�� --show-toplevel git /usr/bin/infocmp ache/node/24.14.infocmp git /usr/bin/git infocmp (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/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json eyset.go 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 -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json .go 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 -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/github-script/git/ref/tags/v9.0.0
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json 8601/parse.go 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.0.0 --jq [.object.sha, .object.type] | @tsv -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)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE pcNe7Xu/0oR-jriF-buildtags env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (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 ache/go/1.25.8/xorigin /usr/bin/git 729735934 /tmp/go-build249-1 flow.lock.yml git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git .md -buildtags /proc/self/fd/9 git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel sh /usr/bin/git 3818-48943/test-gh infocmp /opt/hostedtoolc/repos/actions/github-script/git/ref/tags/v9 git rev-�� --show-toplevel sh /usr/bin/git 3818-48943/test-git gh /home/REDACTED/wor--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 --get remote.origin.url /usr/bin/git g_.a _56Gjvce9 x_amd64/vet git chec�� master x_amd64/vet /usr/bin/infocmp 345 GO111MODULE 64/pkg/tool/linu--show-toplevel infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git 729735934/.githugit /tmp/go-build249rev-parse 6848616/b296/vet--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git 3550-35932/test-git /tmp/go-build249rev-parse (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 6848616/b455/importcfg bject.type] | @tsv k/gh-aw/gh-aw/pkgit k/gh-aw/gh-aw/pkrev-parse /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuremote.origin.url /usr/bin/git runs/20260503-18infocmp -trimpath /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv --show-toplevel -tests /usr/lib/git-core/git -json GO111MODULE x_amd64/compile /usr/lib/git-core/git unpa�� --pack_header=2,3 -q 6848616/b458/vet.cfg -json /color.go x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv xterm-color /home/REDACTED/work/gh-aw/gh-aw/pkg/gitutil/gitutil_test.go epo.git -json GO111MODULE x_amd64/compile git conf�� user.name s/5/artifacts ache/node/24.14.1/x64/bin/node ith-tools.md GO111MODULE x_amd64/vet ache/node/24.14.1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv /tmp/go-build2496848616/b465/_pkg_.a -trimpath /usr/bin/git -p github.com/githurev-parse -lang=go1.25 git conf�� --get remote.origin.url /usr/bin/git -c=4 -nolocalimports -importcfg 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 x_amd64/vet /usr/bin/git g_.a GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git g_.a 7JGiP3oGe x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv Actor: ${{ github.actor }}, Repo: ${{ github.repository }} git /usr/bin/git th .prettierignogit git /usr/bin/git git remo�� /ref/tags/v9 git sv ithub-script/gitgit git 86_64/sh git (http block)
  • https://api.github.com/repos/aws-actions/configure-aws-credentials/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git k/gh-aw/gh-aw/.ggit remote /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git runs/20260503-18gh -trimpath /usr/bin/infocmpstatus git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 git bject.type] | @tsv ithub-script/gitgit rev-parse ache/node/24.14.user.name git rev-�� /ref/tags/v9 ache/node/24.14.1/x64/bin/node sv uts.enforce_all git remote 0"}} gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/aws-actions/configure-aws-credentials/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel /usr/lib/git-core/git /usr/bin/git run --auto /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git k/gh-aw/gh-aw/pkgh remote /usr/bin/git git (http block)
  • https://api.github.com/repos/azure/login/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/azure/login/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel git /usr/bin/git --show-toplevel x_amd64/compile /usr/bin/git git rev-�� --show-toplevel git /usr/bin/infocmp /tmp/gh-aw-test-infocmp remote /usr/bin/git infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/azure/login/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv --show-toplevel gh /usr/bin/git list --json /usr/bin/git git rev-�� --show-toplevel git /usr/bin/infocmp /tmp/TestGuardPoinfocmp (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link /usr/bin/git ErrorFormatting1git -importcfg /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git s/test.md rev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv --show-toplevel /usr/bin/git /usr/bin/git -v (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 ache/go/1.25.8/xsh /usr/bin/git vaScript16830937gh /tmp/go-build249api /opt/hostedtoolc/repos/actions/github-script/git/ref/tags/v9 git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git runs/20260503-18infocmp -buildtags 6848616/b394/vetxterm-color git (http block)
    • 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 sh /usr/bin/infocmp npx prettier --wgit git /home/REDACTED/.lo--show-toplevel infocmp -1 xterm-color node /usr/bin/git --write scripts/**/*.js e/git 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 /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/ai-moderator.md d43tsyO/DAaZteIL-3lxG0HoYBiF /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json GO111MODULE ed } } /opt/hostedtoolcache/node/24.14.1/x64/bin/node /tmp�� needs.build.outputs.version x_amd64/vet /usr/bin/git ub/workflows GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv /ref/tags/v9 config sv remote.origin.urgit infocmp (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 xterm-color -dwarf=false /usr/bin/git go1.25.8 -c=4 -nolocalimports git -C /tmp/shared-actions-test902383323 remote .cfg ub/workflows GO111MODULE 64/pkg/tool/linu--show-toplevel e/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv /home/REDACTED/work/gh-aw/gh-aw/.github/workflows rev-parse /usr/bin/git iant-2903834345 git /usr/bin/git git init�� k/_temp/uv-pytho/tmp/gh-aw-test-runs/20260503-183818-48943/test-1362980621/.github/workflows git 0"}} --show-toplevel git 86_64/node git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --limit 100 --created >=2026-04-26 GOMOD GOMODCACHE 64/pkg/tool/linuTest User itma�� ortcfg GO111MODULE x_amd64/compile GOINSECURE fips140/aes 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 --limit 100 --created >=2026-04-03 eader GOMODCACHE 64/pkg/tool/linuremote.origin.url env ortcfg vce9/Iw7fHw9tzQV_56Gjvce9 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_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 --limit 100 --created >=2026-02-02 GOMOD GOMODCACHE 64/pkg/tool/linuremote.origin.url itcu�� or.md .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 3405487/b007/symtest.txt 64/pkg/tool/linux_amd64/vet (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 rTOi/gKjgtBqA_nQbbyq8rTOi ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE b/gh-aw/pkg/semvremote GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-importcfg (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 28ie/dWadUuI3oiBsYAOo28ie ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE contextprotocol/config GOMODCACHE ache/go/1.25.8/xTest User (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name git 64/pkg/tool/linux_amd64/vet /ref/tags/v9 git sv 64/pkg/tool/linuremote.origin.url --no�� ck '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore git /home/REDACTED/work/node_modules/.bin/node --show-toplevel git /usr/bin/git node (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 ahb4/lZep-2MiwczJtV1iahb4 64/pkg/tool/linux_amd64/link GOINSECURE g/x/net/idna GOMODCACHE 64/pkg/tool/linux_amd64/link -c ger.test zLU2/r48K25Cv2sXeJpt1zLU2 x_amd64/vet -n1 b/gh-aw/pkg/actirev-parse --end-of-options--show-toplevel x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE .cfg GOINSECURE t/internal/tag GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name -tests ache/node/24.14.1/x64/bin/npx rkflow/js/**/*.jinfocmp git erignore bash --no�� DefaultBranchFromLsRemoteWithRealGitbranch_with_hyphen818211353/001' DefaultBranchFromLsRemoteWithRealGitbranch_with_hyphen818211353/001' ache/go/1.25.8/x64/bin/node ./../.prettieriggit git erignore sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1234567890
    • Triggering command: /usr/bin/gh gh api repos/{owner}/{repo}/actions/runs/1234567890 --jq {databaseId: .id, number: .run_number, url: .html_url, status: .status, conclusion: .conclusion, workflowName: .name, workflowPath: .path, createdAt: .created_at, startedAt: .run_started_at, updatedAt: .updated_at, event: .event, headBranch: .head_branch, -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD reflectlite/asm.user.name x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api repos/{owner}/{repo}/actions/runs/1234567890 --jq {databaseId: .id, number: .run_number, url: .html_url, status: .status, conclusion: .conclusion, workflowName: .name, workflowPath: .path, createdAt: .created_at, startedAt: .run_started_at, updatedAt: .updated_at, event: .event, headBranch: .head_branch, --show-toplevel git /usr/bin/git ithub-script/git/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link git bject.type] | @tsv git /pre�� json' --ignore-path ../../../.pr**/*.json git /usr/bin/git --show-toplevel git (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 .cfg .cfg GOINSECURE GOMOD 3405487/b092/sym--show-toplevel ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url for-�� 5460/001/stability-test.md RS1g/SSt3JQqVRjkcjNZiRS1g ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOSUMDB b/gh-aw/pkg/ageninit 64/bin/go 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 V7o_/18xeupG6XnJInX8DV7o_ .cfg GOINSECURE g/x/net/http/httrun GOMODCACHE ache/go/1.25.8/x--json (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name -tests ck rkflow/js/**/*.jgit git erignore bash sRem�� --noprofile du ache/node/24.14.1/x64/bin/node ./../.prettieriggit git bject.type] | @t--show-toplevel erignore (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 zBGz/yhMlvprrXT_DfcRFzBGz .cfg GOINSECURE b/gh-aw/pkg/acticonfig GOMODCACHE ache/go/1.25.8/x^remote\..*\.gh-resolved$ (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 3NxN/fOrMapTM_SttVIFB3NxN x_amd64/compile GOINSECURE l/httpcommon GOMODCACHE x_amd64/compile 4968�� se 6848616/b055/vet.cfg .cfg -p internal/runtimerev-parse -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name git k/node_modules/.bin/sh --show-toplevel git ode-gyp-bin/node--show-toplevel bash --no�� ck '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore infocmp ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile xterm-color git ode-gyp-bin/node--show-toplevel ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url (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 jfLv/0caWgwAWMGdke8fejfLv x_amd64/compile GOINSECURE t/internal/languinit GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 verutil_test.go ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE th2 GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu/tmp/go-build2496848616/b113/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name git k/gh-aw/node_modules/.bin/sh ithub-script/gitgit git bject.type] | @t--get bash --no�� ck '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore gh ache/go/1.25.8/x64/bin/go /ref/tags/v9 --jq sv node (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 k-ff/hcoMcb4nJlDk1Ubnk-ff ache/go/1.25.8/x64/pkg/tool/linu-nilfunc GOINSECURE t/language GOMODCACHE ache/go/1.25.8/xTest User (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE x_amd64/link GOINSECURE th2/internal GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name git 1/x64/bin/node ithub-script/gitgit git bject.type] | @tsv bash t-ha�� ithub/workflows/ab-testing-advisor.md infocmp ache/go/1.25.8/x64/pkg/tool/linux_amd64/cgo xterm-color git /usr/bin/infocmpxterm-color 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 GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE v3 GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE ache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe GOINSECURE contextprotocol/init GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu/tmp/go-build2496848616/b112/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name git 1/x64/bin/node /ref/tags/v9 git sv bash t-ha�� ithub/workflows/ab-testing-advisor.md gh ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm status git /usr/bin/gh ache/go/1.25.8/x--jq (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile 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 100 GOMOD GOMODCACHE Ww7VJguVlRAx env g_.a 5.0/internal/doc.go x_amd64/vet GOINSECURE o8601 abis 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 g/x/crypto/chachremote GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/link -c ithub/workflows Bcts/l-3Xgegn_V4R30X4Bcts .cfg --format=%H:%ct GOWORK 64/bin/go ache/go/1.25.8/xtest@example.com (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build2496848616/b404/cli.test /tmp/go-build2496848616/b404/cli.test -test.testlogfile=/tmp/go-build2496848616/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)
    • Triggering command: /tmp/go-build1455969920/b404/cli.test /tmp/go-build1455969920/b404/cli.test -test.testlogfile=/tmp/go-build1455969920/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true --show-toplevel git /usr/bin/git git rev-�� w/js/**/*.json' --ignore-path git /usr/bin/git ithub-script/gitnode e/git-remote-htt/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/prettier (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 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 pC4FS5t0C 6848616/b101/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -p errors -lang=go1.25 ortcfg -o g/gitutil/gitutil.go g/gitutil/gitutil_test.go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe -p crypto/internal/api -lang=go1.25 /opt/hostedtoolc--jq (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 infocmp bject.type] | @tsv ch git /usr/bin/git git ules�� lic_2424895516/0remote.origin.url git 86_64/node --show-toplevel git /usr/bin/infocmp/repos/github/gh-aw/git/ref/tags/v3.0.0 git (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 g_.a rt.go x_amd64/vet GOINSECURE s GOMODCACHE x_amd64/vet env b/workflows GO111MODULE 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/v1.2.3 --jq [.object.sha, .object.type] | @tsv xterm-color infocmp n-dir/bash xterm-color git (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 g_.a oding@v0.5.4/jso-nolocalimports x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env ub/workflows YGaDW_VvF 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuconfig (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 ub/workflows GO111MODULE x_amd64/compile GOINSECURE s.o 64/src/runtime/i/tmp/TestHashConsistency_WithImports3682185541/001/main.md x_amd64/compile (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 GO111MODULE x_amd64/vet GOINSECURE go-sdk/internal/-C 64/src/runtime/p/tmp/gh-aw-test-runs/20260503-183550-35932/test-1720411482 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 g_.a GO111MODULE x_amd64/vet GOINSECURE nal/alias GOMODCACHE x_amd64/vet env g_.a LvhFNvMoO 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv iant-1382059801/.github/workflows infocmp _modules/.bin/node xterm-color git /usr/bin/gh git rev-�� --show-toplevel gh ache/node/24.14.1/x64/bin/npm /repos/actions/ggit --jq /usr/bin/git git (http block)
  • https://api.github.com/repos/google-github-actions/auth/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/google-github-actions/auth/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linurepos/{owner}/{repo}/actions/runs/12346/artifactshow-ref bject.type] | @tsv k/gh-aw/gh-aw/.ggit -buildtags /opt/hostedtoolc--show-toplevel git rev-�� /ref/tags/v9 node sv /tmp/TestHashStagit -tests /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/google-github-actions/auth/git/ref/tags/v2 --jq [.object.sha, .object.type] | @tsv ithub-script/git/ref/tags/v9 infocmp bject.type] | @tsv xterm-color l /usr/bin/git git rev-�� /ref/tags/v9 git sv /tmp/TestGuardPogit remote /usr/bin/gh git (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 DefaultBranchFromLsRemoteWithRealGitmain_branch1309128946/001' DefaultBranchFromLsRemoteWithRealGitmain_branch1309128946/001' ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -p internal/godebugrev-parse -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -o /tmp/go-build1343405487/b175/_pkg_.a -trimpath 64/pkg/tool/linux_amd64/vet -p crypto/internal/rev-parse -lang=go1.25 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv --show-toplevel gh tions/setup/js/node_modules/.bin/node /repos/actions/g/opt/hostedtoolcache/node/24.14.1/x64/bin/node --jq (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 ache/go/1.25.8/x64/pkg/tool/linu--jq (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion ./../.prettieriggit test@example.comrev-parse /usr/bin/git sh -c ck 'scripts/**/*.js' --ignore-pa.github/workflows/test.md git ache/node/24.14.1/x64/bin/node --show-toplevel git /usr/bin/infocmpxterm-color sh (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/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state .cfg -I /tmp/go-build134rev-parse -I ache/go/1.25.8/x64/pkg/tool/linuorigin (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo sv --show-toplevel git /usr/bin/git git /pre�� json' --ignore-path ../../../.pr**/*.json git /usr/bin/git --show-toplevel git /usr/bin/git 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 -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE json reempt_wasm.s x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel git sh --show-toplevel git /usr/bin/git git rev-�� h ../../../.prettierignore git bin/sh --show-toplevel git (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch se 6848616/b164/vet.cfg .cfg -p internal/nettracrev-parse -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch runs/20260503-183818-48943/test-2399440125/.github/workflows git /usr/bin/infocmp tierignore git /usr/bin/git infocmp -1 xterm-color git t --show-toplevel git modules/@npmcli/--show-toplevel /usr/lib/git-core/git (http block)

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

The four GenAI token-usage attributes (gen_ai.usage.input_tokens,
gen_ai.usage.output_tokens, gen_ai.usage.cache_read.input_tokens,
gen_ai.usage.cache_creation.input_tokens) are now added to the
gh-aw.agent.conclusion span in addition to the child agent span.

This enables single-query observability without requiring a join to
the child span — DevOps engineers can now answer input vs. output
token questions, cache hit rates, and high-token-burn workflows
directly from the conclusion span.

Changes:
- Hoist agentUsage read outside the agent sub-span if-block
- Add token breakdown attributes to the conclusion span attributes
- Agent sub-span inherits them via [...attributes] copy (no duplicates)
- Add 4 new tests verifying conclusion span carries token breakdown

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/891f7a06-3af2-47af-b9b1-77ef85e22502

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add gen_ai.usage token breakdown to conclusion spans feat: add gen_ai.usage token breakdown to conclusion spans May 3, 2026
Copilot AI requested a review from pelikhan May 3, 2026 18:41
@pelikhan pelikhan marked this pull request as ready for review May 3, 2026 18:52
Copilot AI review requested due to automatic review settings May 3, 2026 18:52
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 enriches the job conclusion OTLP span with the full GenAI token-usage breakdown so token category queries (input/output/cache read/cache write) can be answered without joining to the child agent span.

Changes:

  • Hoists agent_usage.json parsing so the four gen_ai.usage.* token breakdown attributes are added to the conclusion span (with > 0 guards).
  • Removes the now-redundant token breakdown additions from the agent sub-span since it copies the conclusion attributes.
  • Adds a new test suite validating the token breakdown presence/absence behavior on the conclusion span.
Show a summary per file
File Description
actions/setup/js/send_otlp_span.cjs Adds token breakdown attributes to the conclusion span and relies on attribute copying for the agent sub-span.
actions/setup/js/send_otlp_span.test.cjs Adds tests asserting token breakdown enrichment behavior on the conclusion span (present/absent/zero-value cases).

Copilot's findings

Tip

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

Comments suppressed due to low confidence (1)

actions/setup/js/send_otlp_span.cjs:1013

  • agentAttributes is created as a shallow copy of attributes, but attributes already includes gen_ai.request.model when model is set. The agent-span block then pushes gen_ai.request.model again, resulting in duplicate keys on the agent span. Consider removing the second addition (or removing it from the base attributes and only adding it for the agent span) so each attribute key is emitted once per span.
    const agentAttributes = [...attributes];
    // gen_ai.operation.name is Required by the OTel GenAI spec for inference spans.
    // All gh-aw agent executions are chat-style LLM completions.
    agentAttributes.push(buildAttr("gen_ai.operation.name", "chat"));
    if (model) agentAttributes.push(buildAttr("gen_ai.request.model", model));
    // gen_ai.system is the OTel GenAI standard attribute for the LLM system/provider.
  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request May 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

🧪 Test Quality Sentinel Report

Test Quality Score: 82/100

Excellent test quality

Metric Value
New/modified tests analyzed 4
✅ Design tests (behavioral contracts) 4 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 3 (75%)
Duplicate test clusters 0
Test inflation detected ⚠️ Yes (120 test lines / 18 production lines = 6.7:1)
🚨 Coding-guideline violations None

Test Classification Details

View all 4 tests
Test File Classification Notes
includes all four gen_ai token breakdown attributes on the conclusion span when agent_usage.json is present send_otlp_span.test.cjs ✅ Design Happy path; verifies all 4 OTLP attributes on conclusion span
includes gen_ai token breakdown on conclusion span even when no agent sub-span is emitted send_otlp_span.test.cjs ✅ Design Edge case: no INPUT_JOB_NAME; verifies attributes present on sole conclusion span
omits all gen_ai token breakdown attributes from conclusion span when agent_usage.json is absent send_otlp_span.test.cjs ✅ Design Error path: file absent (ENOENT); verifies attributes are not emitted
omits a gen_ai token attribute from the conclusion span when its value is zero send_otlp_span.test.cjs ✅ Design Edge case: zero-valued tokens are omitted; non-zero tokens are present

Notes

⚠️ Test inflation — 120 lines were added to the test file vs. 18 lines in the production file (ratio ≈ 6.7:1, threshold 2:1). This triggered the 10-point proportional-growth penalty. However, the inflation is understandable here: the new feature (gen_ai.usage token breakdown) requires four distinct behavioral scenarios (all-present, no-agent-span, file-absent, zero-values), each exercising a real end-to-end OTLP payload. The added tests are high quality despite the line-count ratio.

Mocking patternfs.readFileSync, fs.statSync, and fetch are all mocked via vi.spyOn / vi.stubGlobal. These are legitimate external I/O targets; the assertions verify the observable output (OTLP span attributes) rather than internal call counts, so this is not flagged.


Language Support

Tests analyzed:

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

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). All four tests assert on observable OTLP span attributes and cover the key behavioral contracts of the new token-breakdown feature.


📖 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: §25287725974

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

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: 82/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). All 4 tests verify observable OTLP span attributes and cover behavioral contracts (happy path, no-agent-span variant, file-absent error path, zero-value edge case).

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 3, 2026

@copilot merge main and recompile

…ent-add-gen-ai-usage-token-breakdown

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 3, 2026

@copilot merge main and recompile

Done — merged main and recompiled all lock files in 741ce12.

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 (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 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ithub/workflows rovement-add-gen-ai-usage-token-breakdown repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } credential.userngit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ithub/workflows --local repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } credential.userngit (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv (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 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv ns.json and pkg/workflow/data/action_pins.json...&#34; (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv t} (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv get rovement-add-gen-ai-usage-token-breakdown change-checker.lock.yml credential.userninfocmp (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 (http block)
  • https://api.github.com/repos/docker/metadata-action/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv -ai-usage-token-remote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv -ai-usage-token-breakdown^{commit} (http block)
  • https://api.github.com/repos/docker/setup-buildx-action/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv -ai-usage-token-breakdown^{commit} (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv -ai-usage-token-breakdown^{commi-f (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch ithub/workflows --local /usr/local/sbin/-f committer.name (http block)

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

@pelikhan pelikhan merged commit b6b12e1 into main May 3, 2026
@pelikhan pelikhan deleted the copilot/otel-improvement-add-gen-ai-usage-token-breakdown branch May 3, 2026 19:18
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: add gen_ai.usage token breakdown to conclusion spans

3 participants