Closed
Add write-once probe loop kill guard to prevent 15-min agent timeout#43569
Conversation
…timeout Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…and fix tools/list message Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Copilot CLI agent-loop timeout in reviewer workflows
Add write-once probe loop kill guard to prevent 15-min agent timeout
Jul 5, 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.
Reviewer workflows (PR Code Quality Reviewer, Impeccable Skills Reviewer, Matt Pocock Skills Reviewer) were hitting the 15-minute step hard timeout at a rate of 10/22 red runs in 6h. Root cause: the Copilot CLI agent enters an infinite probe loop — repeatedly calling write-once safe-output tools with empty arguments, receiving
-32602rejections, and never exiting.Changes
harness_retry_guard.cjs— detection primitivesWRITE_ONCE_PROBE_REJECTION_PATTERN/WRITE_ONCE_PROBE_REJECTION_THRESHOLD(3)countWriteOnceProbeRejections(output)— counts occurrences of the rejection phrase in accumulated outputhasExcessiveWriteOnceProbeRejections(output)— true when count ≥ thresholdprocess_runner.cjs— live kill guardkillGuard?: (output: string) => booleantorunProcess. Called after each stdout/stderr data chunk; firesSIGTERMthe first time it returnstrue. Prevents any loop from burning the full step timeout.copilot_harness.cjs— wiringkillGuardtorunProcessthat fires on 3+ probe rejections in live outputinfrastructure_incomplete, breaks the retry loop (non-retryable — retrying would reproduce the same loop)"write_once_probe_loop"failure class inclassifyCopilotFailureTests
harness_retry_guard.test.cjscovering count/threshold/false-positive casesprocess_runner.test.cjscovering kill-guard fire, no-op, and single-fire semantics