Skip to content

Batch test-quarantine data collection to reduce token usage - #67085

Merged
wtgodbe merged 3 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/quarantine-batch-source-collection
Jun 8, 2026
Merged

wtgodbe merged 3 commits into
dotnet:mainfrom
wtgodbe:wtgodbe/quarantine-batch-source-collection

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Jun 8, 2026

Copy link
Copy Markdown
Member

The daily test-quarantine workflow keeps tripping the 25M effective-tokens limit. The dominant cost is the number of inference turns — each turn re-sends the whole conversation, and the agent was fetching test results build-by-build across many turns while surfacing raw resultsbyBuild/timeline JSON into context.

This is a prompt-only change to .github/workflows/test-quarantine.md (runtime-imported, so no lockfile recompile needed):

  • Sources A & B: mandate a single batched python3 script per source that paginates builds, fetches and aggregates test results in-script, writes raw data to a file under /tmp/gh-aw/agent/, and prints only a compact per-test failure summary.
  • Source C (Helix crash investigation): gate it behind the aggregated A+B counts (only work items that failed 1+ times) and run each as a single batched script instead of interactive per-build drill-downs.

wtgodbe and others added 2 commits June 8, 2026 10:26
The daily test-quarantine workflow keeps tripping the 25M effective-tokens
rail. The dominant cost is the number of inference turns: each turn re-sends
the whole conversation, and the agent was fetching test results build-by-build
across many turns and surfacing raw resultsbyBuild/timeline JSON into context.

Mandate a single batched python3 script per source (Sources A and B) that
lists builds, fetches and aggregates test results, writes raw data to a file
under /tmp/gh-aw/agent/, and prints only a compact per-test failure summary.
Gate Source C (Helix crash investigation) behind the aggregated A+B counts so
only work items that already failed 2+ times are investigated, each in a
single batched script rather than interactive per-build drill-downs.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 8, 2026 17:49
@wtgodbe
wtgodbe requested a review from a team as a code owner June 8, 2026 17:49
@github-actions github-actions Bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Jun 8, 2026

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 updates the test-quarantine workflow prompt to reduce effective token usage by enforcing batched, single-turn data collection and avoiding surfacing large raw Azure DevOps/Helix payloads in agent context.

Changes:

  • Adds a mandatory, single-batched-python3 data-collection method intended to minimize multi-turn build-by-build loops and raw JSON in context.
  • Updates Source A/B instructions to explicitly require script-side pagination, aggregation, writing raw outputs to /tmp/gh-aw/agent/, and printing only compact summaries.
  • Gates Source C (Helix crash investigation) behind aggregated Source A+B results and directs investigation via single batched scripts with constrained output.

Comment thread .github/workflows/test-quarantine.md Outdated
Comment on lines +199 to +203
1. Lists the relevant builds, following any `continuationToken` pagination **inside the script**.
2. Loops over those builds and fetches their test results **inside the script**.
3. Aggregates per-test-name failure counts in memory.
4. Writes the full raw/aggregated data to a file under `/tmp/gh-aw/agent/` (e.g., `source_a.json`).
5. Prints **only** a compact summary to your context — the per-test-name table of failures (test name + failure count + source), nothing else.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch — fixed in 85b64d6. Generalized steps 3–5 so step 5 explicitly covers both output styles (per-test failure table for Sources A/B; extracted [FAIL] blocks for Source C) while still enforcing the write-raw-to-file / print-only-compact rule.

Source C prints extracted [FAIL] blocks rather than a per-test failure
table, so generalize steps 3-5 of the data-collection method to cover both
output styles while keeping the write-raw-to-file / print-only-compact rule.

Co-authored-by: Copilot <[email protected]>
@wtgodbe
wtgodbe merged commit 568488b into dotnet:main Jun 8, 2026
10 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants