optimize agent-performance-analyzer with inline sub-agents#29843
Merged
optimize agent-performance-analyzer with inline sub-agents#29843
Conversation
- Add `inline-agents: true` to features frontmatter - Add `metrics-extractor` sub-agent (claude-haiku-4.5) for Phase 1 memory reads - Add `pattern-detector` sub-agent (claude-haiku-4.5) for Phase 3 pattern classification - Recompile lock file Closes #<issue>" Agent-Logs-Url: https://github.com/github/gh-aw/sessions/99053b03-badd-47aa-a744-52e42876615a Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize agent-performance-analyzer with inline sub-agents
optimize agent-performance-analyzer with inline sub-agents
May 2, 2026
pelikhan
approved these changes
May 3, 2026
pelikhan
approved these changes
May 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors agent-performance-analyzer to use inline sub-agents for two prompt phases: repo-memory metrics extraction and behavioral pattern classification, with the goal of reducing token usage and stabilizing execution flow.
Changes:
- Enables the
inline-agentsfeature for the workflow. - Replaces Phase 1’s manual shared-memory read instructions with a
metrics-extractorsub-agent. - Replaces Phase 3’s in-prompt pattern detection instructions with a
pattern-detectorsub-agent and regenerates the compiled lock file accordingly.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/agent-performance-analyzer.md |
Adds inline-agent support, updates Phase 1 and Phase 3 instructions to delegate work to new sub-agents, and defines the new metrics-extractor and pattern-detector agent blocks. |
.github/workflows/agent-performance-analyzer.lock.yml |
Regenerates the compiled workflow to upload and restore inline sub-agent artifacts and refreshes generated prompt/config identifiers. |
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
Comment on lines
+595
to
+598
| You are a metrics extraction assistant. When given a newline-separated list of file paths (one path per line), read each file using bash and return a single JSON object containing all data found. | ||
|
|
||
| For JSON files, parse and include the full content under a key matching the file's basename (without extension). For a directory path, list and read all files within it, using their basenames as keys. For markdown files, include the raw text under a key matching the filename. | ||
|
|
Comment on lines
+307
to
+311
| Use the `pattern-detector` sub-agent to classify agent behavioral patterns from the profiles you built in Phase 1. Pass the agent profiles as an inline JSON object. It will return a structured classification of: | ||
| - Over/under-creation patterns | ||
| - Repetition or duplication | ||
| - Scope creep instances | ||
| - Inconsistent behavior flags |
Comment on lines
+307
to
+311
| Use the `pattern-detector` sub-agent to classify agent behavioral patterns from the profiles you built in Phase 1. Pass the agent profiles as an inline JSON object. It will return a structured classification of: | ||
| - Over/under-creation patterns | ||
| - Repetition or duplication | ||
| - Scope creep instances | ||
| - Inconsistent behavior flags |
This was referenced May 3, 2026
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.
agent-performance-analyzerhandles all data extraction/classification with the main model despite having distinct phases ideal for delegation. Phase 1 (memory reads) and Phase 3 (pattern classification) are pure extraction tasks with no deep reasoning requirements — ~196K avg tokens/run with 0–20 turn execution drift.Changes
inline-agents: truetofeaturesmetrics-extractorsub-agent (haiku); sub-agent reads all shared memory paths and returns a single structured JSON object, eliminating repeated file-read turns by the main modelpattern-detectorsub-agent (haiku); receives agent profiles JSON, returns a per-agent map of detected patterns (over-creation,under-creation,repetition,scope-creep,inconsistency)New sub-agents
Expected: ~15–20% token reduction per run, more consistent turn counts in Phase 1, faster Phase 1 + Phase 3 execution.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw github.com/githudiff -lang=go1.25 go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE 64/bin/go go EnableCommentTool=true;EnablePlanTool=true] -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv lyzer.md -trimpath 64/bin/go -d internal/fuzz -lang=go1.25 go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go env ithub/workflows GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv 69910c48:.github/workflows/smoke-pi.md GO111MODULE $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/node/24.14.1/x64/bin/git GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv 69910c48:.github/workflows/agent-performance-analyzer.lock.yml GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE tnet/tools/git GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v9/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv ."(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv cli/install.sh..."(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv(http block)/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv lyzer.md -trimpath 64/bin/go -p github.com/pmezaadd -lang=go1.16 go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv ithub/workflows GO111MODULE rgo/bin/git GOINSECURE GOMOD GOMODCACHE go env 97e5dab3ea8812f769910c48:.github-f GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b/usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv(http block)/usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv -crush.lock.yml GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv -crush.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/docker/metadata-action/git/ref/tags/v6/usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE ndor/bin/git GOINSECURE GOMOD GOMODCACHE go env 69910c48:.github-f GO111MODULE ache/go/1.25.8/x-f GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 69910c48 GOINSECURE GOMOD GOMODCACHE go env 69910c48:.github/workflows/smoke-f GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/docker/setup-buildx-action/git/ref/tags/v4/usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env def6316056a12d4907a9d4d84ff7a3b GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 69910c48 GOINSECURE GOMOD GOMODCACHE go env 69910c48:.github/workflows/smoke-pi.md GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch ithub/workflows GO111MODULE t elete GOMOD 97e5dab3ea8812f7/home/REDACTED/work/gh-aw/gh-aw go env 97e5dab3ea8812f769910c48:.github/workflows/agent-performance-analyzer.md GO111MODULE rostylelite-markdown-spellcheck.lock.yml GOINSECURE GOMOD GOMODCACHE go(http block)If you need me to access, download, or install something from one of these locations, you can either: