fix(ambient-context): reduce first-request token overhead in smoke-copilot and test-quality-sentinel#39280
Merged
Conversation
…l workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize daily ambient context across workflows
fix(ambient-context): reduce first-request token overhead in smoke-copilot and test-quality-sentinel
Jun 14, 2026
pelikhan
approved these changes
Jun 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces first-request prompt/token overhead for two agentic workflows by removing redundant, framework-provided tool-access text and by moving a large static report template into a lazily-referenced inline skill.
Changes:
- Removed the redundant “Tool Access Overview” section from
smoke-copilot.md. - Refactored
test-quality-sentinel.mdto compress headings/content and extract the Step 7 comment template into an inlinetqs-report-templateskill. - Regenerated the corresponding
.lock.ymlfiles to reflect updated workflow bodies.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/test-quality-sentinel.md | Compresses workflow instructions and introduces tqs-report-template inline skill; updates Step 7/8 guidance. |
| .github/workflows/test-quality-sentinel.lock.yml | Updates generated metadata hashes for the modified workflow body. |
| .github/workflows/smoke-copilot.md | Removes duplicated tool-access explanation to reduce prompt size. |
| .github/workflows/smoke-copilot.lock.yml | Updates generated metadata hashes for the modified workflow body. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 3
Comment on lines
264
to
+265
| 1. More than 30% of new tests are classified as **implementation tests** (low-value): | ||
|
|
||
| ``` | ||
| low_value_ratio = (implementation_tests / total_new_tests) | ||
| fail_check = low_value_ratio > 0.30 | ||
| ``` | ||
| `low_value_ratio = (implementation_tests / total_new_tests) > 0.30` |
| After posting the comment, submit a pull request review based on the verdict. **You MUST always call at least one safe output tool.** If no tests were found or no action is needed, call `noop`: | ||
|
|
||
| ```json | ||
| {"noop": {"message": "No action needed: [brief explanation of what was analyzed and why no action was required]"}} |
Comment on lines
+279
to
+280
| After posting the comment, submit a pull request review based on the verdict. **You MUST always call at least one safe output tool.** If no tests were found or no action is needed, call `noop`: | ||
|
|
3 tasks
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.
The Daily Ambient Context Optimizer flagged two workflows with significant redundant prompt content:
smoke-copilothad a 1,179-char section duplicating the framework-injected<mcp-clis>block, andtest-quality-sentinelembedded a ~13,770-char static report template inline on every first request.smoke-copilot.md
## Tool Access Overview— verbatim restatement of the framework-injected<mcp-clis>block; agents already receive this from the frameworktest-quality-sentinel.md
*Extract Step 7 comment template to
## skill: \tqs-report-template`** — moves the entire ```` ```markdown ``` ```` report format block (placeholders, tables,Details
sections) out of the first-request context into a lazily-loaded inline skill; Step 7 now just says *"Use thetqs-report-template` skill for the exact comment format"Compress skill blocks 2 & 3 — the 928-char verbatim flagged-test example and 782-char "Understanding Test Classifications"
<details>block are replaced with a compact one-line format spec + brief example, and a single summary sentence in the Verdict line respectivelyFlatten heading structure 43 → 23 — converts 14 H3 sub-headings (Quality Questions 1–3, Red Flags, Scoring Components, Score Formula, Thresholds, Failure Condition, Report Formatting, Analysis Scope, Calibration, Token Budget) to bold inline prose; merges
## Current Context+## Missioninto the intro paragraph; folds## Important: Always Call a Safe Outputinto Step 8