Skip to content

Reduce ambient context cost in daily workflows (go-logger, sergo, smoke-copilot)#36852

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/ambient-context-optimizer-2026-06-04
Draft

Reduce ambient context cost in daily workflows (go-logger, sergo, smoke-copilot)#36852
Copilot wants to merge 3 commits into
mainfrom
copilot/ambient-context-optimizer-2026-06-04

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

Daily optimizer findings showed token burn was dominated by turn proliferation (go-logger), structural prompt overhead (sergo), and verbose static requirements (smoke-copilot), not just raw prompt size. This PR reduces recurring context load by front-loading deterministic preprocessing and removing always-on prompt bulk.

  • Go Logger: deterministic preflight + manifest-first flow

    • Added a pre-activation manifest step in go-logger.md to compute:
      • preflight.json (should_run, SHAs, paths)
      • manifest.json (files needing logger/imports/candidate call sites)
    • Gated agent execution on preflight output so unchanged runs can short-circuit.
    • Replaced iterative discovery guidance with manifest consumption.
    • Added compact structured patch schema guidance for logger diffs.
  • Sergo: flatten prompt structure + externalize examples

    • Refactored sergo.md from heading-heavy/template-heavy form to a compact execution plan.
    • Removed embedded example fences from the base prompt.
    • Added bounded strategy-history loading guidance (recent entries only).
    • Introduced conditional examples skill: .github/skills/sergo-examples/SKILL.md.
  • Smoke Copilot: trim largest static section

    • Condensed ## Test Requirements in smoke-copilot.md while preserving required checks and outputs.
    • Reduced repeated phrasing/instruction overhead in the highest-cost section.
  • Compiled artifacts updated

    • Regenerated:
      • .github/workflows/go-logger.lock.yml
      • .github/workflows/sergo.lock.yml
      • .github/workflows/smoke-copilot.lock.yml

Example (go-logger preflight gate + manifest output):

steps:
  - name: Build deterministic logger manifest
    id: logger_manifest
    run: |
      # writes /tmp/gh-aw/agent/go-logger/preflight.json + manifest.json
      # emits should_run=true|false
if: needs.pre_activation.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
jobs:
  pre-activation:
    outputs:
      should_run: ${{ steps.logger_manifest.outputs.should_run }}

Copilot AI and others added 2 commits June 4, 2026 06:14
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update daily ambient context optimizer findings Reduce ambient context cost in daily workflows (go-logger, sergo, smoke-copilot) Jun 4, 2026
Copilot AI requested a review from pelikhan June 4, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants