Skip to content

feat(ui): comment on file, diff, and PDF selections in chat - #180294

Draft
roboclaw-bot wants to merge 10 commits into
mainfrom
openclaw/dawn-lobster-2
Draft

roboclaw-bot wants to merge 10 commits into
mainfrom
openclaw/dawn-lobster-2

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Users cannot attach feedback to selected code or PDF text without manually copying the passage and its location into chat.

User Impact

Select code in Files or Review, or text in a PDF attachment, choose Add to chat, and leave a comment. Sending includes the selected text and its source: file path, line range and diff side for code; document name and page number for PDFs. Saving a comment neither modifies the source nor replaces the existing chat draft.

PDF comments support same-origin attachments up to 16 MiB, one page per comment. Scanned pages need OCR outside this reader. Open original PDF retains access to browser printing, search, forms and password entry. External PDFs and workspace binary-file download paths are unchanged. Selections crossing diff sides or omitted lines need separate comments; formatted Markdown previews are outside this change.

Why This Change Was Made

Reuses the existing comment editor, attachment admission, draft storage and send path. Readers supply coordinates while the current composer owns permission and delivery checks; no separate review store or API is introduced.

The native PDF iframe is replaced by a lazy, single-page PDF.js reader with a selectable text layer. PDF.js 6.4.299 is pinned; worker, fonts and decoding resources are served locally. The existing bounded fetch and byte-revalidation owner remains responsible for downloads, and unchanged ticket renewals retain page and zoom. This does not relax the Gateway CSP or enable PDF scripting/forms.

The requester approved adding PDF support to this same draft. The earlier import conflict with #179908 is resolved, preserving both the file-operation refactor and comment integration. The rotated-page selection repair is now published after a history-preserving reconciliation with the PR's newer commits. GitHub still reports conflicts with current main; this draft is not ready to merge.

Evidence

  • Baseline reproductions reached the file/native-PDF readers and failed at the missing comment action.
  • 9 bundled Chromium E2E scenarios passed: file selection, both diff revisions, PDF text/comment delivery at 0°, 90°, 180° and 270°, scanned-page notice and invalid-PDF recovery. PDF selection targets come from actual canvas ink, use a real mouse drag, and assert the outgoing quote, comment, document name and page. The send cases use the actual Gateway CSP and a real module worker, with mocked Gateway I/O. Recorded run: 32.18 seconds including the production build.
  • The 90°, 180° and 270° alignment regressions fail without the repair and pass with it; the 0° case remains green.
  • 9 PDF preview unit tests and 1 Chromium component test passed, including failed-ticket recovery and page retention across unchanged ticket renewal. The earlier 83-test focused run remains historical feature evidence, not a newly repeated run.
  • UI typecheck, targeted lint, formatting, controller guard, stylelint and diff whitespace checks passed on the candidate. Earlier i18n and docs checks remain historical evidence.
  • These checks and the P0-only independent review were completed on October 22. The published commit 2bca159 has the exact same complete source tree (4e23a113); the November 1 reconciliation changed history, not tested files. No fresh full-CI, WebKit or real-agent/model result is claimed.

Rotated PDF — Before

Before: rotated PDF selection is detached from the rendered text

Rotated PDF — After

After: rotated PDF selection follows the rendered text

The repair adds the three pinned PDF.js root-rotation transforms, rather than another geometry owner. Relative to the prior PR head: +13 production CSS lines and net +60 test/fixture lines. The existing send scenario now covers four rotations and obsolete native-iframe capture branches are removed.

PDF — Before

Before: native PDF reader without comment controls

PDF — After

After: selected PDF text with a page-numbered comment

File selection comparison and simplification notes

Before

Before: selected file code has no comment action

After

After: comment editor anchored to selected file code

The simplification pass removes the native iframe and its obsolete styles rather than retaining competing PDF renderers. Files, Review and PDF reuse one comment-staging operation. Remaining growth supplies PDF rendering/selection and locally packaged resources. Against selected base a90fc1e: production/build +1018/-59 lines; tests/fixtures +584/-56; docs +9/-2; lockfile +134. The smaller file/diff stage was already published; PDF is the explicitly approved extension of this draft.

Draft hold: the independent Auto Review completed with no P0 findings (P0-only scope; no P1–P3 verdict is claimed). Conflicts with current main remain. PR-head reconciliation completed without file conflicts. Current-main integration is still pending: the refresh action selects the recorded PR base rather than the live target-branch tip, so its already-current result does not establish conflict clearance. Full CI, WebKit and a real-agent/model roundtrip remain unverified. This is not ready to merge.

