Skip to content

feat: close session pull requests without merging - #173012

Merged
shakkernerd merged 1 commit into
mainfrom
feat/session-pr-closure
Oct 15, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
feat/session-pr-closure

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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_publish with action: "close", the inspected requestId, and expectedHeadCommit. 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 #103469 while the existing repository-qualified formatter returns openclaw/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

Open preview

Before After
Admin can inspect the draft but closure is unsupported The same draft is closed without merging and saved work is preserved

Actual admin submission, close operation and confirmed closed result

proof.mp4

Visual verification

  • Baseline: 489a390c925b8a2973802e50794675e8a3d25acb
  • Exact head: 325a62fc12dfc19e6fc849e657455b9a0f8fc116
  • Scenario: A currently authorized admin closes the recorded draft PR from the same guest-created conversation, preserving its branch, workspace and conversation.
  • Runtime/build: Local OCM source325a62fc, native runtime build67.087s, retained state and unchanged configuration. All three production file hashes match PR173012 source83e92346 on its landed prerequisite; runtime evidence is reused by source equivalence.
  • GitHub readback: CLOSED; merge commit and merged timestamp absent; draft retained; auto-merge absent.
  • Saved work: Branch still exists at the same commit; all three workspace files match their before hashes; same conversation remains readable.
  • Blocked merge state: PR was unmergeable with a conflict; closure correctly succeeded without marking ready or merging.
  • Capture: 1280x720 browser. Equal 770x270 still crops plus captions; continuous recording with private identifiers, model selector and unrelated sidebar removed.
  • Actual prior tool schema lacked close; candidate exposed close only to the currently authorized requester.
  • Native tool result selected the recorded session, publication request and intended head and returned closed with no merge commit.
  • Independent GitHub readback and local file hashes confirmed the result rather than relying on the agent summary.
  • Continuous source frames were compared and all distinct visual states inspected; timing preserved, final frame held for readability.
  • No configuration, permission, branch deletion, alternate credential route or conversation deletion.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds 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.

  • Before: github_publish supports inspecting, marking ready, and merging, but cannot close the PR.
  • After: action: "close" closes the inspected PR without merging or deleting saved work.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused implementation with supplied live workflow evidence, meaningful authority coverage, and no actionable findings; review-side media and historical-source limits are disclosed.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied isolated live conversation exercises administrator closure through github_publish, with inspected before/after captures and reported independent closed/unmerged readback and saved-file preservation; registered-owner coverage checks guest rejection and role revocation before writes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: An authorized operator cannot close a conversation’s published PR through its supported tool after deciding against merging.
Reason: The maintainer-authored direction fills a concrete gap with a narrow addition to the existing workflow.

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
Reviewed head: 83e92346f067f66183e654a5e8f172ec57fe6c09

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Session PR action owner and action schema keeps the original intent (bf90074: Allow current full-write operators to act on recorded session publications while preserving guest isolation and revalidating authority at external effects.)
  • Publication tool instructions and documentation keeps the original intent (bf90074: Expose privileged operations separately from guest draft publication and bind delegated actions to an explicitly selected publishing child.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Shakker: Raw commit bf90074 adds src/gateway/github-publication-actions.ts:136 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bf90074c33e2; files: src/gateway/github-publication-actions.ts)
  • Peter Steinberger: Raw commit 78d72c9 adds src/agents/tools/github-publish-tool.ts:17 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 78d72c97a85c; files: src/agents/tools/github-publish-tool.ts)

PR surface

Source +24, Tests +77, Docs 0. Total +101 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 37 13 +24
Tests 1 102 25 +77
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 141 40 +101

Review metrics

Metric Value Why it matters
Privileged action surface 1 additional action; 0 new configuration options Close reuses the existing session-bound RPC and authorization owner.

Labels

Label changes:

  • add P2: A bounded improvement to authorized conversation workflows without evidence of an urgent runtime regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A bounded improvement to authorized conversation workflows without evidence of an urgent runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 15, 2026, 6:16 AM ET / 10:16 UTC.

@shakkernerd shakkernerd self-assigned this Oct 15, 2026
@shakkernerd
shakkernerd merged commit 8331330 into main Oct 15, 2026
171 of 174 checks passed
@shakkernerd
shakkernerd deleted the feat/session-pr-closure branch October 15, 2026 10:40
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Added: authorized closure of session pull requests without merging or deleting saved work.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
Allow authorized users to close the session’s published pull request without merging or deleting saved work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant