Skip to content

fix(ambient-context): reduce prompt bloat in ai-moderator, pr-sous-chef, daily-cache-strategy-analyzer - #49225

Merged
pelikhan merged 5 commits into
mainfrom
copilot/daily-ambient-context-optimizer
Jul 31, 2026
Merged

fix(ambient-context): reduce prompt bloat in ai-moderator, pr-sous-chef, daily-cache-strategy-analyzer#49225
pelikhan merged 5 commits into
mainfrom
copilot/daily-ambient-context-optimizer

Conversation

CopilotAI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Three workflows were identified as top ambient-context cost drivers: ai-moderator used a more expensive MCP mode than peers, pr-sous-chef carried ~6KB of redundant instructional prose, and daily-cache-strategy-analyzer spent an agent turn downloading logs that could be pre-fetched.

Changes

  • ai-moderator.md: tools.github.mode: localgh-proxy, matching all peer workflows. Avoids starting a dedicated GitHub MCP Docker container per run.

  • pr-sous-chef.md (~11% smaller):

    • Collapsed "Required skip rules per PR" (3 verbose multi-paragraph rules with redundant prefilter notes) into a single compact reference table.
    • Removed bash code examples from nudge step 2 — they duplicated instructions already present in the same step.
  • daily-cache-strategy-analyzer.md: Added shared/aw-logs-24h-fetch-setup.md import to pre-download workflow logs as a GitHub Actions step before the agent starts. Phase 1 now uses {{#runtime-import? shared/aw-logs-24h-fetch-prompt.md}} to signal that logs are already at /tmp/gh-aw/aw-mcp/logs/, eliminating the MCP logs tool call turn.

CopilotAIand others added 2 commits July 31, 2026 00:07
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…e-strategy-analyzer workflows
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix threat detection engine error in analysisfix(ambient-context): reduce prompt bloat in ai-moderator, pr-sous-chef, daily-cache-strategy-analyzerJul 31, 2026
CopilotAI requested a review from pelikhanJuly 31, 2026 00:15
@github-actions

Copy link
Copy Markdown
Contributor

Triage Summary

  • Category: chore
  • Risk: low
  • Priority: low
  • Score: 37/100 (impact 15/50, urgency 10/30, quality 12/20)
  • Recommended action:batch_review
  • Batch: workflow-tuning

Prompt-bloat reduction across 3 workflows (ai-moderator, pr-sous-chef, daily-cache-strategy-analyzer); cost-saving, low risk.

Automated triage — labels applied for tracking.

Generated by 🔧 PR Triage Agent · auto · 37.7 AIC · ⌖ 7.71 AIC · ⊞ 7.9K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

CopilotAIand others added 2 commits July 31, 2026 05:25
…-context-optimizer
# Conflicts:
#	.github/workflows/ab-testing-advisor.lock.yml
#	.github/workflows/ace-editor.lock.yml
#	.github/workflows/agent-performance-analyzer.lock.yml
#	.github/workflows/agent-persona-explorer.lock.yml
#	.github/workflows/agentic-token-audit.lock.yml
#	.github/workflows/agentic-token-optimizer.lock.yml
#	.github/workflows/agentic-token-trend-audit.lock.yml
#	.github/workflows/archie.lock.yml
#	.github/workflows/architecture-guardian.lock.yml
#	.github/workflows/artifacts-summary.lock.yml
#	.github/workflows/auto-triage-issues.lock.yml
#	.github/workflows/bot-detection.lock.yml
#	.github/workflows/breaking-change-checker.lock.yml
#	.github/workflows/chaos-pr-bundle-fuzzer.lock.yml
#	.github/workflows/ci-coach.lock.yml
#	.github/workflows/cli-consistency-checker.lock.yml
#	.github/workflows/code-scanning-fixer.lock.yml
#	.github/workflows/code-simplifier.lock.yml
#	.github/workflows/commit-changes-analyzer.lock.yml
#	.github/workflows/constraint-solving-potd.lock.yml
#	.github/workflows/contribution-check.lock.yml
#	.github/workflows/copilot-centralization-drilldown.lock.yml
#	.github/workflows/copilot-centralization-optimizer.lock.yml
#	.github/workflows/copilot-cli-deep-research.lock.yml
#	.github/workflows/copilot-opt.lock.yml
#	.github/workflows/copilot-pr-merged-report.lock.yml
#	.github/workflows/copilot-pr-nlp-analysis.lock.yml
#	.github/workflows/copilot-pr-prompt-analysis.lock.yml
#	.github/workflows/craft.lock.yml
#	.github/workflows/daily-agent-of-the-day-blog-writer.lock.yml
#	.github/workflows/daily-ambient-context-optimizer.lock.yml
#	.github/workflows/daily-architecture-diagram.lock.yml
#	.github/workflows/daily-assign-issue-to-user.lock.yml
#	.github/workflows/daily-awf-spec-compiler-surfacing.lock.yml
#	.github/workflows/daily-byok-ollama-test.lock.yml
#	.github/workflows/daily-cli-performance.lock.yml
#	.github/workflows/daily-cli-tools-tester.lock.yml
#	.github/workflows/daily-community-attribution.lock.yml
#	.github/workflows/daily-compiler-quality.lock.yml
#	.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml
#	.github/workflows/daily-credit-limit-test.lock.yml
#	.github/workflows/daily-doc-updater.lock.yml
#	.github/workflows/daily-experiment-report.lock.yml
#	.github/workflows/daily-file-diet.lock.yml
#	.github/workflows/daily-firewall-report.lock.yml
#	.github/workflows/daily-formal-spec-verifier.lock.yml
#	.github/workflows/daily-function-namer.lock.yml
#	.github/workflows/daily-geo-optimizer.lock.yml
#	.github/workflows/daily-github-docs-seo-optimizer.lock.yml
#	.github/workflows/daily-go-test-parallelizer.lock.yml
#	.github/workflows/daily-graft-intelligence.lock.yml
#	.github/workflows/daily-hippo-learn.lock.yml
#	.github/workflows/daily-issues-report.lock.yml
#	.github/workflows/daily-malicious-code-scan.lock.yml
#	.github/workflows/daily-max-ai-credits-test.lock.yml
#	.github/workflows/daily-mcp-concurrency-analysis.lock.yml
#	.github/workflows/daily-model-inventory.lock.yml
#	.github/workflows/daily-model-resolution.lock.yml
#	.github/workflows/daily-multi-device-docs-tester.lock.yml
#	.github/workflows/daily-news.lock.yml
#	.github/workflows/daily-performance-summary.lock.yml
#	.github/workflows/daily-regulatory.lock.yml
#	.github/workflows/daily-repo-chronicle.lock.yml
#	.github/workflows/daily-safe-output-integrator.lock.yml
#	.github/workflows/daily-secrets-analysis.lock.yml
#	.github/workflows/daily-security-observability.lock.yml
#	.github/workflows/daily-semgrep-scan.lock.yml
#	.github/workflows/daily-sentrux-report.lock.yml
#	.github/workflows/daily-skill-optimizer.lock.yml
#	.github/workflows/daily-spdd-spec-planner.lock.yml
#	.github/workflows/daily-spending-forecast.lock.yml
#	.github/workflows/daily-squid-image-scan.lock.yml
#	.github/workflows/daily-syntax-error-quality.lock.yml
#	.github/workflows/daily-team-status.lock.yml
#	.github/workflows/daily-testify-uber-super-expert.lock.yml
#	.github/workflows/daily-windows-terminal-integration-builder.lock.yml
#	.github/workflows/daily-workflow-updater.lock.yml
#	.github/workflows/dataflow-pr-discussion-dataset.lock.yml
#	.github/workflows/dead-code-remover.lock.yml
#	.github/workflows/delight.lock.yml
#	.github/workflows/dependabot-burner.lock.yml
#	.github/workflows/dependabot-go-checker.lock.yml
#	.github/workflows/deployment-incident-monitor.lock.yml
#	.github/workflows/designer-drift-audit.lock.yml
#	.github/workflows/dev-hawk.lock.yml
#	.github/workflows/dictation-prompt.lock.yml
#	.github/workflows/discussion-task-miner.lock.yml
#	.github/workflows/docs-noob-tester.lock.yml
#	.github/workflows/draft-pr-cleanup.lock.yml
#	.github/workflows/eslint-miner.lock.yml
#	.github/workflows/eslint-monster.lock.yml
#	.github/workflows/evoskill-evolver.lock.yml
#	.github/workflows/example-failure-category-filter.lock.yml
#	.github/workflows/example-permissions-warning.lock.yml
#	.github/workflows/firewall-escape.lock.yml
#	.github/workflows/firewall.lock.yml
#	.github/workflows/functional-pragmatist.lock.yml
#	.github/workflows/github-remote-mcp-auth-test.lock.yml
#	.github/workflows/glossary-maintainer.lock.yml
#	.github/workflows/gpclean.lock.yml
#	.github/workflows/impeccable-skills-reviewer.lock.yml
#	.github/workflows/issue-monster.lock.yml
#	.github/workflows/issue-triage-agent.lock.yml
#	.github/workflows/jsweep.lock.yml
#	.github/workflows/layout-spec-maintainer.lock.yml
#	.github/workflows/lint-monster.lock.yml
#	.github/workflows/linter-miner.lock.yml
#	.github/workflows/mattpocock-skills-reviewer.lock.yml
#	.github/workflows/mcp-inspector.lock.yml
#	.github/workflows/mergefest.lock.yml
#	.github/workflows/metrics-collector.lock.yml
#	.github/workflows/notion-issue-summary.lock.yml
#	.github/workflows/objective-impact-report.lock.yml
#	.github/workflows/org-health-report.lock.yml
#	.github/workflows/outcome-collector.lock.yml
#	.github/workflows/pdf-summary.lock.yml
#	.github/workflows/plan.lock.yml
#	.github/workflows/poem-bot.lock.yml
#	.github/workflows/pr-code-quality-reviewer.lock.yml
#	.github/workflows/pr-description-caveman.lock.yml
#	.github/workflows/pr-nitpick-reviewer.lock.yml
#	.github/workflows/pr-sous-chef.lock.yml
#	.github/workflows/pr-triage-agent.lock.yml
#	.github/workflows/python-data-charts.lock.yml
#	.github/workflows/q.lock.yml
#	.github/workflows/refactoring-cadence.lock.yml
#	.github/workflows/refiner.lock.yml
#	.github/workflows/release.lock.yml
#	.github/workflows/repo-audit-analyzer.lock.yml
#	.github/workflows/repo-tree-map.lock.yml
#	.github/workflows/repository-quality-improver.lock.yml
#	.github/workflows/research.lock.yml
#	.github/workflows/schema-consistency-checker.lock.yml
#	.github/workflows/security-compliance.lock.yml
#	.github/workflows/security-review.lock.yml
#	.github/workflows/sighthound-security-scan.lock.yml
#	.github/workflows/skillet.lock.yml
#	.github/workflows/slide-deck-maintainer.lock.yml
#	.github/workflows/smoke-copilot-aoai-apikey.lock.yml
#	.github/workflows/smoke-copilot-aoai-entra.lock.yml
#	.github/workflows/smoke-copilot-arm.lock.yml
#	.github/workflows/smoke-copilot-auto.lock.yml
#	.github/workflows/smoke-copilot-mai.lock.yml
#	.github/workflows/smoke-copilot-sdk.lock.yml
#	.github/workflows/smoke-copilot-small.lock.yml
#	.github/workflows/smoke-copilot-sub-agents.lock.yml
#	.github/workflows/smoke-copilot.lock.yml
#	.github/workflows/smoke-create-cross-repo-pr.lock.yml
#	.github/workflows/smoke-multi-pr.lock.yml
#	.github/workflows/smoke-otel-backends.lock.yml
#	.github/workflows/smoke-pi.lock.yml
#	.github/workflows/smoke-project.lock.yml
#	.github/workflows/smoke-service-ports.lock.yml
#	.github/workflows/smoke-temporary-id.lock.yml
#	.github/workflows/smoke-test-tools.lock.yml
#	.github/workflows/smoke-update-cross-repo-pr.lock.yml
#	.github/workflows/smoke-workflow-call-with-inputs.lock.yml
#	.github/workflows/smoke-workflow-call.lock.yml
#	.github/workflows/spec-enforcer.lock.yml
#	.github/workflows/spec-extractor.lock.yml
#	.github/workflows/spec-librarian.lock.yml
#	.github/workflows/stale-pr-cleanup.lock.yml
#	.github/workflows/stale-repo-identifier.lock.yml
#	.github/workflows/sub-issue-closer.lock.yml
#	.github/workflows/super-linter.lock.yml
#	.github/workflows/technical-doc-writer.lock.yml
#	.github/workflows/terminal-stylist.lock.yml
#	.github/workflows/test-quality-sentinel.lock.yml
#	.github/workflows/tidy.lock.yml
#	.github/workflows/ubuntu-image-analyzer.lock.yml
#	.github/workflows/uk-ai-operational-resilience.lock.yml
#	.github/workflows/unbloat-docs.lock.yml
#	.github/workflows/update-astro.lock.yml
#	.github/workflows/video-analyzer.lock.yml
#	.github/workflows/visual-regression-checker.lock.yml
#	.github/workflows/weekly-blog-post-writer.lock.yml
#	.github/workflows/weekly-editors-health-check.lock.yml
#	.github/workflows/weekly-issue-summary.lock.yml
#	.github/workflows/weekly-safe-outputs-spec-review.lock.yml
#	.github/workflows/workflow-generator.lock.yml
#	.github/workflows/workflow-health-manager.lock.yml
#	.github/workflows/workflow-normalizer.lock.yml
#	.github/workflows/workflow-skill-extractor.lock.yml
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

CopilotAI commented Jul 31, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot resolve the merge conflicts in this pull request

Resolved in commit 2498c5b. Merged origin/main (5 commits ahead), accepted main's lock file versions for all 183 conflicted .lock.yml files, then ran make recompile to regenerate all lock files with the workflow changes from this PR applied on top. All 266 workflows compile cleanly.

@pelikhan
pelikhan marked this pull request as ready for review July 31, 2026 05:32
CopilotAI review requested due to automatic review settings July 31, 2026 05:32
@pelikhan
pelikhan merged commit 9cfb735 into mainJul 31, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/daily-ambient-context-optimizer branch July 31, 2026 05:32

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

The proxy prompt references unavailable MCP tools, and log pre-fetching omits most runs and required agent artifacts.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Reduces ambient-context overhead across three agentic workflows.

Changes:

  • Switches AI Moderator to gh-proxy.
  • Condenses PR Sous Chef instructions.
  • Pre-fetches cache-analysis logs before agent execution.
File summaries
FileDescription
.github/workflows/ai-moderator.mdEnables gh-proxy.
.github/workflows/ai-moderator.lock.ymlRegenerates proxy configuration.
.github/workflows/pr-sous-chef.mdCondenses skip and nudge guidance.
.github/workflows/pr-sous-chef.lock.ymlUpdates generated metadata.
.github/workflows/daily-cache-strategy-analyzer.mdAdds deterministic log pre-fetching.
.github/workflows/daily-cache-strategy-analyzer.lock.ymlAdds generated pre-fetch steps.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

allowed-extensions: [".json"]
github:
mode: local
mode: gh-proxy
close-older-discussions: true
timeout-minutes: 60
imports:
- uses: shared/aw-logs-24h-fetch-setup.md
```

Logs are saved to `/tmp/gh-aw/aw-mcp/logs/`. Each run directory contains:
Logs are available in `/tmp/gh-aw/aw-mcp/logs/`. Each run directory contains:
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ambient-context] Daily Ambient Context Optimizer - 2026-07-30

3 participants

@pelikhan