An earlier file-editor load timeout was followed by passing isolated and combined runs; no fix for that intermittent timeout is claimed. The component harness still emits existing strict-reactivity warnings, so a warning-free runtime is not claimed.

Worked on by

Work sessions

Worked on by:
- @jjjhenriksen

Co-authored-by: jjjhenriksen <[email protected]>
OpenClaw-Publication: fcf1ab3f-a8af-4032-9eaa-58cb1b182fd0
@clawsweeper

clawsweeper Bot commented Oct 22, 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 size: L labels Oct 22, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 22, 2026
Co-authored-by: jjjhenriksen <[email protected]>
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Adds editable chat comments to selected file text and Review diffs, including file paths, line ranges, and revision sides.

Example: Select return 3; on line 2 of src/retry.ts and comment “Explain this retry limit.”

  • Before: The file reader has no Add to chat action for the selection.
  • After: The existing comment editor stages the passage, comment, and source coordinates without replacing the chat draft.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The scoped implementation has no definite correctness finding, but available behavioral evidence is limited to the visible editor and reported mocked-Gateway scenarios.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored bot PR is outside the ordinary contributor proof gate; inspected screenshots demonstrate the file-reader editor, while the reported Chromium scenarios exercise composer payloads against a mocked Gateway.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Users must manually copy selected file or diff text and its location into chat to discuss a specific passage.
Reason: The maintainer-authored direction extends an established comment interaction to two relevant readers without adding configuration, a separate review store, or a new Gateway API.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it adds a useful Files/Review workflow through existing comment owners, and no definite introduced bug was found; the draft remains conflicted.

Priority: P2
Reviewed head: 9d4d4a560e9d2e5ea18c4b3b067112f9ae8a32a7

Before merge

  • Complete next step - Resolve the GitHub-reported conflicts with main while preserving selection coordinates and the existing draft lifecycle.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not establish WebKit selection/editor behavior or completed delivery through a real Gateway; browser payload assertions use a mocked Gateway.
Agent review details

How this fits together

Files and Review provide selected text and coordinates to the shared comment editor; the existing composer admits, stores, edits, and sends the resulting attachment.

flowchart LR
  A[File source reader] --> C[Selection coordinates]
  B[Review diff] --> C
  C --> D[Shared comment editor]
  D --> E[Composer attachments]
  E --> F[Existing chat send path]
Loading

Technical review

Best possible solution:

Keep source-coordinate extraction in the readers and continue using the existing comment editor, attachment storage, and composer delivery owners.

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

This is a feature addition; current-main source and the inspected baseline screenshot independently establish the missing file-selection action.

Is this the best way to solve the issue?

The implementation uses the existing owners and adds only the coordinate extraction, lifecycle checks, and optional annotation metadata needed for the requested workflow.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced implementation: The pinned introduction adds one staging operation shared by Files and Review, reuses attachment admission, and checks current source, session, client, and composer permission before staging. (ui/src/pages/chat/components/chat-file-comment.ts:38, 9d4d4a560e9d)
  • Current-main feature boundary: Current-main file readers support selection tracking but do not expose the new comment-selection callback; scoped history searches found no equivalent Files/Review staging implementation. (ui/src/pages/chat/components/file-editor-view.ts:50, 433146c1bdf4)
  • Inspected visual evidence: Both downloaded screenshots were inspected: the baseline shows selected file code without the action, and the after image shows the shared comment editor anchored to that passage while the existing draft remains visible. (ui/src/e2e/chat-file-comments.e2e.test.ts:45, 9d4d4a560e9d)
  • Draft and merge state: GitHub confirms the reviewed head is draft with mergeable=false and mergeable_state=dirty. (9d4d4a560e9d)
  • Validation coverage: The added browser scenarios inspect actual composer requests against a mocked Gateway; current-head checks contain automation and supply-chain results, without a substantive UI test result. (ui/src/e2e/chat-file-comments.e2e.test.ts:79, 9d4d4a560e9d)
  • Existing-state compatibility: File coordinates are optional annotation metadata; existing draft hydration retains attachment blobs, and both the metadata reader and sent-comment parser preserve the previous annotation shape without a storage-version change or rewrite. (ui/src/lib/chat/selection-annotation.ts:22, 9d4d4a560e9d)

Likely related people:

  • Patrick Erichsen: Raw commit 740b1f1 adds ui/src/pages/chat/components/chat-selection-attachment.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 740b1f14fdba; files: ui/src/pages/chat/components/chat-selection-attachment.ts)

