Repository navigation
feat: close session pull requests without merging - #173012
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesAdds an authorized close operation for a conversation’s recorded pull request while preserving its branch, workspace, and history. Example: An administrator decides to close the guest-created draft PR numbered 5 after inspection.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fills a concrete conversation workflow gap, and no actionable patch defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe agent tool sends session-bound intent to the Gateway publication owner, which checks current requester and publisher authority, updates the recorded GitHub PR, and returns its observed state. flowchart TD
A[Conversation requester] --> B[github_publish tool]
B --> C[Gateway publication owner]
C --> D[Session ancestry and publication receipt]
C --> E[Live requester and publisher checks]
E --> F[GitHub PR update]
F --> G[Observed PR state]
Technical reviewBest possible solution: Extend the existing Gateway publication owner with explicit closure while preserving its live authorization, target binding, and saved-work guarantees. Do we have a high-confidence way to reproduce the issue? The baseline action schema excludes close, establishing the missing capability directly from source; this is a feature extension rather than a reproduced bug. Is this the best way to solve the issue? The change uses the established publication owner and transport without introducing another credential route, arbitrary PR targeting, or a competing state store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 97d03398c3e1. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +24, Tests +77, Docs 0. Total +101 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 6:16 AM ET / 10:16 UTC. |
|
Added: authorized closure of session pull requests without merging or deleting saved work. |
Allow authorized users to close the session’s published pull request without merging or deleting saved work.
What Problem This Solves
An authorized person may decide to close a guest's draft PR after reviewing it in the original conversation. The session publication tool can inspect, mark ready, and merge the recorded PR, but has no close operation. The isolated conversation therefore cannot finish that decision through its supported GitHub path.
User Impact
A person with current full operator write access can inspect the session's publication and request
github_publishwithaction: "close", the inspectedrequestId, andexpectedHeadCommit. The PR closes without merging, and its branch, workspace, saved files, and conversation remain available. Closure also works for drafts and PRs whose conflicts prevent merging.Guest publication remains draft-only, and guest turns do not gain privileged actions after an administrator participates. The existing current-requester, publisher, publishing-child, receipt, and head checks still apply. No configuration or migration is required.
Why This Change Was Made
Closure extends the GitHub action owner introduced in #172901. It sends one update to the recorded PR and reads the same target afterward, including when the write response is lost. Repeated closure returns the observed closed state without another write; an already-merged PR is reported as merged. A rejected close produces actionable state and repository-permission guidance. The operation never marks the PR ready, merges it, enables auto-merge, or removes saved work.
The existing tool schema and canonical GitHub identity documentation expose this operation only within the established authorized workflow. No separate execution service or publication record is needed.
Evidence
The pre-change authorized tool and Gateway schemas rejected close intent. The same probe passes with this change. The initial candidate passed remote changed-file formatting/lint and all seven affected production/test type-check families. Five direct consumer test files passed all 93 cases in 154.93 seconds, including preparation and lifecycle cleanup; the registered Gateway group passed 79 cases in 134.94 seconds. These cases cover local and repository-only publication, guest denial before and after admin actions, revoked roles, changed heads/receipts, unrelated targets, lost responses, repeat closure, rejection, and preserved session and Git state.
In an isolated live conversation, the admin inspected and closed the intended draft through the native tool. Independent GitHub readback confirmed closed and unmerged state with no auto-merge; the branch retained the same head, all workspace file hashes were unchanged, and the guest could still read the saved files in the same conversation. The live PR was unmergeable, confirming that closure does not depend on merge checks.
After the prerequisite landed, a focused refresh against the current TypeBox and preserved test-mock exports passed current format/lint, all four selected compiler graphs, and 24 closure/protocol cases in 61.58 seconds. The 17-case closure suite took 55.86 seconds; the existing tool suite also passed all seven cases on this head. The remaining unaffected tests and compiler results retain their earlier proof. Range-diff confirms the closure patch is unchanged, and all three live-tested production files match this PR exactly.
Before/after captures, the continuous interaction recording, and the verified preview below show the actual same-conversation closure. Independent review found no actionable issue in the closure implementation and exact-head fixture proof. CI run 38716504786 completed in 1068 seconds: 57 jobs succeeded and 22 scope/alternate lanes were skipped. Its only failed test is the existing PR-chip E2E expectation described below; the aggregate gate also reports that failure.
The UI failure expects
#103469while the existing repository-qualified formatter returnsopenclaw/openclaw#103469. It was independently reproduced on the pre-change baseline, and this PR changes none of its producer, fixture, or assertion path. The case uses a mocked Gateway and never invokes the session GitHub action. The separate expectation repair is #172998; its failure is retained as baseline evidence rather than reported as a passing check. ClawSweeper’s exact-head review rated the change Platinum with no findings.Visual evidence
Actual admin submission, close operation and confirmed closed result
proof.mp4
Visual verification
325a62fc12dfc19e6fc849e657455b9a0f8fc116