fix(review-pr): schema mismatch, chunk size, and timeout diagnostics#202
Open
derekmisler wants to merge 2 commits intodocker:mainfrom
Open
fix(review-pr): schema mismatch, chunk size, and timeout diagnostics#202derekmisler wants to merge 2 commits intodocker:mainfrom
derekmisler wants to merge 2 commits intodocker:mainfrom
Conversation
Three targeted fixes for the runaway-drafter timeout seen in docker/sailor PR #754 (https://github.com/docker/sailor/actions/runs/25577728034/job/75088929732). ## Fix 1 — Schema mismatch in pr-review.yaml (root cause of infinite loop) The root agent's transfer_task delegation message was not explicitly documenting the drafter's enforced structured_output schema field names. When the LLM generated the task string it used 'title'/'body' (natural GitHub review terminology) instead of the schema-required 'category'/'issue'/'details'/'in_diff'. Every emit attempt was rejected by schema validation, causing the drafter to loop indefinitely reading the same source files ~140 times each until SIGKILL at 1800 s. Changes: - Add a CRITICAL block in the delegation section documenting the exact drafter response schema with explicit warning never to use title/body - Update step 4d (aggregate) to reference the correct field names - Update step 5 (parse drafter response) to name 'issue' and 'details' explicitly - Update step 9 (build comments) to list the correct finding fields ## Fix 2 — Lower soft chunk target 1000 → 600 lines (review-pr/action.yml) Chunk 1 of sailor PR #754 was 1229 lines of dense Rust snapshot/restore code — at the edge of what a drafter can process in one turn, amplifying the schema-loop impact. Lowering the soft target produces smaller, more manageable chunks. The 2000-line hard cap is unchanged. ## Fix 3 — Better exit-124 diagnostics (review-pr/action.yml) When the agent timed out the PR received a generic 'PR Review Failed' comment and an unhelpful step summary. Users had no idea why or what to do next. Changes: - Add a dedicated elif branch for EXIT_CODE=124 before the generic non-zero handler - Post an actionable PR comment explaining the timeout and suggesting /review retry or splitting the PR into smaller pieces - Add a TIMEOUT_NOTE variable with exit code, 1800 s limit, and verbose log artifact reference, printed in the step summary after the STATUS line
docker-agent
reviewed
May 9, 2026
Contributor
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
All three fixes look correct and address the described root causes. The schema documentation addition in pr-review.yaml is accurate and will prevent the drafter loop. The 1000→600 line chunk-size reduction is straightforward. The timeout branch logic is sound. One minor cosmetic issue noted inline.
Inside a double-quoted bash string, \' is not a valid escape sequence and produces a literal backslash. The step summary was rendering (\'some-log-file.txt\') instead of the intended (some-log-file.txt) Drop the attempted single-quote wrapping and write () directly.
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.
Summary
Three targeted fixes for the runaway-drafter timeout seen in docker/sailor PR #754.
Failing run: https://github.com/docker/sailor/actions/runs/25577728034/job/75088929732
The root cause: the drafter sub-agent looped for 1799 s re-reading the same 4 files ~140× each because its enforced
structured_outputschema rejected every emit attempt, causing the model to keep doing more file reads instead of returning results.Fix 1 — Schema mismatch in
review-pr/agents/pr-review.yamlRoot cause of the infinite loop. The root agent's
transfer_taskdelegation message did not explicitly document the drafter's enforcedstructured_outputschema field names. When the LLM generated the task string it usedtitle/body(natural GitHub review terminology) instead of the schema-requiredcategory/issue/details/in_diff. Every emit attempt was rejected by schema validation, causing the drafter to loop indefinitely reading the same source files ~140× each until SIGKILL at 1800 s.Changes:
## CRITICAL: How to delegate to the draftersection documenting the exact drafter response schema, with an explicit warning never to usetitle/bodyissueanddetailsThe drafter's
structured_outputschema itself is unchanged — it is the contract.Fix 2 — Lower soft chunk target 1000 → 600 lines (
review-pr/action.yml)Chunk 1 of sailor PR #754 was 1229 lines of dense Rust snapshot/restore code — at the edge of what a drafter can process in one turn, amplifying the schema-loop impact. Lowering the soft target produces smaller, more manageable chunks.
Fix 3 — Better exit-124 diagnostics (
review-pr/action.yml)When the agent timed out, the PR received a generic "PR Review Failed" comment and an unhelpful step summary. Users had no idea why it failed or what to do.
Changes:
elif [ "$EXIT_CODE" = "124" ]branch before the generic non-zero exit handler/reviewretry or splitting the PRTIMEOUT_NOTE(exit code 124, 1800 s limit, verbose log artifact reference) printed in the step summaryTesting
pnpm build✅ (all bundles compiled successfully)pnpm lint— Biome and tsc pass; one pre-existingactionlintwarning aboutnode24runner intest-e2e.yml(existed onmainbefore this PR)pnpm test— pre-existing DNS sandbox failure (unrelated to these changes, also reproducible onmain)