ambient-context: reduce copilot-agent-analysis first-request size by ~28%#43619
Conversation
…metrics - copilot-agent-analysis.md: remove duplicate body-level jq examples (already covered by shared/copilot-pr-analysis-base.md) - copilot-agent-analysis.md: gate cold-start historical rebuild behind optional runtime-import (shared/copilot-agent-analysis-history.md) - copilot-agent-analysis.md: remove duplicated §4.2.1 rebuild section (now lives in the new shared file) - copilot-agent-analysis.md: trim verbose A/B structured-variant template (remove verbose Agent Task Texts instructions and brevity guidelines) - shared/copilot-pr-analysis-base.md: remove jqschema/SKILL.md import (~992 chars; data is at a known path with a schema file) - daily-code-metrics.md: remove redundant DPI/grid settings already covered by python-dataviz.md import - New: shared/copilot-agent-analysis-history.md for optional cold-start import Total character savings: ~4,670 chars in copilot-agent-analysis.md (28%) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hey One small gap to address before this is ready:
If you would like a hand verifying or adding coverage:
|
There was a problem hiding this comment.
Pull request overview
Reduces the default “ambient context” included in Copilot/agent analysis workflow prompts by removing rarely-needed inline guidance and unnecessary imports, while keeping the same operational behavior via optional runtime imports and regenerated lock workflows.
Changes:
- Extracted historical-data cold-start rebuild guidance into an optional runtime import to shrink the default
copilot-agent-analysisprompt. - Removed the
jqschemaskill import from the shared Copilot PR analysis base and propagated the change through dependent compiled.lock.ymlworkflows. - Trimmed redundant chart setup text in
daily-code-metrics(relying on existing shared visualization imports) and recompiled the workflow lock.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/shared/copilot-pr-analysis-base.md | Removes jqschema skill import to reduce runtime prompt size. |
| .github/workflows/shared/copilot-agent-analysis-history.md | New shared fragment containing cold-start history rebuild instructions (optional import). |
| .github/workflows/daily-code-metrics.md | Simplifies Python chart setup instructions to avoid redundancy with shared imports. |
| .github/workflows/daily-code-metrics.lock.yml | Regenerated compiled workflow reflecting updated markdown content. |
| .github/workflows/copilot-pr-prompt-analysis.lock.yml | Regenerated compiled workflow to drop jqschema runtime import. |
| .github/workflows/copilot-pr-nlp-analysis.lock.yml | Regenerated compiled workflow to drop jqschema runtime import. |
| .github/workflows/copilot-pr-merged-report.lock.yml | Regenerated compiled workflow to drop jqschema runtime import. |
| .github/workflows/copilot-agent-analysis.md | Removes duplicated/verbose inline guidance and uses optional runtime import for cold-start rebuild steps. |
| .github/workflows/copilot-agent-analysis.lock.yml | Regenerated compiled workflow reflecting updated markdown content and imports. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/9 changed files
- Comments generated: 0
- Review effort level: Low
|
🎉 This pull request is included in a new release. Release: |
copilot-agent-analysiswas the largest sampled request at 27,299 chars (AIC 116.9), driven by always-inlined content that is rarely or never needed at runtime.copilot-agent-analysis.md(16,546 → 11,876 chars, −28%){{#runtime-import? shared/copilot-agent-analysis-history.md}}replaces ~1,470 chars of rebuild instructions that are only needed when the history cache is empty. Extracted to newshared/copilot-agent-analysis-history.md.copilot-prs.jsonqueries already present inshared/copilot-pr-analysis-base.md.shared/copilot-pr-analysis-base.mdjqschema/SKILL.mdimport (~992 chars at runtime) — jqschema is for unknown API shapes; pre-fetched PR data ships with a*-schema.jsoncompanion file.daily-code-metrics.mdDPI 300, ax.grid(True, alpha=0.3)stripped from the Python script preamble; already specified by thepython-dataviz.mdimport pulled in viashared/trends.md.