Skip to content

[ambient-context] Daily Ambient Context Optimizer - 2026-06-04 #36989

@github-actions

Description

@github-actions

Executive Summary

  • 4 runs sampled across 4 distinct workflows in the last 24h
  • Workflows: Failure Investigator (6h), Daily Code Metrics, Smoke Copilot, Copilot Agent PR Analysis
  • Median first-request: 31,680 chars; P95: 36,827 chars
  • Highest-cost: Failure Investigator — 10.3M effective tokens (34 turns); every duplicated byte costs ~34×
  • Top drivers: repeated Python dataviz boilerplate (12.9% dup line ratio); preambles at 22–46% of prompt; gh-proxy missing on 2/4 workflows; redundant safe-output prose in bodies; over-structured headings (up to 129/975 lines)

Highest-Leverage Changes

  1. Dedup shared/python-dataviz.md boilerplate — 4× repeated matplotlib/seaborn setup drives 12.9% dup lines in Daily Code Metrics; one canonical setup block replaces all copies [workflow-md, high, safe]
  2. Add tools.github.mode: gh-proxy to daily-code-metrics.md and copilot-agent-analysis.md — removes pre-auth CLI narrative from the injected preamble on every turn [workflow-md, high, safe]
  3. Strip redundant safe-output prose from aw-failure-investigator.md body — 12 safe-output keyword hits; preamble is already authoritative; 34-turn multiplier amplifies the cost [workflow-md, high, safe]
  4. Defer 3,495-char report template in daily-code-metrics.md to a late step — conditional experiment variant content is dead weight on every first request [workflow-md, high, needs review]
  5. Flatten heading density in daily-code-metrics.md (129h/975l) and copilot-agent-analysis.md (75h/748l) — merge stub sections into parents [workflow-md, medium, safe]
  6. Fix duplicate Serena context in smoke-copilot.md — Workspace/Memory/Project Activation lines appear 2× from a shared import collision [workflow-md, medium, safe]

Key Metrics

Metric Value
Sampled runs 4
Distinct workflows 4
Median chars 31,680
P95 chars 36,827
Largest request Daily Code Metrics (36,827 chars, 129 headings, 29 code fences)
Per-Run First-Request Metrics
Run Workflow Chars Lines Headings Code Fences Dup% Eff.Tokens gh-proxy
§26974650815 Failure Investigator (6h) 12,479 217 21 1 1.3% 10.3M
§26973556771 Daily Code Metrics 36,827 975 129 29 12.9% 8.9M
§26975370978 Smoke Copilot (failed) 16,833 291 22 4 5.9% 8.1M
§26973141611 Copilot Agent PR Analysis 31,680 748 75 19 9.0% 6.8M

All 4 prompts sourced from prompt.txt. Proxy columns reflect source frontmatter config.

Repeated Ambient Context Signals

Preamble dominance: auto-injected system preamble is the #1 largest section in all 4 prompts (5,691–8,245 chars; 22–46% of prompt total).

Daily Code Metrics repeated lines (from shared/python-dataviz.md multi-example blocks):

  • import matplotlib.pyplot as plt — 4×
  • import seaborn as sns / sns.set_style("whitegrid") — 4× each
  • sns.set_palette("husl") / fig, ax = plt.subplots(...) — 3× each

Copilot Agent PR Analysis: jq 'length' and gh pr list patterns appear 2× (Alternative Approaches section duplicates primary).

Smoke Copilot: Workspace, Memory, ### Project Activation all appear 2× from shared import collision.

Deterministic Analysis Output

Script: analyze_requests.py (stdlib only) → request-analysis.json + request-analysis.md

Ambient context only (preamble, from audit): 5,220 tokens (Failure Investigator), 15,629 tokens (Daily Code Metrics). The 10.3M vs 1.8M actual-token gap in Failure Investigator implies ~5.5× per-turn context-window multiplier.

Keyword density (lines mentioning topic):

Workflow tools agents safe-out workflow
Failure Investigator 18 6 12 11
Daily Code Metrics 26 4 17 22
Smoke Copilot 42 6 18 13
Copilot Agent PR Analysis 29 36 13 18

Recommendations by Category

Workflow Markdown

  1. shared/python-dataviz.md — replace 4 per-example setup stubs with one canonical ## Chart Setup block [high, safe — affects all importers]
  2. daily-code-metrics.md + copilot-agent-analysis.md — add github: { mode: gh-proxy } to tools: frontmatter [high, safe]
  3. aw-failure-investigator.md — audit body for safe-output re-documentation (12 hits) and remove; preamble is authoritative [high, safe]
  4. daily-code-metrics.md — move 3,495-char conditional report template to late-step skill or <!-- include --> [high, needs review — verify turn sequencing]
  5. daily-code-metrics.md + copilot-agent-analysis.md — merge #### stub sections (<4 body lines) into parents to cut heading count [medium, safe]
  6. smoke-copilot.md — remove duplicate shared/mcp/serena-go.md import or deduplicate activation block [medium, safe]

Skills

SKILL.md refs = 0 across all 4 runs. Skills load lazily and did not contribute to first-request bloat in this sample. No changes needed.

Agents

Inline agent count = 0 across all 4 runs. Sub-agent dispatch is prose-described; no inline agent definitions found. No agent-definition changes recommended.

References

  • §26974650815 — Failure Investigator (6h), 10.3M eff. tokens, 34 turns
  • §26973556771 — Daily Code Metrics, 36,827 char prompt, 12.9% dup
  • §26973141611 — Copilot Agent PR Analysis, 31,680 chars, 75 headings

Generated by 🌫️ Daily Ambient Context Optimizer · sonnet46 6.5M ·

  • expires on Jun 11, 2026, 8:38 PM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions