Skip to content

Optimize daily AgentRx trace workflow with three inline small-model sub-agents - #32416

Merged
pelikhan merged 4 commits into
mainfrom
copilot/subagent-optimizer-optimize-daily-agentrx
May 15, 2026
Merged

pelikhan merged 4 commits into
mainfrom
copilot/subagent-optimizer-optimize-daily-agentrx

Conversation

Copilot AI commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

✨ Enhancement

The daily AgentRx optimizer is a top token consumer (~5.1M tokens/run, 56 turns) with multiple extractive/classification-heavy phases still handled by the main model. This change offloads those mechanical phases to inline small sub-agents while preserving final recommendation synthesis in the main workflow.

  • What does this improve?

    • Splits three high-volume deterministic tasks out of the main prompt in .github/workflows/daily-agentrx-trace-optimizer.md:
      • trajectory construction (trajectory-builder)
      • artifact summarization for <details> output (artifacts-summarizer)
      • violation-to-fix taxonomy labeling (failure-pattern-classifier)
    • Replaces verbose inline instructions in:
      • ### 1) Build AgentRx input trajectory
      • ### 3) Derive one optimization recommendation
      • AgentRx Artifacts details block in ## Issue Output Format
  • Why is this valuable?

    • Reduces main-model context load on extractive/classificatory work that does not require full synthesis.
    • Aligns with the optimizer’s estimated impact target (~15–25% token reduction) by moving repetitive structured processing to smaller agents.
  • Implementation approach:

    • Added three inline ## agent: blocks at the end of the workflow:
      • trajectory-builder (model: small)
      • artifacts-summarizer (model: small)
      • failure-pattern-classifier (model: small)
    • Added explicit invocation/input contracts in the parent workflow (e.g., run_data_path, run_dir, check_path, judge_path) and explicit output expectations (/tmp/agentrx/trajectory.json, markdown details body, labeled violations table).
### 1) Build AgentRx input trajectory

Invoke `trajectory-builder` by passing this exact input block:
```text
run_data_path: /tmp/agentrx/mcp-runs.json

It must produce /tmp/agentrx/trajectory.json.

Copilot AI and others added 3 commits May 15, 2026 15:45
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>
Copilot AI changed the title [WIP] Optimize daily AgentRx trace workflow Optimize daily AgentRx trace workflow with three inline small-model sub-agents May 15, 2026
Copilot AI requested a review from pelikhan May 15, 2026 15:48
@pelikhan
pelikhan marked this pull request as ready for review May 15, 2026 18:28
Copilot AI review requested due to automatic review settings May 15, 2026 18:28
@pelikhan
pelikhan merged commit 0346dcd into main May 15, 2026
@pelikhan
pelikhan deleted the copilot/subagent-optimizer-optimize-daily-agentrx branch May 15, 2026 18:28

Copilot AI 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.

Pull request overview

This PR refactors the daily AgentRx trace optimizer prompt to delegate trajectory construction, artifact summarization, and violation classification to inline small sub-agents.

Changes:

  • Replaces verbose main-model instructions with sub-agent invocations.
  • Adds three inline sub-agent definitions for trajectory building, artifact summarization, and failure-pattern classification.
  • Keeps final recommendation selection in the parent workflow.
Show a summary per file
File Description
.github/workflows/daily-agentrx-trace-optimizer.md Adds sub-agent-based extraction/classification/summarization flow for the AgentRx optimizer workflow.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment on lines +69 to +72
Invoke `trajectory-builder` by passing this exact input block:
```text
run_data_path: /tmp/agentrx/mcp-runs.json
```
Comment on lines +98 to +103
First, invoke `failure-pattern-classifier` by passing this exact input block:
```text
check_path: /tmp/agentrx/runs/gh-aw-daily/check.json
judge_path: /tmp/agentrx/runs/gh-aw-daily/judge.json
```
Capture its markdown table output as the labeled violations list for this section. Then read that labeled table and pick the single highest-impact fix.
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.

[subagent-optimizer] Optimize daily-agentrx-trace-optimizer — 2026-05-15

3 participants