Skip to content

Issue Arborist: trim issue-fetch context to cut single-run token spikes - #49974

Merged
pelikhan merged 3 commits into
mainfrom
copilot/agentrx-optimizer-daily-workflow-optimization
Aug 3, 2026
Merged

pelikhan merged 3 commits into
mainfrom
copilot/agentrx-optimizer-daily-workflow-optimization

Conversation

Copilot AI commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Issue Arborist’s daily run was dominated by one oversized request (~822k tokens), driven by a large issue payload passed into the agent. This change reduces prompt-context volume at ingestion while preserving relationship-detection inputs.

  • Payload compaction in Fetch issues step

    • Reduced gh issue list --json fields to only relationship-relevant data.
    • Added deterministic jq shaping before agent consumption:
      • labels normalized to name arrays
      • body collapsed + truncated into body_excerpt (800 chars)
    • Removed schema-generation and schema-print output that added noise without decision value.
  • Prompt contract alignment

    • Updated workflow instructions to match compact dataset shape.
    • Replaced label-query examples to reflect normalized label arrays.
    • Removed references to the removed schema artifact.
  • Compiled workflow sync

    • Regenerated issue-arborist.lock.yml to reflect the markdown workflow changes.
gh issue list --repo "$GITHUB_REPOSITORY" --search "-parent-issue:*" --state open \
  --json number,title,url,createdAt,updatedAt,body,labels --limit 100 |
jq 'map({
  number, title, url, createdAt, updatedAt,
  labels: ((.labels // []) | map(.name)),
  body_excerpt: ((.body // "") | gsub("\\s+"; " ") | .[0:800])
})' > /tmp/gh-aw/agent/issues-data/issues.json

Copilot AI and others added 2 commits August 3, 2026 12:29
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 workflow to reduce token usage Issue Arborist: trim issue-fetch context to cut single-run token spikes Aug 3, 2026
Copilot AI requested a review from pelikhan August 3, 2026 12:43
@pelikhan
pelikhan marked this pull request as ready for review August 3, 2026 12:50
Copilot AI review requested due to automatic review settings August 3, 2026 12:50
@pelikhan
pelikhan merged commit 8bd48bb into main Aug 3, 2026
@pelikhan
pelikhan deleted the copilot/agentrx-optimizer-daily-workflow-optimization branch August 3, 2026 12:50

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

Reduces Issue Arborist’s prompt size by compacting pre-fetched issue data.

Changes:

  • Normalizes labels and truncates issue bodies.
  • Aligns prompt examples with the compact schema.
  • Regenerates the workflow and updates optimization references.
Show a summary per file
File Description
.github/workflows/issue-arborist.md Compacts issue payload and updates instructions.
.github/workflows/issue-arborist.lock.yml Synchronizes compiled workflow output.
.github/skills/agentic-workflows/SKILL.md Adds the observability optimization reference.

Review details

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

--search "-parent-issue:*" \
--state open \
--json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees \
--json number,title,url,createdAt,updatedAt,body,labels \
--json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees \
--json number,title,url,createdAt,updatedAt,body,labels \
--limit 100 \
| jq 'map({
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.4

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.

[agentrx-optimizer] Daily Workflow Optimization - 2026-08-03

3 participants