Use API proxy event logs as the ambient context source of truth#37655
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Hey A couple of things to address before this is ready for review:
If you'd like a hand closing the loop, you can assign this prompt to your coding agent:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the “Daily Ambient Context Optimizer” workflow guidance to treat API proxy event logs as the authoritative source for the first DLLM request, and de-emphasizes prompt.txt to a secondary cross-check artifact to reduce false findings in ambient-context analysis.
Changes:
- Updates sampling/extraction rules to prioritize API proxy event logs and use
prompt.txtonly for compilation-debug cross-checking. - Extends deterministic analysis guidance to include inline linter counting and request char/token ratio metadata.
- Adjusts the maintenance workflow’s
gh aw logsinvocation by removing the--artifacts usagefilter.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/daily-ambient-context-optimizer.md |
Revises first-request source-of-truth and analysis rubric/metadata for ambient-context optimization. |
.github/workflows/agentics-maintenance.yml |
Changes the artifact download scope for the activity report logs step by removing --artifacts usage. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 3
| - preferred: the first DLLM request payload in the canonical `sandbox/firewall/logs/api-proxy-logs/event-logs.jsonl`, accepting the legacy `sandbox/firewall/logs/api-proxy-logs/events.jsonl` name too (including the matching `sandbox/firewall-audit-logs/...` fallback path when present) | ||
| - fallback: the first `user.message` event in `sandbox/agent/logs/copilot-session-state/<session-id>/events.jsonl` | ||
| - use `prompt.txt` only as a compilation-debug cross-check, never as the ambient-context source of truth |
| 1. the first DLLM request payload captured in the canonical API proxy event log `sandbox/firewall/logs/api-proxy-logs/event-logs.jsonl`, accepting the legacy `sandbox/firewall/logs/api-proxy-logs/events.jsonl` name too (or the same path under `sandbox/firewall-audit-logs/` when that artifact layout is present), because that is the text actually sent to the DLLM | ||
| 2. otherwise, extract the first user-message payload from `sandbox/agent/logs/copilot-session-state/<session-id>/events.jsonl` | ||
| 3. read `prompt.txt` only as a secondary compilation-debug artifact for cross-checking; do not use it as the primary request text |
| run: | | ||
| ${GH_AW_CMD_PREFIX} logs \ | ||
| --repo "${{ github.repository }}" \ | ||
| --start-date -1w \ | ||
| --count 100 \ | ||
| --artifacts usage \ | ||
| --output ./.cache/gh-aw/activity-report-logs \ | ||
| --format markdown \ | ||
| > ./.cache/gh-aw/activity-report-logs/report.md |
The ambient context optimizer was analyzing
prompt.txtinstead of the request text actually sent to the model, which led to false inline-agent findings and missed real compiler leakage. This updates the workflow guidance to treat API proxy event logs as authoritative, while keepingprompt.txtonly as a diagnostic cross-check.Request source selection
sandbox/firewall/logs/api-proxy-logs/event-logs.jsonlsandbox/firewall/logs/api-proxy-logs/events.jsonlsandbox/firewall-audit-logs/...fallback path.events.jsonlonly as the fallback source for firstuser.messageextraction.prompt.txtsemanticsprompt.txtas ambient-context source of truth.prompt.txtas likely compilation bugs rather than workflow bloat.Cross-validation metadata
request_input_tokensprompt_charsrequest_prompt_char_deltaAnalysis rubric
## linter:) alongside inline agents and skills.Example of the updated source-order rule: