Skip to content

feat: land session pull requests from sandboxed conversations - #172901

Merged
shakkernerd merged 3 commits into
mainfrom
feat/session-pr-landing
Oct 15, 2026
Merged

shakkernerd merged 3 commits into
mainfrom
feat/session-pr-landing

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A guest can publish a draft pull request from a sandboxed development session, but an authorized maintainer returning to that conversation cannot inspect, mark ready, or merge its recorded PR through the agent's publication tool. The existing tool only submits a publication request. This also affects delegated work: a parent conversation may have no publishable workspace of its own while its managed child owns the PR.

User Impact

A person with current full operator write access can ask the agent to inspect the session's published PR, mark the reviewed draft ready, and merge its intended commit. The agent receives the observed GitHub state after each action. For delegated work, it explicitly selects the publishing child from that conversation's descendants.

Guest turns retain the existing draft-publication schema and instructions. These actions do not change the session's sandbox, give the agent shell credentials, enable auto-merge, or grant later guest turns the maintainer's authority. Existing repository checks still govern merging, verified contributor credit is carried into squash merges, and closed or unsuccessful PRs retain their saved workspace and history. No configuration or storage migration is needed.

Why This Change Was Made

The change extends github_publish with inspect, ready, and merge actions backed by one registered Gateway operation. It reuses the publication service's completed receipt, current requester authorization, selected GitHub identity, and GitHub transport. The current requester's full-write authority controls whether the tool exposes PR actions. A managed parent without its own publishing capability exposes only the action surface to that requester; its ordinary draft publication eligibility is unchanged.

Write actions must name the inspected publication request and expected head. The Gateway checks the recorded session association and current PR head, and GitHub's merge request also carries the expected SHA. Current authority and identity are revalidated at the external effect. Explicit child selection follows retained session ancestry rather than searching repositories or accepting arbitrary PR URLs.

The operation reads the same PR after a write, including an uncertain transport response. Repeating an already completed action returns its current state without another write. It reports missing credentials, changed heads, closed PRs, and blocked repository checks rather than scheduling an autonomous landing workflow.

Evidence

The base revision's actual public tool schema rejected all three PR actions. The added integration proof enters through github_publish and the registered Gateway handler with real session, requester, and publication-store fixtures; only the external GitHub transport is synthetic. It covers local and repository workspaces, full-write and admin actors, guest denial before and after landing, exact receipt/head binding, role revocation, missing credentials, repository rejection, uncertain write responses, repeated actions, contributor credit, and explicitly selected children.

The tool-registration proof exercises the complete coding-tool policy pipeline for nonpublishing parents, including guest denial, explicit tool denial, and inherited draft publication capability. Protocol coverage rejects arbitrary target URLs, credentials, admin flags, and auto-merge arguments.

An isolated live conversation exercised guest denial after earlier admin participation, then current-admin inspection, ready, and squash merge through the tool. Independent GitHub readback confirmed that the merged tree matched the reviewed head and retained contributor credit. The fixture repository had no required CI workflow; blocked and rejected repository checks are exercised at the Gateway boundary. The revised nonpublishing parent explicitly selected its publishing child, reported a real merge conflict without writing, and completed ready/merge after the guest supplied the requested revision. A subsequent guest turn exposed only the original draft-publication schema.

Selected native results from the live conversation show two distinct boundaries. After prior admin participation and approval, before the actual merge, a guest's retained action was rejected by the server:

{"action":"inspect","error":"missing scope: operator.write"}

After the actual merge, a new guest request inspected the current tool definition. The selected schema and telemetry fields were:

{"input":"{ body?: string; title?: string }","additionalProperties":false,"callCount":0}

The latter is capability discovery with no attempted write. The registered-owner revocation case changes the real canonical operator role during the awaited read, then asserts the ready request fails and the GitHub write list remains empty. It runs through the public tool, registered Gateway dispatcher and current requester owner; the external GitHub transport is synthetic in that case. The live recording below supplies the corresponding real authorized external effect.

Remote Linux validation passed changed-file formatting/lint, affected source and consumer types, and the selected related tests. The 57 related paths have 55 passing file results and two Windows-only skips. Native CI did not select Windows; the unchanged Windows read/encoding and media file-URL paths are not claimed as executed on that platform. The corrected action fixture passed all 12 cases in 51.96 seconds; the full tool-registration suite passed 35 cases in 51.38 seconds. Six test-routing consumers also passed 652 assertions in 145.13 seconds. These are native suite wall times, including their imports and setup.

