Skip to content

delight: pre-compute sampling + tighten tools to cut ~530K tokens/run#29227

Merged
pelikhan merged 2 commits intomainfrom
copilot/optimize-delight-read-only-run
Apr 30, 2026
Merged

delight: pre-compute sampling + tighten tools to cut ~530K tokens/run#29227
pelikhan merged 2 commits intomainfrom
copilot/optimize-delight-read-only-run

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

delight.md was burning 34 inference turns on a fully read-only run (0 write actions, 0.49% output tokens) — half of those turns were pure file discovery and memory loading that the agent was re-doing from scratch each run.

Changes

  • pre-agent-steps — pre-samples doc files, message workflows, and validation files; pre-loads both memory JSON files into /tmp/gh-aw/agent/ before the agent starts, eliminating ~6 exploratory turns (~365K tokens)
  • Removed edit: tool — never invoked; tool schema was included in every turn's context (~25K tokens)
  • Tightened bash allow-list — removed unbounded grep -r '*' docs and cat *; replaced with path-scoped equivalents (cat docs/src/content/docs/*.md, cat /tmp/gh-aw/agent/*, etc.) (~100K tokens)
  • Dropped shared/jqschema.md import — adds JSON schema tooling context irrelevant to this workflow's narrative/prose output (~40K tokens)
  • Updated prompt — all four sampling sections and Step 1 (Load Historical Memory) now reference pre-computed /tmp/gh-aw/agent/ files instead of issuing discovery commands
pre-agent-steps:
  - name: Sample files and load memory
    run: |
      mkdir -p /tmp/gh-aw/agent
      find docs/src/content/docs \( -name '*.md' -o -name '*.mdx' \) | shuf -n 2 > /tmp/gh-aw/agent/doc-samples.txt
      grep -rl "messages:" .github/workflows/ --include="*.md" | shuf -n 2 > /tmp/gh-aw/agent/workflow-samples.txt
      find pkg -name '*validation*.go' | shuf -n 1 > /tmp/gh-aw/agent/validation-sample.txt || echo "No validation files found" > /tmp/gh-aw/agent/validation-sample.txt
      cat memory/delight/previous-findings.json 2>/dev/null > /tmp/gh-aw/agent/previous-findings.json || echo "[]" > /tmp/gh-aw/agent/previous-findings.json
      cat memory/delight/improvement-themes.json 2>/dev/null > /tmp/gh-aw/agent/improvement-themes.json || echo "[]" > /tmp/gh-aw/agent/improvement-themes.json

Estimated total savings: ~530K tokens/run (~25% of 2.08M baseline).

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 ache/go/1.25.8/x64/pkg/tool/linu-nolocalimports (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo --no�� g_.a (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 on' --ignore-path ../../../.prettierignore (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 -stringintconv -tests /usr/bin/git se 9776527/b033/vetrev-parse ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/xTest User /usr/bin/git se 9776527/b084/vet/opt/hostedtoolcache/node/24.14.1/x64/bin/npm .cfg 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 --show-toplevel x_amd64/vet /usr/bin/gh --local credential.usernrev-parse x_amd64/vet gh api /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git lGitmaster_brancgit lGitmaster_brancrev-parse x_amd64/vet git (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 1145-15138/test-1641644721/.github/workflows 9776527/b288/vet.cfg 9776527/b399/agentdrain.test !../../../pkg/wogh --ignore-path ../../../.prettierignore 9776527/b399/agentdrain.test e=/t�� t0 /tmp/go-build3879776527/b040/vet.cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel ortcfg /usr/bin/git 1145-15138/test-tr 9776527/b276/vet\n ache/go/1.25.8/x: git rev-�� --show-toplevel ache/go/1.25.8/xrev-parse /usr/bin/git 9776527/b399/_pkgit /tmp/go-build387rev-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 git /usr/bin/git /tmp/gh-aw-test-git remote /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git 64/pkg/tool/linu--show-toplevel 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, .object.type] | @tsv -unreachable=false =develop /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ithub/workflows/ace-editor.md -trimpath x_amd64/vet l github.com/githurev-parse -lang=go1.25 x_amd64/vet t-30�� sistency_GoAndJavaScript2915998623/001/test-inlined-imports-enabled-with-env-template-expressiongit remote /usr/bin/git .github/workflowgit -nolocalimports -importcfg git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv bility_SameInputSameOutput2908380976/001/stability-test.md (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 x_amd64/vet /usr/bin/git g_.a /tmp/go-build387log e/git git rev-�� --show-toplevel e/git /usr/bin/git T_hjJlGy4 tname) /opt/hostedtoolc--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 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -dirty" -o gh-aw ./cmd/gh-aw (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv ithub/workflows/-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, .object.type] | @tsv /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/sh fGO1rOfss (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 s/test.md git /opt/hostedtoolcache/node/24.14.1/x64/bin/node get --local x_amd64/vet node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript2915998623/001/test-complex-frontmatter-with-tools.md x_amd64/vet /opt/hostedtoolcache/node/24.14.1/x64/bin/node get --local x_amd64/vet node (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/linu-test.v=true /usr/bin/git te 'scripts/**/*git .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linuremote2 /usr/bin/git mpiledOutput3279git on x_amd64/vet 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 '/tmp/TestParseDefaultBranchFromLsRemoteWithRealremote.origin.url '/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitcustom_branch2409304913/001' ache/go/1.25.8/x64/pkg/tool/linux_amd64/link s -ifaceassert -nilfunc ache/go/1.25.8/x64/pkg/tool/linux_amd64/link -ato�� 9776527/b431/parser.test -buildtags ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -errorsas -ifaceassert -nilfunc ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv runs/20260430-011145-15138/test-3866451571 -trimpath kflows/test-expires.lock.yml -p github.com/githurev-parse -lang=go1.25 gh estl�� /repos/actions/github-script/git/ref/tags/v9 --jq /usr/bin/git -c=4 -nolocalimports -importcfg git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv bility_SameInputSameOutput2908380976/001/stability-test.md (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 /tmp/TestGuardPolicyMinIntegrityOnlymin-integrity_with_explicit_repo824905333/001 rev-parse /usr/bin/infocmp s ithub/workflows/rev-parse ithub/workflows/--show-toplevel infocmp -1 git git om/myorg/myrepo.git ithub/workflows/git ithub/workflows/rev-parse x_amd64/vet git (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 f/tags/v6 64/pkg/tool/linuconfig sv LsRemoteWithRealgit LsRemoteWithRealrev-parse x_amd64/link infocmp -1 xterm-color x_amd64/link /usr/bin/git git status --porgit on x_amd64/compile 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/TestGuardPolicyMinIntegrityOnlyCompiledOutput2344698764/001 config ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet remote.origin.urgit --get nfig/composer/ve--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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 --show-toplevel git /tmp/go-build3879776527/b431/parser.test --local --get sh /tmp/go-build3879776527/b431/parser.test -tes�� -test.paniconexit0 -test.v=true ache/node/24.14.1/x64/bin/node -test.timeout=10git -test.run=^Test -test.short=true--show-toplevel 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-23 (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-03-31 (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-01-30 (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 --others 64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 (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 go-udiff@v0.4.1/export.go 64/pkg/tool/linux_amd64/vet rkflow/js/**/*.jgit (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 64/src/internal/fuzz/counters_supported.go 64/pkg/tool/linux_amd64/vet (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 (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 .cfg x_amd64/vet (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 (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 (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/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 (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 --others 64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 piler_customsteps_test.go .cfg (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 64/src/testing/internal/testdeps/deps.go 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 go 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path on' --ignore-path ../../../.prettierignore (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 (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 (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build3879776527/b404/cli.test /tmp/go-build3879776527/b404/cli.test -test.testlogfile=/tmp/go-build3879776527/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true (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 ortcfg /usr/bin/git edcfg (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 9776527/b050/vet.cfg k (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 get --local x_amd64/vet core.hooksPath (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 get --local x_amd64/vet core.hooksPath (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 get --local x_amd64/vet copilot.originalgit (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 --local credential.username 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 ithub/workflows k/gh-aw/gh-aw/pkg/cli/workflows/main x_amd64/vet copilot.originalgit (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 9776527/b064/vet.cfg x_amd64/compile (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 /../../.prettiergit (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 ode_modules/.bin/sh (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo _modules/.bin/sh http.https://git/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state .cfg ./../.prettieriggit (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 on' --ignore-path ../../../.prettierignore (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch util.test (http block)

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

…avings)

- Add pre-agent-steps to pre-compute file sampling and memory loads
  (eliminates ~6 exploratory agent turns, ~365K tokens/run)
- Remove unused edit: tool (workflow is read-only, ~25K tokens/run)
- Tighten bash allow-list: remove grep -r '*' docs and cat *,
  add scoped path-specific commands (~100K tokens/run)
- Drop unused shared/jqschema.md import (~40K tokens/run)
- Update prompt to reference pre-computed /tmp/gh-aw/agent/ files

Resolves #copilot-token-optimizer issue for delight.md workflow"

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/5a95abc6-619c-4888-b650-517387fd25ca

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize Delight workflow to reduce read-only run tokens delight: pre-compute sampling + tighten tools to cut ~530K tokens/run Apr 30, 2026
Copilot AI requested a review from pelikhan April 30, 2026 01:16
@pelikhan pelikhan marked this pull request as ready for review April 30, 2026 01:27
Copilot AI review requested due to automatic review settings April 30, 2026 01:27
@pelikhan pelikhan merged commit d54852a into main Apr 30, 2026
19 checks passed
@pelikhan pelikhan deleted the copilot/optimize-delight-read-only-run branch April 30, 2026 01:27
@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — great work on the delight workflow efficiency improvements! Pre-computing sampling steps and tightening the bash allow-list to cut ~530K tokens/run (~25% of baseline) is a meaningful and well-scoped optimization.

One small thing to note before this lands:

  • No test changes — the diff only touches .github/workflows/delight.lock.yml and the companion workflow file. If there are any unit or integration tests that exercise the pre-agent-steps logic or the updated bash allow-list patterns, it would be worth verifying they still pass (or adding coverage for the new pre-sampling shell script). If tests genuinely don't apply to these workflow config files, a brief note in the PR body saying so would help reviewers move faster.

If you'd like a hand addressing this, here's a ready-to-use prompt:

Review the changes in PR #29227 (delight workflow token optimizations) and determine whether any existing tests cover the pre-agent-steps shell script or the updated bash allow-list. If tests exist, confirm they pass. If no tests cover this area and testable logic exists (e.g., the shell script that pre-loads memory files), add appropriate tests under the existing test suite. If the changes are purely declarative YAML config with no testable logic, add a comment to the PR body explicitly noting that tests are not applicable.

Generated by Contribution Check · ● 1.5M ·

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

Optimizes the delight agentic workflow to reduce token usage by precomputing sampling/memory inputs ahead of agent start and tightening the tool allow-list.

Changes:

  • Add pre-agent-steps to pre-sample docs/workflows/validation targets and pre-load delight memory JSON into /tmp/gh-aw/agent/.
  • Remove unused edit: tool schema and drop shared/jqschema.md import to reduce prompt/tooling overhead.
  • Tighten bash allow-list and update workflow instructions to consume the precomputed /tmp/gh-aw/agent/* artifacts.
Show a summary per file
File Description
.github/workflows/delight.md Adds pre-agent sampling + memory preload, removes unused tooling/import, updates bash allow-list and prompt instructions accordingly.
.github/workflows/delight.lock.yml Regenerated compiled workflow reflecting updated imports, pre-agent step insertion, and updated tool allow-list.

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)

.github/workflows/delight.md:70

  • grep -rl "messages:" .github/workflows/ --include="*.md" searches recursively under .github/workflows/, so the sample list can include .github/workflows/shared/*.md. The bash allow-list only permits cat .github/workflows/*.md (top-level), so the agent may not be able to read the sampled workflow file. Either scope the grep to only top-level workflows, or expand the allow-list / pre-copy sampled files into /tmp/gh-aw/agent/ similarly to the docs sampling.
      # Sample workflows with messages (pre-compute instead of agent grep)
      grep -rl "messages:" .github/workflows/ --include="*.md" | shuf -n 2 > /tmp/gh-aw/agent/workflow-samples.txt
      # Sample validation files
  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +67 to +69
find docs/src/content/docs \( -name '*.md' -o -name '*.mdx' \) | shuf -n 2 > /tmp/gh-aw/agent/doc-samples.txt
# Sample workflows with messages (pre-compute instead of agent grep)
grep -rl "messages:" .github/workflows/ --include="*.md" | shuf -n 2 > /tmp/gh-aw/agent/workflow-samples.txt
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.

[copilot-token-optimizer] Delight: reduce 34-turn read-only run (~730K tokens/run savings)

3 participants