PR surface

Source +373, Tests +278, Docs +7. Total +658 across 21 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 16 402 29 +373
Tests 4 278 0 +278
Docs 1 8 1 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 688 30 +658

Labels

Label changes:

  • add P2: This is a useful, bounded improvement to reviewing code in chat, without evidence of an urgent existing-user regression.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a useful, bounded improvement to reviewing code in chat, without evidence of an urgent existing-user regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Validate file and diff selection comments on WebKit, including saving and reopening a staged comment.

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 22, 2026, 12:41 AM ET / 04:41 UTC.

Worked on by:
- @jjjhenriksen

Co-authored-by: jjjhenriksen <[email protected]>
OpenClaw-Publication: 20b73957-5952-4188-9b2e-4ac96b55539a
@roboclaw-bot roboclaw-bot changed the title feat(ui): comment on file and diff selections in chat feat(ui): comment on file, diff, and PDF selections in chat Oct 22, 2026
@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 22, 2026

@vyctorbrzezowski vyctorbrzezowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 1 actionable issue(s) in the reviewed diff; details are attached to the relevant code.

Automated code review complete. Final product and design review will be handled by the responsible maintainer before the PR is considered for merge.

word-spacing: normal;
text-size-adjust: none;
forced-color-adjust: none;
transform-origin: 0 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Apply PDF.js page rotation to the text layer

For a PDF page whose /Rotate entry is 90, 180, or 270, the canvas honors the page rotation through getViewport(), but the selectable text does not. PDF.js 6.4.299 builds TextLayer in the unrotated page coordinate system and sets data-main-rotation on its container; its viewer stylesheet supplies the matching rotate/translate transforms. This stylesheet copies the text-layer geometry rules without those transforms, and the component does not apply them elsewhere. Consequently the invisible selection targets and comment highlight are displaced from the visible text (and can be clipped on quarter-turn pages), so dragging over the displayed passage cannot reliably select it for a comment. Add the scoped data-main-rotation transforms from the pinned PDF.js contract, and cover a page with an intrinsic rotation. The matching transforms are in the pinned PDF.js viewer stylesheet.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​pdfjs-dist@​6.4.29995100829470

View full report

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Priority Alert  (click "▶" to expand/collapse) Action
Medium priority
Obfuscated code: npm pdfjs-dist is 78.0% likely obfuscated

Confidence: 0.78

Location: Package overview

From: pnpm-lock.yaml → npm/[email protected]

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@vyctorbrzezowski vyctorbrzezowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the base integration at 20ac2fa8aa4a. The previously reported issue still applies; no additional issue was found in the integration.

Automated code review complete. Final product and design review will be handled by the responsible maintainer before the PR is considered for merge.