After resolving the independent method-registration conflict, the rebased candidate passed formatting/lint, selected package boundaries, six affected source/test type graphs, and all 71 assertions across the protocol, registration, publisher, action, and method-registry files (111.91 seconds for the test stage). The full-authority public tool probe admitted all three actions. CI then identified a checkpoint mock that omitted other real exports; the test-only correction preserves those exports and passed its guard, formatting/lint, test types, and all 12 action cases. Current-head independent review is clean and ClawSweeper rates the result Platinum. Hosted CI passed 74 jobs and intentionally skipped 21; its sole underlying failure is an unrelated UI chip-label expectation, reproduced unchanged on the exact CI baseline. The CI aggregate and its mirrored status retain that failure. Total CI job elapsed time was 19,845 seconds across the selected jobs. The source-qualified visual evidence below retains the actual tested lab revisions and its limits.

Visual evidence

Open preview

Before After
Admin request cannot land because supported publication operations are absent Admin request squash-merges the same reviewed work and confirms merged state

Actual admin submission and delegated PR landing in the same guest-created parent

proof-final.mp4

Visual verification

  • Baseline: 3c24a1948fa984a3ee87ab971ee81a799923b807
  • Exact head: 489a390c925b8a2973802e50794675e8a3d25acb
  • Scenario: A guest develops and updates a draft PR. A currently authorized admin lands the reviewed work in the same conversation, including an explicitly selected publishing child.
  • Runtime/build: Local OCM source build 489a390c; native runtime build 66.494s. Direct-session after capture uses preceding 064708cd with identical GitHub action owner; final recording includes the qualified actor-filtered discovery correction. Production equivalence independently reviewed against dc282ce9.
  • Direct and delegated outcomes: Both PRs merged; reviewed content and human credit independently confirmed on GitHub.
  • Guest authority: Actual inspect rejected after prior admin approval; after merging, a new guest request receives only the original draft-publication schema.
  • Capture: 1280x720 browser, equivalent 770x400 comparison crop plus caption; 800x663 recording crop plus caption. Synthetic commit identifiers and model selector redacted.
  • Repository requirements: Private fixture main had no required CI. Protected-branch enforcement is covered by owner tests, not claimed as live proof.
  • Same retained guest conversation, work and PR used before and after; content length changes with the resulting answer, not a layout comparison.
  • Continuous recording begins with the actual admin prompt and Send action and ends after merged result; all 81 captured frames inspected. Native inter-frame timing retained; final frame held for readability.
  • Selected native tool results confirm inspect, ready, merge and final inspect against the intended child/head.
  • No session elevation, alternate credential route, auto-merge, configuration change or workspace deletion occurred.
  • Private fixture URLs, source identifiers, unrelated sidebar and model UI excluded; source media retained privately.

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

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 0c49f3b92b653b349045294d3d57347eb578c211
  • Maintainer: @shakkernerd
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/methods/core-descriptors.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/session-method-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@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: L labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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

Extends github_publish with authorized inspection, readiness, and merge actions for a conversation’s recorded PR or explicitly selected descendant’s PR.

Example: An administrator returns to a guest-created conversation whose draft PR is ready to land.

  • Before: github_publish accepts only title and body, so the administrator cannot land the PR through that tool.
  • After: The administrator can inspect the publication, mark it ready, and request squash merge using its requestId and expectedHeadCommit.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused implementation with source-qualified live evidence, meaningful authority coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Source-qualified live conversation evidence and inspected before/after screenshots cover authorized inspection, readiness, and merge; native guest-denial output and the registered-owner role-revocation case cover rejection before effects. The final commit changes only the checkpoint fixture. The video could not be inspected because ffprobe was unavailable and the web fallback failed; that review-side limitation does not invalidate the remaining supplied evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Authorized operators cannot finish landing a sandboxed conversation’s published PR through its existing publication tool.
Reason: The maintainer-authored direction closes a concrete workflow gap while retaining guest draft-only behavior and repository merge requirements.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored feature fills a supported workflow gap, and the checkpoint mock correction introduces no production change or actionable defect.

