Skip to content

Handle malformed GitHub PR merge failure bodies - #1118

Merged
sidneyswift merged 1 commit into
mainfrom
codex/github-merge-parser-current-main
Oct 24, 2026
Merged

sidneyswift merged 1 commit into
mainfrom
codex/github-merge-parser-current-main

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

A rejected GitHub PR merge can return HTML, plain text, empty content or unusable JSON. The existing helper parses every failed response as JSON, so these responses can crash failure handling instead of producing a clear error.

This guards only failed-response parsing/message selection. A nonblank GitHub string message is preserved exactly; other successfully read bodies return GitHub merge failed (HTTP <status>). Network and body-read exceptions still propagate. The endpoint, token forwarding, PUT/squash request, single-request behavior and success path are unchanged. No retry, reconciliation, permission or merge-policy change is included.

The real action handler's mocked HTML-failure case confirms it reports failure without changing PR state or calling the success handler. This is the previously accepted three-file repair, composed unchanged on actual post-1117 main 0529215aa7692d6162950ae837b34a64c8e69840; relevant coding-agent source and dependency manifests have no drift from its original base.

Validation at 0aae7bb87e1790fc70e4b8d82c014f317877e1cc:

  • Actual current-base regression: 10 failures / 3 passing controls; corrected: 13 passing tests.
  • Broader coding-agent suite: 114 passing tests across 26 files, including those 13.
  • Focused production-helper TypeScript, repository lint, changed-file formatting and diff checks pass.
  • Prior static independent Standards0/Spec0 is rebound by exact accepted blobs/patch; fresh independent execution is Records-owned and remains required before coordinator merge.
  • All responses/tokens are synthetic and HTTP is mocked. No real GitHub merge, comment delivery, credential read, database/provider operation or manual deployment was performed. No whole-project typing or live behavior claim.

Refs recoupable/mono#358, recoupable/mono#318. Coordinator alone merges after exact-head checks and acceptance.


Summary by cubic

Fixes GitHub merge failure handling so a rejected PR merge returning HTML, plain text, an empty body, or malformed JSON reports a clear error instead of crashing failure reporting, since failed responses were previously parsed as JSON unconditionally. This addresses the reproduced Mono #358/#318 finding about unguarded JSON parsing.

Bug Fixes

  • mergeGithubPR preserves exact nonblank GitHub message strings; other readable bodies fall back to GitHub merge failed (HTTP <status>).
  • Network and body-read exceptions still propagate, and the success path, endpoint, token forwarding, and PUT/squash request are unchanged.
  • Adds 13 regression tests and a verification doc covering malformed bodies, exact message preservation, and unchanged error propagation.

Written for commit 0aae7bb. Summary will update on new commits.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Oct 24, 2026 5:43am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sidneyswift
sidneyswift merged commit a68c56e into main Oct 24, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — 0aae7bb8 Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant