fix(agentrx-optimizer): add logs precondition rules and retry cap - #49315
Merged
pelikhan merged 3 commits intoJul 31, 2026
Conversation
…-optimizer Add three explicit guardrails to the Data and Tooling Requirements section: 1. Always include workflow_name filter in logs calls (unfiltered scans time out) 2. Cap logs retries at 2; fall back to audit on empty/timeout 3. Treat total_runs=0 for known-good workflows as a tool-health signal to surface via missing_tool, not a reason to keep retrying Closes #49289 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize daily workflow for AgentRx pipeline
fix(agentrx-optimizer): add logs precondition rules and retry cap
Jul 31, 2026
pelikhan
marked this pull request as ready for review
July 31, 2026 11:37
Collaborator
|
@copilot import logs cache shared agentic workflow |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds guardrails to prevent excessive logs MCP calls and provide an audit fallback.
Changes:
- Requires filtered
logscalls and caps retries. - Handles empty results as tool-health failures.
- Updates the compiled workflow hash.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/daily-agentrx-trace-optimizer.md |
Adds log-query preconditions and fallback guidance. |
.github/workflows/daily-agentrx-trace-optimizer.lock.yml |
Synchronizes the generated body hash. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| - Use `logs` to download parsed logs for recent runs, specifying `artifacts: ["agent"]` to include agent telemetry (turns, token usage, stdout) needed for AgentRx trajectory analysis. | ||
| **`logs` precondition rules (follow strictly):** | ||
| - Always include `workflow_name` — never call `logs` without it; an unfiltered scan will time out. | ||
| - Cap retries at **2 attempts** per workflow. If both return empty or time out, stop retrying and fall back to `audit` using any known `run_id` (from `status` or prior context). |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
pelikhan
deleted the
copilot/agentrx-optimizer-daily-workflow-optimization
branch
July 31, 2026 12:15
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
logsMCP tool was being called without aworkflow_namefilter (causing 60s timeouts) and retried unboundedly on empty results — driving 96 of ~103 tool calls in the audited baseline run and theresource_heavy_for_domain/partially_reduciblefindings.Changes
daily-agentrx-trace-optimizer.md— Data and Tooling Requirementsworkflow_namein everylogscall; unfiltered scans time outlogsretries at 2 attempts per workflow; fall back toaudit(using any knownrun_id) on empty or timeouttotal_runs=0for a confirmed workflow as a tool-health signal: surface viamissing_tooland switch toaudit-only — do not vary parameters and retry{ "workflow_name": "<workflow-id>", "count": 50, "start_date": "-2d", "artifacts": ["agent"] }daily-agentrx-trace-optimizer.lock.yml— recompiled to keep lock file in sync (body-only change; no frontmatter modified)