Priority: P2
Reviewed head: 0c49f3b92b653b349045294d3d57347eb578c211

Before merge

None.

Findings

None.

Agent review details

How this fits together

The agent tool sends session-bound requests to the Gateway, which resolves publication receipts, checks current requester and publisher authority, calls GitHub, and returns observed PR state.

flowchart TD
  A[Conversation requester] --> B[github_publish tool]
  B --> C[Gateway action handler]
  C --> D[Session ancestry and publication receipt]
  C --> E[Current requester and publisher authority]
  E --> F[GitHub transport]
  F --> G[Observed PR state]
Loading

Technical review

Best possible solution:

Retain the existing Gateway publication owner and session-bound authority checks while adding these explicit landing operations.

Do we have a high-confidence way to reproduce the issue?

The baseline tool schema confirms the requested capability is absent; this is an intentional feature extension rather than a reproduced defect.

Is this the best way to solve the issue?

Extending the existing publication tool and Gateway transport keeps credentials and authorization with their current owners instead of exposing shell credentials or arbitrary PR targets.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b4b89d404ca4.

Provenance checked

  • Draft publication tool and continuation guidance keeps the original intent (0606e31: Provide Gateway-brokered publication without giving workers standing forge credentials; later continuation guidance distinguishes publication receipts from completed landing work.)
  • Guest requester permissions and sandbox exposure keeps the original intent (fix: enforce requester permissions for shared GitHub publication #154655: Allow creator-scoped draft publication while retaining live requester permissions and stronger workflow authority.)
  • Documentation’s publication-only boundary changes intended behavior with a stated reason (fix: expose session publication in default sandboxes #171803: Default sandbox exposure intentionally provided publication without merge capability; this maintainer-authored extension explicitly separates full-write landing from guest publication.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +458, Tests +456, Docs +6. Total +920 across 16 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 11 471 13 +458
Tests 4 458 2 +456
Docs 1 7 1 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 936 16 +920

Review metrics

Metric Value Why it matters
Privileged action surface 1 new RPC with 3 actions sessions.github.action adds inspect, ready, and merge behind full operator write authority, without adding configuration options.

Labels

Label changes:

  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P2: A useful, bounded improvement to authorized session publication 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-15T08:04:49.370Z sha dc282ce9cc4c8c70a53e04fd34e02a159e90da10 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-15T08:49:02.796Z sha 09d8ae3 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-15T09:16:09.427Z sha 0c49f3b :: needs maintainer review before merge. :: none

Reviewed October 15, 2026, 5:23 AM ET / 09:23 UTC (Revision 4).

@shakkernerd
shakkernerd force-pushed the feat/session-pr-landing branch from dc282ce to 09d8ae3 Compare October 15, 2026 08:40
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The body now includes anonymously verified before/after media and a continuous recording from the actual admin submission through delegated PR landing. Selected native results show guest inspect rejected after prior admin approval and before merge; the separate post-merge guest result exposes only title/body and records no tool call. The linked registered-owner revocation case changes the canonical role during the awaited read and asserts zero GitHub writes. All 71 focused protocol, caller, and action assertions passed on 09d8ae382e5343a41e33dd0f92f7a2e1fc97dc9f, and the method-registration conflict is resolved. Please reassess this head against the newly accessible evidence.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 15, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

CI identified that the action test's checkpoint mock omitted other module exports. The fixture now preserves the real exports and replaces only its checkpoint operation. The failed guard, formatting/lint, Gateway test types, and all 12 action cases pass. Please review 0c49f3b92b653b349045294d3d57347eb578c211; this appended commit changes only the test fixture, and the production behavior and previously inspected live evidence are unchanged.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. and removed proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 15, 2026
@shakkernerd
shakkernerd merged commit bf90074 into main Oct 15, 2026
160 of 163 checks passed
@shakkernerd
shakkernerd deleted the feat/session-pr-landing branch October 15, 2026 09:39
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Added: same-conversation PR landing for authorized maintainers while preserving guest draft-only access.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…aw#172901)

Allow currently authorized maintainers to inspect, ready, and merge a conversation's recorded pull request, including an explicitly selected publishing child. Preserve guest draft publication, sandbox isolation, and current requester authority.
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. security-sensitive-changed size: L 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