feat(ambient-context): trim prompt size in daily-code-metrics, test-quality-sentinel, smoke-copilot-aoai-entra#41960
Merged
Conversation
…-quality-sentinel, smoke-copilot-aoai-entra Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize Python boilerplate in daily code metrics
feat(ambient-context): trim prompt size in daily-code-metrics, test-quality-sentinel, smoke-copilot-aoai-entra
Jun 27, 2026
pelikhan
approved these changes
Jun 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces first-request prompt size for several gh-aw agent workflows by removing redundant inline guidance and moving deterministic preprocessing out of the agent prompt body and into workflow steps: that run outside the AI sandbox.
Changes:
daily-code-metrics: removes duplicated imports / boilerplate chart guidance and replaces it with pointers to the sharedpython-datavizguidance (still included transitively viashared/trends.md).test-quality-sentinel: precomputes test-function signatures and missing Go build-tag findings during the pre-fetch step, and updates the agent body to reference the pre-fetched files.smoke-copilot-aoai-entra: condenses the CLI-proxy tool access explanation while keeping the key tool→invocation mapping.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/test-quality-sentinel.md | Moves deterministic parsing work into steps: and trims repeated shell snippets from the agent body. |
| .github/workflows/test-quality-sentinel.lock.yml | Regenerated compiled workflow reflecting the updated pre-fetch step and prompt text. |
| .github/workflows/daily-code-metrics.md | Trims redundant chart/script boilerplate and removes a duplicate direct import. |
| .github/workflows/daily-code-metrics.lock.yml | Regenerated compiled workflow reflecting the daily-code-metrics prompt changes. |
| .github/workflows/smoke-copilot-aoai-entra.md | Condenses CLI-proxy tool access overview text. |
| .github/workflows/smoke-copilot-aoai-entra.lock.yml | Regenerated compiled workflow reflecting the updated prompt text. |
| .github/workflows/smoke-otel-backends.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/smoke-copilot.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/smoke-copilot-sdk.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/smoke-copilot-aoai-apikey.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/necromancer.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/dev.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/cloclo.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/ci-doctor.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
| .github/workflows/approach-validator.lock.yml | Regenerated compiled workflow (includes GH_AW_LABEL_COMMANDS env wiring). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 15/15 changed files
- Comments generated: 1
- Review effort level: Low
| if [ -s /tmp/gh-aw/agent/test-diff.txt ]; then | ||
| grep -E "^\+func Test" /tmp/gh-aw/agent/test-diff.txt \ | ||
| > /tmp/gh-aw/agent/go-new-test-funcs.txt || true | ||
| grep -E "^\+(it|test|describe)\(" /tmp/gh-aw/agent/test-diff.txt \ |
This was referenced Jun 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three workflows account for the largest first-request sizes in the daily ambient context audit (26k, 22k, and 16k chars respectively). This PR removes redundant inline content that duplicates shared imports or can be pre-computed deterministically outside the AI sandbox.
daily-code-metrics.md(−1,979 chars, 13.2%)shared/python-dataviz.mdimport — already transitively included viashared/trends.md, causing the content to be injected twicepython-dataviz.mdpython-dataviz.md's existing guidancetest-quality-sentinel.md(agent body −880 chars)Moved deterministic shell work out of the agent body into the pre-fetch
steps:block (runs outside the AI sandbox, zero tokens consumed):go-new-test-funcs.txt,js-new-test-funcs.txt) viagrepon the already-fetched test diff//go:buildtags →missing-build-tags.txtgo-test-analyzersub-agent to readmissing-build-tags.txtinstead of re-runninggit diff— removes the${{ github.event.pull_request.base.sha }}reference from the agent body that was no longer neededsmoke-copilot-aoai-entra.md(−1,000 chars, 8.5%)Condensed the "Tool Access Overview" section from 15 lines to 2 lines. The per-tool CLI invocation patterns (playwright, serena, safeoutputs, etc.) are restated from system-injected
<mcp-clis>context; only the essential tool→CLI mapping is kept.