Co-authored-by: jjjhenriksen <[email protected]>
obviyus added a commit that referenced this pull request Oct 29, 2026
…hers push (#187465)

## What Problem This Solves

Fixes: after anyone else pushes to a PR that an agent session published through the managed publisher (for example `roboclaw-bot`), that session can never update the PR again.

Publishing correctly refuses to overwrite the other commits (`push_rejected`). But the documented recovery, `prepare_pr`, refused twice:

1. **Author check.** `prepare_pr` only accepts PRs authored by the requester's own linked GitHub account. A PR the session published is authored by the publisher bot, so the session that created the PR was refused like a stranger: "This PR is not authored by a GitHub account linked to you."
2. **Clean-workspace check.** The first `prepare_pr` in a session treats the PR as a fresh import and requires a clean workspace. The publishing session always has its own published commits and usually the unpublished fix it is trying to push.

Real case: #180294 on the team Gateway. A maintainer pushed 3 commits to the PR branch. The session's next fix failed with `push_rejected` 3 times over a week, and every `prepare_pr` attempt was refused. The agents then suggested reassigning session ownership, which cannot help (see below).

## Why This Change Was Made

`inspectOwnGitHubPullRequest` is the one owner of "may this conversation act on this PR". It now also reads the conversation's latest published record. It admits the PR author when that record names this exact PR URL and the PR author is the publisher account recorded for it. A bot-authored PR from another conversation is still refused.

`prepare_pr` then treats the head this conversation last published as the already-prepared head. It uses the existing advanced-head path: save the workspace, merge the newer head, return conflicts. It does not use the first-import path that demands a clean workspace. The next ordinary publication appends to the same PR as a fast-forward. No new action, state or config.

Also:
- The `push_rejected` next step now tells the agent to call `prepare_pr` for its own PR, not "apply the changes on top of that head" (which no tool could do).
- The owner-only `prepare_pr` error now says it means the person who started the conversation. Reassigning the session owner does not transfer this; [multi-user](https://docs.openclaw.ai/concepts/multi-user) documents that reassignment keeps authority with the creator, and any agent turn can reassign. This check is unchanged on purpose; only the wording changed, because "owner" sent agents into an ownership-transfer loop.
- Docs and the `prepare_pr` tool description state the new path.

## User Impact

A session whose bot-published PR was updated by someone else can recover with `prepare_pr` and then publish to the same PR, keeping its saved work. Previously the only way out was a replacement PR or manual Git work by an operator.

## Evidence

- **Production trace:** team Gateway, session for #180294. Publication records show 2 published updates by `roboclaw-bot` (account 309084314) to that PR URL, then 3 `push_rejected` failures. The PR's head moved because of 3 maintainer commits. Each `prepare_pr` call failed, either on the author check or on the creator check after an ownership reassignment.
- **Red then green through the agent tool and Gateway** (`src/gateway/github-pr-workspace-refresh.test.ts`, "merges another writer's commits into this session's own bot-published PR"):
  - The session publishes a PR as the publisher bot.
  - A maintainer appends a commit to that branch.
  - The session has an unpublished edit.
  - `prepare_pr` runs, then publish.
  - `main`: **failed**, with the production error "This PR is not authored by a GitHub account linked to you…".
  - This branch: **passed**. The maintainer's file is merged and the unpublished fix is kept. Publish sends one fast-forward push leased on the maintainer's head, to the same PR, and that push contains both.
- **Authority is still enforced at both effects** (same file, real `prepare_pr` and publication entry points):
  - A bot-authored PR this session did not publish is refused; no binding is written.
  - A revoked requester is refused before the newer head is accepted. The workspace HEAD, files and binding are unchanged, with no GitHub writes.
  - A requester revoked after a successful `prepare_pr` is refused at publication ("no longer authorized"), with zero pushes; the PR branch stays at the maintainer's head.
  - Reassigning the session owner still does not grant `prepare_pr`; the creator check is unchanged and covered by the existing adoption suite.
- **Also new:** a bot-authored PR this session did not publish is still refused, and an unchanged own PR after the base advanced prepares cleanly (it fetches the newer base and writes the binding).
- **Related suites:** 160 tests across preparation, refresh, inspect, existing-PR publication, publication actions, base refresh, imported actions, PR workspace adoption, and the `github_publish` tool all pass. The one failure in the first run was a test asserting the old owner-check wording, now updated. `pnpm test src/gateway/github-pr-workspace-refresh.test.ts --maxWorkers=1`: 16 passed, 71 s wall. GitHub transport is synthetic in these tests (real Gateway, Git, session and publication owners); no live GitHub run.
- `pnpm check:changed` passes (format, typecheck, lint, guards) with the dead-export scan skipped; that scan fails on files this PR does not touch, which are already on `main`.

No overlap with Pash/Sarah changes.

**Merge danger:** two-way door. No schema, config or stored-state change; a revert restores the old refusals. **Blast radius:** `prepare_pr`, `inspect_pr`, and publication to a prepared PR, for sessions with a published PR. If the new check were wrong, a session could merge and push to a PR whose author matches its own recorded publisher account. The URL and account must both match this conversation's own publication record, and the existing publisher write-access and remote-head checks still run before any push.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
…hers push (openclaw#187465)

## What Problem This Solves

Fixes: after anyone else pushes to a PR that an agent session published through the managed publisher (for example `roboclaw-bot`), that session can never update the PR again.

Publishing correctly refuses to overwrite the other commits (`push_rejected`). But the documented recovery, `prepare_pr`, refused twice:

1. **Author check.** `prepare_pr` only accepts PRs authored by the requester's own linked GitHub account. A PR the session published is authored by the publisher bot, so the session that created the PR was refused like a stranger: "This PR is not authored by a GitHub account linked to you."
2. **Clean-workspace check.** The first `prepare_pr` in a session treats the PR as a fresh import and requires a clean workspace. The publishing session always has its own published commits and usually the unpublished fix it is trying to push.

Real case: openclaw#180294 on the team Gateway. A maintainer pushed 3 commits to the PR branch. The session's next fix failed with `push_rejected` 3 times over a week, and every `prepare_pr` attempt was refused. The agents then suggested reassigning session ownership, which cannot help (see below).

## Why This Change Was Made

`inspectOwnGitHubPullRequest` is the one owner of "may this conversation act on this PR". It now also reads the conversation's latest published record. It admits the PR author when that record names this exact PR URL and the PR author is the publisher account recorded for it. A bot-authored PR from another conversation is still refused.

`prepare_pr` then treats the head this conversation last published as the already-prepared head. It uses the existing advanced-head path: save the workspace, merge the newer head, return conflicts. It does not use the first-import path that demands a clean workspace. The next ordinary publication appends to the same PR as a fast-forward. No new action, state or config.

Also:
- The `push_rejected` next step now tells the agent to call `prepare_pr` for its own PR, not "apply the changes on top of that head" (which no tool could do).
- The owner-only `prepare_pr` error now says it means the person who started the conversation. Reassigning the session owner does not transfer this; [multi-user](https://docs.openclaw.ai/concepts/multi-user) documents that reassignment keeps authority with the creator, and any agent turn can reassign. This check is unchanged on purpose; only the wording changed, because "owner" sent agents into an ownership-transfer loop.
- Docs and the `prepare_pr` tool description state the new path.

## User Impact

A session whose bot-published PR was updated by someone else can recover with `prepare_pr` and then publish to the same PR, keeping its saved work. Previously the only way out was a replacement PR or manual Git work by an operator.

## Evidence

- **Production trace:** team Gateway, session for openclaw#180294. Publication records show 2 published updates by `roboclaw-bot` (account 309084314) to that PR URL, then 3 `push_rejected` failures. The PR's head moved because of 3 maintainer commits. Each `prepare_pr` call failed, either on the author check or on the creator check after an ownership reassignment.
- **Red then green through the agent tool and Gateway** (`src/gateway/github-pr-workspace-refresh.test.ts`, "merges another writer's commits into this session's own bot-published PR"):
  - The session publishes a PR as the publisher bot.
  - A maintainer appends a commit to that branch.
  - The session has an unpublished edit.
  - `prepare_pr` runs, then publish.
  - `main`: **failed**, with the production error "This PR is not authored by a GitHub account linked to you…".
  - This branch: **passed**. The maintainer's file is merged and the unpublished fix is kept. Publish sends one fast-forward push leased on the maintainer's head, to the same PR, and that push contains both.
- **Authority is still enforced at both effects** (same file, real `prepare_pr` and publication entry points):
  - A bot-authored PR this session did not publish is refused; no binding is written.
  - A revoked requester is refused before the newer head is accepted. The workspace HEAD, files and binding are unchanged, with no GitHub writes.
  - A requester revoked after a successful `prepare_pr` is refused at publication ("no longer authorized"), with zero pushes; the PR branch stays at the maintainer's head.
  - Reassigning the session owner still does not grant `prepare_pr`; the creator check is unchanged and covered by the existing adoption suite.
- **Also new:** a bot-authored PR this session did not publish is still refused, and an unchanged own PR after the base advanced prepares cleanly (it fetches the newer base and writes the binding).
- **Related suites:** 160 tests across preparation, refresh, inspect, existing-PR publication, publication actions, base refresh, imported actions, PR workspace adoption, and the `github_publish` tool all pass. The one failure in the first run was a test asserting the old owner-check wording, now updated. `pnpm test src/gateway/github-pr-workspace-refresh.test.ts --maxWorkers=1`: 16 passed, 71 s wall. GitHub transport is synthetic in these tests (real Gateway, Git, session and publication owners); no live GitHub run.
- `pnpm check:changed` passes (format, typecheck, lint, guards) with the dead-export scan skipped; that scan fails on files this PR does not touch, which are already on `main`.

No overlap with Pash/Sarah changes.

**Merge danger:** two-way door. No schema, config or stored-state change; a revert restores the old refusals. **Blast radius:** `prepare_pr`, `inspect_pr`, and publication to a prepared PR, for sessions with a published PR. If the new check were wrong, a session could merge and push to a PR whose author matches its own recorded publisher account. The URL and account must both match this conversation's own publication record, and the existing publisher write-access and remote-head checks still run before any push.

Co-authored-by: Ayaan Zaidi <[email protected]>
roboclaw-bot and others added 3 commits November 1, 2026 08:22
Co-authored-by: jjjhenriksen <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
Co-authored-by: jalehman <[email protected]>
Co-authored-by: jjjhenriksen <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
Co-authored-by: jalehman <[email protected]>
Worked on by:
- @jjjhenriksen
- @obviyus
- @shakkernerd
- @jalehman

Co-authored-by: jjjhenriksen <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: 34381022-b671-48b7-a4c1-3a374159ad6a

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants