Repository navigation
Stop Codex resume retries after invalid request-body rejection - #66553
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed for PR #66553: no 'implementation' label (has_implementation_label=false) and 0 added lines in business logic directories (threshold 100, no custom .design-gate.yml). Only 2 files changed.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused changes satisfy the retry and reporting requirements, with regression coverage and no unresolved findings.
Review effort: Balanced
Findings: None
What changed in this PR
Addresses #66490 by stopping Codex retries after deterministic request-body rejections and reporting the cause.
Changes:
- Recognizes
invalid_request_bodyin structured failure events and emitsreport_incomplete. - Adds regression coverage for stdout/stderr resume failures and excludes transcript mentions from classification.
| File | Description |
|---|---|
actions/setup/js/codex_harness.test.cjs |
Tests retry termination, diagnostics, and classification boundaries. |
actions/setup/js/codex_harness.cjs |
Detects request-body rejections, stops retries, and reports the cause. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Verdict
No blocking issues in the changed lines.
Reviewed scope
I checked the retry classification change in actions/setup/js/codex_harness.cjs and the added regression coverage in actions/setup/js/codex_harness.test.cjs. The new handling stays scoped to structured turn.failed events, preserves the existing unsupported-model special case ordering, and adds coverage for the observed stdout/stderr resume failure shape without broadening transcript-based false positives.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 35.9 AIC · ⌖ 5.3 AIC · ⊞ 19.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd — this is a tight, well-targeted fix with strong regression coverage. Approving with one minor suggestion.
📋 Key Themes & Highlights
Key Themes
- Root cause correctly addressed: the pattern now recognizes
invalid_request_body(not justinvalid_request_error), and the refactor from boolean to code-extraction (extractInvalidRequestErrorCode) is a clean way to carry the matched reason into both the log line and the newreport_incompletediagnostic. - Minor seam gap:
extractInvalidRequestErrorCodeisn't exported alongsideisInvalidRequestError, so it can only be unit-tested indirectly (see inline comment).
Positive Highlights
- ✅ Regression test reproduces the exact observed failure (nested JSON item-ID rejection) on both
stdoutandstderrviait.each, matching the bug report precisely. - ✅ New test asserts the harness does not replay the resumed session (
callslength stays at 2) and that the diagnostic text ends up inreport_incompletedetails — verifying both the retry-stop behavior and the improved failure reporting called out in the PR description. - ✅ Existing negative-case tests were extended to cover
invalid_request_bodyappearing in transcript/tool-output noise, preserving the "ignore transcript mentions" guarantee. - ✅ Doc comments above the pattern and function were updated to reflect the new scope.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 120.4 AIC · ⌖ 14.5 AIC · ⊞ 10.1K
Comment /matt to run again
| * @param {string} output | ||
| * @returns {string | null} | ||
| */ | ||
| function extractInvalidRequestErrorCode(output) { |
There was a problem hiding this comment.
[/codebase-design] Nice extraction — extractInvalidRequestErrorCode gives the caller the matched code for richer diagnostics, which is exactly why this refactor was worth doing. One small seam gap: it isn't added to module.exports (compare the sibling isInvalidRequestError a few lines below), so the new test file can only exercise it indirectly through isInvalidRequestError and the full harness fixture.
💡 Why this matters
Exporting it would let a focused unit test assert the exact returned code string (invalid_request_error vs invalid_request_body) without needing a full turn.failed JSON fixture and process spawn, improving navigability for the next person who extends this pattern (e.g. adding another invalid_request_* variant).
module.exports = {
...
isInvalidRequestError,
extractInvalidRequestErrorCode, // add this
...
};@copilot please address this.
There was a problem hiding this comment.
Exported extractInvalidRequestErrorCode and added direct assertions for both returned codes and transcript-only content in actions/setup/js/codex_harness.test.cjs. Commit: a567b9f.
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: aa98660
|
…p-codex-resume-retries Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
* Initial plan * Stop Codex resume retries on deterministic request-body rejection Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Export Codex request error code helper Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…66554) * Initial plan * Align nine workflow tool permissions and warn on denied prompt tools Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * docs(adr): add draft ADR-66554 for advisory prompt tool validation * Classify stalled Codex MCP calls as transport wedges (#66303) Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> * Stop Codex resume retries after invalid request-body rejection (#66553) * Initial plan * Stop Codex resume retries on deterministic request-body rejection Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Export Codex request error code helper Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> * Blog Auditor: add agentic-workflows MCP tool for snippet validation (#66560) * Initial plan * Apply remaining changes Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> * Fix prompt tool validation review findings Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> * Address follow-up prompt validation findings Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |
Codex resume attempts can repeatedly submit invalid item IDs, exhausting retries on the same
invalid_request_bodyrejection and producing a generic driver-failure report.invalid_request_bodyin structuredturn.failedevents and stop replaying the rejected session, preserving the nonzero exit.report_incompletedetails naming the request-body rejection and explaining why retries stopped.