fix: check merged bool in MergePullRequestFn #113
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/OpenSpec
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
RFC - Request For Comments
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human-required
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
agentic-forges/forgejo-mcp!113
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/113/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
MergePullRequestFndiscarded all three return values from the SDK'sMergePullRequest:The SDK returns
(bool, *Response, error)where the bool isstatusCode == 200. Any non-200 HTTP response from Forgejo — including 405 (branch protection), 409 (conflict), 403 (forbidden) — producederr == nil, causing the tool to always report "Pull request merged successfully" even when the merge didn't happen.Fix
Capture and check the bool return value. If the merge didn't return 200 and
merge_when_checks_succeedis not set, return an error with the actual HTTP status code.Discovered via
Using this tool against a repo with a branch protection rule that blocked the merge. The false positive made it impossible to diagnose why the merge wasn't landing — we only discovered the real error (
405 User not allowed to merge PR) after adding this check.