Repository navigation
Move test-quarantine Source B PR selection into a pre-activation step - #67129
Merged
wtgodbe merged 1 commit intoJun 10, 2026
Merged
Conversation
The daily test-quarantine workflow keeps tripping the 25M effective-token rail because the firewalled agent verified each candidate PR one-at-a-time via the pull_request_read MCP tool (77 calls = 77 inference turns in the latest failure). The agent sandbox has no usable GitHub token, and its MCP search tool silently drops external-contributor PRs, so it had no safe way to do this verification itself. Do the entire Source B build selection (B1-B4) in a deterministic pre-activation step that runs outside the firewall with a real GH_TOKEN: enumerate ADO PR builds, batch-verify base==main + merged via GraphQL, match head SHA, and hand the agent the exact list of build IDs to collect results from. The agent now makes zero GitHub calls and does not re-enumerate builds, eliminating both the token sink and any snapshot skew. Fail-loud on auth/rate-limit/any-failed-chunk so the run aborts visibly instead of silently under-reporting. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces token/inference-turn usage in the daily test-quarantine agentic workflow by moving Source B PR/build selection (B1–B4) out of the firewalled agent sandbox and into a deterministic pre-activation step that can use a real GitHub token. This prevents the previous per-PR GitHub verification loop and avoids snapshot skew by handing the agent an already-filtered list of Azure DevOps build IDs.
Changes:
- Added a pre-activation step that enumerates failed/partially-succeeded Azure DevOps PR builds (last 7 days), batch-verifies PRs via GitHub GraphQL, matches build commit SHAs to verified PR head SHAs, and emits
source_b_build_ids. - Updated the Source B instructions to treat
source_b_build_idsas authoritative input and to prohibit any GitHub calls / build re-enumeration inside the agent. - Recompiled
.lock.ymlto reflect the updated frontmatter and new pre-activation output wiring.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/test-quarantine.md | Adds deterministic pre-activation Source B verification and updates agent instructions to consume injected build IDs only. |
| .github/workflows/test-quarantine.lock.yml | Recompiled workflow lock output to include the new pre-activation step, output propagation, and updated concurrency settings. |
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.
Problem
The daily
test-quarantineworkflow keeps tripping the 25M effective-token rail. The dominant cost is Source B (flaky tests in merged PRs): the firewalled agent verified each candidate PR one-at-a-time via thepull_request_readMCP tool — 77 calls = 77 inference turns in the latest failure, each re-sending the whole conversation. The agent sandbox has no usable GitHub token, and the MCPsearch_pull_requeststool silently drops external-contributor PRs, so the agent had no safe way to verify PRs itself.Change
Move the entire Source B build selection (B1–B4) into a deterministic pre-activation step that runs outside the firewall with a real
GH_TOKEN:failed/partiallySucceededbuild's(buildId, prNumber, sourceSha)(B4).base==main(B2),merged==true(B3) — and capture each head SHA.source_b_build_ids).The agent now only fetches
resultsbyBuildfor those build IDs — zero GitHub calls, no re-enumeration (so no snapshot skew between the pre-step and the agent). Verification fails loud on auth/rate-limit/any failed GraphQL chunk so the run aborts visibly rather than silently under-reporting.Frontmatter changed, so
.lock.ymlis recompiled (gh aw compile).