Repository navigation
fix: restore guest message forking in the chat menu - #185486
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 changesAllows eligible guests to fork from saved user messages in their own conversations through the chat menu. Example: A guest with operator.sessions.write opens the second saved user message in an owned, settled conversation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main permission mismatch with a focused change to the existing policy adapter; no actionable defects remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe chat adapter combines connection capabilities and session ownership into menu permissions; the pane dispatches fork requests, and the Gateway independently authorizes and persists the child conversation. flowchart TD
A[Gateway scopes and session ownership] --> B[Shared session access policy]
B --> C[Chat action adapter]
C --> D[Message menu and invocation check]
D --> E[Gateway fork authorization]
E --> F[Child conversation and restored draft]
Technical reviewBest possible solution: Merge the existing two-line policy opt-in with its focused regression and documentation. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically denies the narrow guest grant at the adapter, matching the reported reproduction and inspected baseline screenshot; this review did not execute target code. Is this the best way to solve the issue? The patch is the smallest complete repair: it reuses the shared scope and ownership policy, preserves invocation-time checks, and adds no competing authorization mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 32d0945d21d2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests +21, Docs +1. Total +24 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label 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 HistoryReviewed October 27, 2026, 1:44 AM ET / 05:44 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: guest owners can fork saved messages from the chat menu under their existing session permissions. |
Restore message forking for eligible guest owners through the existing session permission policy. Fixes openclaw#185414.
Restore message forking for eligible guest owners through the existing session permission policy. Fixes #185414. (cherry picked from commit de6ac4f) Co-authored-by: RomneyDa <[email protected]>
Fixes #185414
What Problem This Solves
Guests with session read/write access cannot choose Fork from here on a persisted user message in their own settled conversation. The message menu suppresses the action even though the Gateway already supports that guest-owned fork. Users have no ordinary UI route to branch the conversation without broader access.
User Impact
Eligible guest owners can fork from a saved user message using the existing message menu. The fork keeps the preceding conversation context and restores the selected message as a draft, as the existing operation does for broader writers. Read-only and foreign-session access remain restricted, active runs keep the action disabled, and the Gateway retains its ownership, agent, runtime and sandbox checks. This change introduces no new permission, configuration option or stored representation.
Why This Change Was Made
The chat action adapter already receives the selected session row and calls the shared method-access policy. Its Stop action opts into the session-scoped grant, but its message-fork action still requires broad write access. The fix passes that existing opt-in and row for
sessions.fork; the pane already repeats the access check at invocation, so no new callback or authorization mechanism is needed.One focused regression extends the adapter's existing scope tests with owned, foreign, missing-ownership and read-only cases. The guest control documentation now names message forking. Whole-conversation forking and recovery use separate entry points and are outside this correction.
Evidence
The live baseline reproduced the missing action on the same persisted second message: the guest menu exposed Reply and Copy as markdown, while the administrator menu also exposed Fork. Neither inspection sent a fork request. The baseline served source was
22cd584794efafce3b2df2f1f41ad7a8276fd847; the relevant UI, shared scope and backend authorization/fork owners were unchanged at the repair basec8ea362fdaf94b50b5a9280d806f6b2eceada94c.Remote pre-commit validation passed on the exact committed tree: changed-file formatting/lint, the selected production and consumer type graphs, and 154 focused tests. The new adapter regression failed at the guest-owner assertion with the original producer, then passed with the fix. Its three-test file took 1.49 seconds in Vitest (3.03 seconds through the repository runner); the 151 shared-access and message-view controls passed in 11.32 seconds in Vitest. Those controls cover read-only and foreign ownership, broader writer/admin access, persisted message targeting and active-run disabling.
On exact head
029fe02b7b2d42ebaa326dac8aaf93574358289e, the same guest completed one fork through the ordinary message menu. UI and Gateway readbacks verified the guest-owned child, parent link, preceding exchange, excluded cut point and restored draft. The source conversation's returned history was unchanged. One normal continuation completed a read-only command in the expected container; Fork was disabled while that run was active. The foreign guest's menu omitted Fork and the administrator's menu retained it, with neither control sending a fork request.Hosted CI and the required exact-head gate passed. The screenshots and recording below bind the visible result to that same head. The pre-existing live foreign-session denial is applicable; a true read-only live identity was unavailable, so the read-only control is deterministic coverage. No transcript byte-equality or exhaustive sandbox-isolation claim is made.
Visual evidence
Exact-head guest message-menu fork
guest-ui-fork.webm
Visual verification
029fe02b7b2d42ebaa326dac8aaf93574358289e