Skip to content

Reduce Daily Syntax Error Quality workflow token churn without changing cadence#31586

Merged
pelikhan merged 6 commits into
mainfrom
copilot/copilot-token-optimizer-optimize-daily-check
May 11, 2026
Merged

Reduce Daily Syntax Error Quality workflow token churn without changing cadence#31586
pelikhan merged 6 commits into
mainfrom
copilot/copilot-token-optimizer-optimize-daily-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

✨ Enhancement

What does this improve?

The Daily Syntax Error Quality workflow was averaging 99 turns against a stated 20-turn budget, making prompt replay the main token cost driver. This change keeps the workflow on its existing daily cadence, tightens how the agent accesses candidate workflows, and makes the prompt more explicit about batching work into fewer tool calls.

Why is this valuable?

The workflow is intended to sample compiler error quality every day without unnecessary prompt and tool-call overhead. Preserving the daily schedule maintains the existing coverage, while stricter execution guidance and a smaller prompt should cut per-run token amplification without changing the workflow’s core evaluation behavior.

Implementation approach:

  • Schedule and run volume

    • Kept the workflow cadence daily.
  • Prompt execution constraints

    • Added an explicit batching section near the top of the prompt.
    • Instructed the agent to:
      • read candidate metadata and preview selected workflows in one bash call
      • copy/edit/compile each test case in one chained bash call
      • keep Phases 1–5 within a small tool-call budget
  • Candidate access narrowing

    • The pre-step now copies the 5 pre-selected workflows into /tmp/gh-aw/agent/candidates.
    • Prompt examples and bash permissions now operate on that narrowed candidate set instead of the full .github/workflows tree.
  • Prompt size reduction

    • Removed reference-heavy sections that add context cost without affecting the task flow:
      • the unused Category C examples
      • the verbose good/bad error output example block
on:
  schedule: daily

tools:
  bash:
    - "head -n 30 /tmp/gh-aw/agent/candidates/"
    - "cp /tmp/gh-aw/agent/candidates/"

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Hey @copilot-swe-agent 👋 — thanks for tackling the token efficiency improvements for the daily syntax error quality check workflow! Reducing a 99-turn average down to the declared 20-turn budget is a meaningful optimization.

One thing that would help before this lands:

  • Add tests — the changes touch pkg/actionpins/data/action_pins.json and pkg/workflow/data/action_pins.json (action pin data files) as well as the issue-arborist.lock.yml workflow lock. Even a lightweight validation test (e.g., confirming the JSON structure is well-formed or that the updated pins resolve correctly) would give reviewers confidence the data changes are correct.
  • Remove [WIP] from the title — once the implementation is complete and ready for review, drop the WIP prefix so maintainers know it's ready to merge.

If you'd like a hand addressing this, you can assign this prompt to your coding agent:

For PR #31586 (optimizing the daily syntax error quality check workflow):
1. Review the changes in pkg/actionpins/data/action_pins.json and pkg/workflow/data/action_pins.json to understand what action pins were updated.
2. Add or update any existing tests in the pkg/actionpins or pkg/workflow test files to cover the modified pin entries — at minimum verify the JSON is structurally valid and that updated pin SHAs are present.
3. Once tests pass, remove the [WIP] prefix from the PR title.

Generated by Contribution Check · ● 8.1M ·

Copilot AI and others added 2 commits May 11, 2026 21:22
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 syntax error quality check for token efficiency Reduce Daily Syntax Error Quality workflow token churn May 11, 2026
Copilot AI requested a review from pelikhan May 11, 2026 21:27
name: Daily Syntax Error Quality Check
description: Tests compiler error message quality by introducing syntax errors in workflows, evaluating error clarity, and suggesting improvements
on:
schedule: daily
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Keep daily

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 69c63e6.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Reduce Daily Syntax Error Quality workflow token churn Reduce Daily Syntax Error Quality workflow token churn without changing cadence May 11, 2026
Copilot AI requested a review from pelikhan May 11, 2026 21:51
@pelikhan pelikhan marked this pull request as ready for review May 11, 2026 22:04
Copilot AI review requested due to automatic review settings May 11, 2026 22:04
@pelikhan pelikhan merged commit bec1e7e into main May 11, 2026
23 checks passed
@pelikhan pelikhan deleted the copilot/copilot-token-optimizer-optimize-daily-check branch May 11, 2026 22:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 aims to reduce token/turn amplification in the Daily Syntax Error Quality workflow while keeping the existing daily schedule, primarily by tightening the prompt’s execution guidance and narrowing how candidate workflows are staged for the agent.

Changes:

  • Adds explicit batching/tool-call budget rules to the prompt to encourage fewer, chained bash/tool calls.
  • Introduces a pre-step that copies 5 randomly selected candidate workflow files into /tmp/gh-aw/agent/candidates and updates prompt/tool examples to use that directory.
  • Reduces prompt size by removing unused/verbose example sections.
Show a summary per file
File Description
.github/workflows/daily-syntax-error-quality.md Updates candidate staging, tool allowlist prefixes, and prompt guidance to reduce tool-call/token churn.
.github/workflows/daily-syntax-error-quality.lock.yml Regenerated compiled workflow reflecting the updated prompt and candidate-copy step.

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: 1

Comment on lines +35 to +41
mkdir -p /tmp/gh-aw/agent/candidates
find .github/workflows -name '*.md' -type f ! -name 'daily-*.md' ! -name '*-test.md' \
| shuf -n 5 \
> /tmp/gh-aw/agent/candidates.txt
while IFS= read -r workflow; do
cp "$workflow" /tmp/gh-aw/agent/candidates/
done < /tmp/gh-aw/agent/candidates.txt
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.

[copilot-token-optimizer] Optimize Daily Syntax Error Quality Check — 99-turn avg vs 20-turn budget (6.1M tokens/run)

3 participants