Skip to content

[ambient-context] Daily Ambient Context Optimizer - 2026-08-24 #55499

Description

@github-actions

Executive Summary

  • Sampled 4 completed runs across 4 distinct workflows (last ~1h due to MCP logs count-limit continuation window; broader 24h sampling was not reachable within the tool timeout).
  • No sandbox/firewall/logs/api-proxy-logs/event-logs.jsonl or sandbox/agent/logs/copilot-session-state/*/events.jsonl artifacts were present in the downloaded log bundles for any sampled run — analysis fell back to prompt.txt as the first-request source (documented as a fallback, not the preferred source).
  • Median first-request size: 16,891 chars; P95: 28,259 chars (Design Decision Gate).
  • Conclusion: the largest driver of first-request size across samples is a large shared preamble (~6.3–8.2K chars per run) plus a repeated safeoutputs create_pull_request CLI usage block (~2.5K chars) that appears verbatim in every sampled request — both are boilerplate injected once per run, not workflow-specific content, so they are the highest-leverage place to trim tokens without touching task logic.

Highest-Leverage Changes

  1. Move the large inline "ADR Required / ADR Verified / Diverges" comment templates in design-decision-gate.md fully out of the prompt body into the already-present ## skill: adr-report-templates block's on-demand loading path (currently the templates are still large and always loaded).
  2. Reduce heading/section sprawl in design-decision-gate.md (55 headings, 28K chars) — consolidate near-duplicate step/condition subsections (3a/3b/3c, Step 4a/4b) into fewer top-level steps.
  3. Investigate high Working-Set Rebuild Factor (WSRF 3.62) on mattpocock-skills-reviewer — static context is being re-sent at ~3.6x its peak size across 36 invocations; move static skill/agent instructions to content that isn't resent every turn.
  4. Trim the 3 inline ## agent: blocks in aw-failure-investigator.md (failure-classifier, issue-matcher, cluster-evidence-extractor) — evaluate whether all three need to be inline vs. converted to on-demand skills, given the workflow's already-large 493-line source.
  5. impeccable-skills-reviewer.md shows 2 imported skill refs pulling full SKILL.md content into a lean 156-line workflow — verify only the necessary skill sections are being fused rather than entire skill files.

CI-Validation Checklist for Implementing Agents

Any agent implementing workflow-file recommendations must complete every item below before opening a PR:

  • Run make recompile for every modified .github/workflows/*.md file — zero compilation errors required
  • Confirm no target workflow file is reduced by more than 40% of its current character count
  • Run make agent-report-progress before the final commit and confirm it passes
  • Check the blocked_files list in /tmp/gh-aw/ambient-context/closed-pr-targets.json (written by Step 4) — do not re-attempt changes to any file that appears in a closed ambient-context optimization PR from the last 14 days
  • Include a smoke-test result or dry-run output in the PR description for every changed workflow spec
  • Document all generated .lock.yml changes in the PR body
  • Do not submit as a draft PR

Key Metrics

Metric Value
Sampled runs 4
Distinct workflows 4
Median chars 16,891.5
P95 chars 28,259
Largest sampled request Design Decision Gate — 28,259 chars
Merged optimizer PRs (7d) 1
Closed optimizer PRs (7d) 0
Optimizer PR close-rate (7d) insufficient data (<3 settled)
WSRF (audited runs) Failure Investigator: 1.74; Matt Pocock Skills Reviewer: 3.62
Per-Run First-Request Metrics
Run Workflow Status Chars Headings Inline agents/skills Dup line ratio WSRF
§32766584101 Design Decision Gate failure 28,259 55 0 agents / 1 skill 0.0 n/a
§32766584217 Matt Pocock Skills Reviewer success 19,477 21 1 agent / 0 skills 0.0 3.62
§32765579386 [aw] Failure Investigator (6h) success 14,306 12 3 agents / 0 skills 0.0 1.74
32766584175 Impeccable Skills Reviewer success 13,974 11 0 agents / 2 imported skill refs 0.0 n/a
Repeated Ambient Context Signals
  • A ~2.5K-char safeoutputs create_pull_request CLI-usage instruction block (from the shared <mcp-clis> section) appears verbatim in all 4 sampled requests — static, unconditional content resent every run.
  • The immutable <system> security-policy preamble (sandbox/firewall/injection rules) is ~6.3–8.2K chars in every sample — necessary for safety but a candidate for compaction (e.g., shorter phrasing) rather than removal.
  • No cross-run textual duplication beyond the shared boilerplate was detected (duplicate_line_ratio = 0.0 for all samples), indicating each workflow's task-specific content is largely unique — good, but means further savings must come from shrinking boilerplate/skill fusion, not de-duplicating task text.
Deterministic Analysis Output
  • Script: /tmp/gh-aw/ambient-context/analyze_requests.py (stdlib only) computed byte/char/line/word counts, heading/list/code-fence/details/table counts, inline agent/linter/skill counts, imported SKILL.md reference counts, duplicate line/paragraph ratios, and longest sections per run.
  • Longest sections by heading were dominated by (preamble) (6.3K–8.2K chars) and the recurring safeoutputs create_pull_request CLI block (~2.5K chars) in every run — confirming these are the top two byte contributors independent of workflow identity.
  • design-decision-gate stood out with 55 headings and 22 code fences in 28K chars — the highest heading density of the sample, consistent with its long, template-heavy ADR report format still embedded near the skill boundary.

Recommendations by Category

Workflow Markdown

  • design-decision-gate.md (evidence: 55 headings, 28,259 chars, largest sampled request): consolidate the 3a/3b/3c ADR-detection subsections and Step 4a/4b branches into fewer top-level steps; the report templates are already partially under ## skill: adr-report-templates — ensure remaining large <details> blocks (5 template variants) stay skill-scoped rather than duplicated in the main body. Expected impact: high. Needs manual review (do not reduce >40% or below 1,000 chars in one pass).
  • aw-failure-investigator.md (evidence: 3 inline ## agent: blocks in a 493-line file, 14,306-char first request): assess whether failure-classifier, issue-matcher, and cluster-evidence-extractor are all needed as always-loaded inline agents vs. converting low-frequency-path agents to skills loaded on demand. Expected impact: medium. Needs manual review.
  • Both audited workflows already have tools.cli-proxy: true and tools.github.mode: gh-proxy configured — no proxy-enablement rewrite is needed for this sample.

Skills

  • impeccable-skills-reviewer.md (evidence: 2 imported SKILL.md references fused into a lean 156-line workflow, 13,974-char first request): confirm skill fusion only pulls the specific sections needed per review mode rather than entire skill files, to avoid unconditional inflation as more skills are added. Expected impact: medium. Likely safe immediately (verification-only, no content removal).
  • design-decision-gate.md / adr-report-templates skill: fully move the ADR Required/Verified/Diverges comment templates (currently ~2.5K+ chars of markdown examples in the workflow body) into the skill file so they load only when a comment is actually being posted, not on every gate evaluation. Expected impact: high. Needs manual review.

Agents

  • mattpocock-skills-reviewer.md (evidence: WSRF 3.62 across 36 invocations, cumulative input tokens 19,916 vs. peak 5,503 — static context resent ~3.6x its peak size): investigate why the single inline ## agent: pr-triage and shared instructions are being rebuilt near-peak-size repeatedly rather than growing incrementally; this is the strongest per-run WSRF signal in the sample and suggests context is not being cached/reused across turns. Expected impact: high. Needs manual review.
  • aw-failure-investigator.md: given only 1.74 WSRF (healthier) but 3 inline agents, no urgent agent-count change is needed here beyond the workflow-md consolidation above. Expected impact: low. Safe immediately (monitoring only).

References

Generated by 🌫️ Daily Ambient Context Optimizer · copilot · auto · 61.3 AIC · ⌖ 17.2 AIC · ⊞ 11.8K ·

  • expires on Aug 31, 2026, 12:05 PM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions