Skip to content

fix: enable Guest session creation and controls - #155565

Merged
shakkernerd merged 2 commits into
mainfrom
fix/guest-session-controls
Sep 23, 2026
Merged

shakkernerd merged 2 commits into
mainfrom
fix/guest-session-controls

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Guests with operator.sessions.write can create and operate their own sessions on the Gateway, but the Control UI still requires broad write access at several entry points. New Session stays disabled, and owned conversations cannot use Stop or their safe model and permission controls.

This PR connects those browser actions to the existing narrow session contract. It builds on the landed session-access prerequisite #155184, model discovery #154839, and common model policy #156346.

User Impact

Session writers can open New Session from the sidebar, keyboard shortcut, or native shell, submit its first message once, and continue the resulting owned conversation. Accepted and rejected first turns keep the existing handoff while the canonical session row arrives. A rejected first message remains retryable in the session already created.

Owned conversations gain Stop and the allowed model, effort, fast-mode, and non-full permission choices. Other people's visible sessions remain view-only. Full access, sandbox changes, changing an existing session’s context window, board reset, sharing changes, deletion, and direct publication keep their existing permissions.

Why This Change Was Made

The UI's shared session access helper required an existing owned row even for creation. Explicit creation callers now use the narrow scope, with a creation-only exception to that row requirement; the Gateway still assigns and validates the new owner. The shared scope classifier and broad-write helper are unchanged.

Stop and settings callbacks also check their current authority and original target. The browser client retires a previous connection’s recovery identity before publishing a newly accepted hello, so a queued Stop cannot inherit another principal’s identity while recovery is pending. A retained Stop cannot switch from run A to replacement work, and reconnect replay waits for the captured session's row when necessary. Queued settings recheck the grant and session identity before dispatch, so an old selection cannot carry permission across revocation or session replacement.

The settings owner also resolves an agent-scoped global alias to its canonical ownership row before accepting or replaying a selection. This keeps allowed model, effort, and fast-mode changes working for the correct agent and prevents another agent’s global row from supplying that decision. Integration retains the current selected-session incarnation checks, stable New Session callback, and run-bound Stop response handling.

Evidence

Current source: 5c523dee54adf7da5de236a23f6f331f4c3d1c6c, on the actual session-access squash 282fc78eaf64208d6b6db70c56557ca24fc29097 in main. The two browser commits remain patch-equivalent to tested 189048f; all 39 contribution files and the relevant scenario, harness, dependency, wire, and authority inputs remain unchanged. The intervening main changes were checked against the final composition.

The original unchanged browser baseline kept both creation controls disabled for narrow session grants and emitted zero create requests after a forced click. The original owner regressions failed before the fix, including stale recovery identity. A controlled comparison also reproduces the owned-global-alias failure and wrong-agent model-row selection, while the viewer-denial control passes. All three cases pass with the corrected owner.

Retained scoped proof covers all 18 changed test files: 762 passing cases, plus 138 additional settings, recovery, and first-turn cases without duplicate counting. The recorded integration source 189048f additionally passes all 142 selected integration cases, including both Guest browser scenarios, shell entry points, fresh-roster submission, composer restoration, outbox state, textarea sizing, and transcript commit/scroll boundaries. Unchanged authorization and Stop/settings proof is retained with its original source identities. The Guest flow covers accepted and rejected first-turn handoff, a filtered catalog, delayed ownership, one atomic create, retry in the created session, continued sending, allowed controls, and permission loss. It queues Stop offline, switches to Research, reconnects with a Research-only roster, and verifies exactly one abort for the original run before returning to its canonical route.

Integration preserved current session-incarnation and Stop-response contracts. The locked-model fixture now supplies the routing facts sent by a real Hello and lives with the focused settings tests; its false-result and zero-request assertions remain strict. The Stop fixture describes both lifecycle operations it already exercises. Production code is unchanged by these fixture corrections.

The full contribution review and independent final-main source review are clean. All ten final changed-path preflight categories pass in 25.766 seconds. On recorded source 189048f, UI production types, all four UI test graphs plus shared extension declarations, and type-aware/style checks pass. CI 35868166647 is green on that exact complete tree. Its completed ClawSweeper review is Platinum overall and patch quality, with Diamond proof and no code or security findings. The source comparison preserves those execution identities; hosted CI and automated review track the current published head separately.

Both accepted/rejected Guest scenarios pass on recorded 189048f. The recording below preserves that execution identity and remains applicable after the final source comparison; all 362 raw frames and all nine final caption windows were inspected.

Measured cost of changed test files

Single-worker command wall time includes runner startup and any UI build, excluding source sync and dependency setup, on 4 CPUs and 15.42 GiB. The app-host and Guest measurements are from 189048f; unchanged files retain their qualified earlier execution measurements. The maintained node scripts/run-vitest.mjs <file> --maxWorkers=1 entry point was used, with the UI E2E config for browser files. Current CI seconds are native full-file Vitest durations from run 35868166647, on the exact current tree. Job setup and overlapping work are not summed.

File under ui/src/ Cases Command wall seconds CI seconds
api/gateway.node.test.ts 91 11.607 4.183
app/app-host-native-shell.test.ts 53 4.289 0.201
components/keyboard-shortcuts-dialog.test.ts 6 3.690 0.845
e2e/chat-flow.models-reasoning.e2e.test.ts 12 43.738 26.800
e2e/chat-model-controls.e2e.test.ts 13 85.295 49.756
e2e/guest-session-controls.e2e.test.ts 2 37.244 10.824
e2e/session-management.operator-scopes.e2e.test.ts 4 40.548 9.045
lib/session-method-access.test.ts 20 2.747 0.017
pages/chat/chat-commands.test.ts 32 6.577 0.112
pages/chat/chat-pane-connection-lifecycle.test.ts 20 11.092 0.393
pages/chat/chat-pane-session-access.test.ts 10 5.709 0.235
pages/chat/chat-pane-session-controls.permissions.test.ts 17 5.262 0.415
pages/chat/chat-pane-session-controls.test.ts 24 5.355 0.405
pages/chat/chat-pane-stop.test.ts 28 6.787 0.268
pages/chat/chat-send-abort.test.ts 19 4.218 0.050
pages/chat/chat-send-settings.test.ts 4 3.483 0.153
pages/chat/chat-view.test.ts 364 17.025 18.145
pages/chat/run-lifecycle.abort.test.ts 43 2.605 0.050

Visual evidence

Open preview

Before After
Guest draft with Start session and sidebar New Session disabled The same Guest draft with Start session and sidebar New Session enabled

Guest creation, controls and cross-agent reconnect Stop, annotated at half speed

proof.mp4

Visual verification

  • Baseline: feaebbc (preserved pre-change browser source)
  • Exact head: 5c523dee54adf7da5de236a23f6f331f4c3d1c6c
  • Scenario: Create an owned session with narrow session grants, preserve its first turn, use allowed model and effort choices, and Stop the captured run after reconnect. Foreign sessions and revoked grants remain read-only while connected.
  • Runtime/build: Recorded Control UI head 189048f068dfb41d66620b3b69c79fdda12e0fbd, tree 01c651484b53d2fa32c809895b3441ffda62f407; Node 24.19.0, Chromium 144.0.7559.0 and Playwright 1.63.0 on Blacksmith Testbox. Final head 5c523de preserves all browser contribution and scenario inputs after replay onto the landed prerequisite; the intervening main changes were source-qualified.
  • Before: Both creation controls disabled; forced click sends zero create requests.
  • After: Both creation controls enabled; the browser flow sends one atomic create and no duplicate first chat.send.
  • Scope boundaries: Allowed own-session controls work; full permission, existing-session context changes, foreign sessions and revoked writes remain guarded.
  • Reconnect target: One abort for the original owned run while the Research session is selected.
  • The matched before/after screenshots use the same 1280×900 light viewport, Guest fixture, model and draft text. They retain their original capture identities; current creation gates, renderer, styles and depicted inputs were source-qualified for reuse.
  • Both accepted/rejected Guest scenarios pass on recorded head 189048f, including a filtered Research roster, canonical return, exactly one Stop for the captured run, and permission loss. Its 142 passing integration cases remain applicable to the final main composition after the unchanged-input comparison.
  • The fresh raw recording contains 362 inspected frames. Its initial 1.36 seconds of loading are removed, then the remaining 13.12 seconds are shown at half speed with a separate 120-pixel caption band below the unchanged 1280×900 UI.
  • All nine caption and state windows and their transitions were inspected in the 26.240-second, 656-frame output. The final frame shows access denial and disabled controls while the connection footer still reports recovery; completed background recovery is not claimed.
  • Screenshots and recordings use synthetic data. Request counts and exact run identity are established by the scenario assertions; failed setup and diagnostic videos are excluded.

@clawsweeper

clawsweeper Bot commented Sep 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 gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Sep 22, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 10:15 AM ET / 14:15 UTC (Revision 9).

ClawSweeper review

What this changes

Enables Guest session creation and permitted conversation controls while binding queued settings and Stop actions to their original session and current access.

Merge readiness

✅ Ready for maintainer review

The browser fix remains necessary. The previous integration blocker is resolved, and this review found no actionable correctness or security defects.

Priority: P2
Reviewed head: 5c523dee54adf7da5de236a23f6f331f4c3d1c6c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent repair with strong retained browser evidence and targeted authority regressions; no actionable findings remain.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): Retained production-browser evidence exercises Guest creation, first-turn handoff, controls and reconnect Stop through the maintained synthetic Gateway boundary, including foreign and revoked access. Relevant UI and harness inputs remain unchanged from recorded source 189048f; screenshots were inspected, while video playback was unavailable to this reviewer. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): Retained production-browser evidence exercises Guest creation, first-turn handoff, controls and reconnect Stop through the maintained synthetic Gateway boundary, including foreign and revoked access. Relevant UI and harness inputs remain unchanged from recorded source 189048f; screenshots were inspected, while video playback was unavailable to this reviewer. No stored-data contract changes.
Evidence reviewed 9 items Current main still needs the browser fix: The fetched main revision still calls the creation access helper without opting into session-scoped authority. The merged prerequisites provide authorization and discovery, but do not enable this browser entry point.
Prior integration blocker resolved: The test merge records the pinned base followed by the exact PR head. Its tree and the reviewed head both equal 85f57993747d55c46d436c9ccc807426c77f4904. Live REST metadata also reports the pinned head as mergeable; ordinary merge gates remain separate.
Narrow creation permission: Only sessions.create bypasses the existing-row requirement. Scope checks and privileged-parameter classification remain shared with the established session policy.
Findings None None.
Security None None.

How this fits together

The Control UI translates authenticated users’ session actions into Gateway requests. It uses negotiated scopes and session ownership to enable controls, while the Gateway remains responsible for authoritative authorization.

flowchart TD
  A[Authenticated Guest] --> B[Control UI session controls]
  C[Current scopes and ownership] --> B
  B --> D[Capture session and run target]
  D --> E[Recheck after reconnect or queue]
  E --> F[Gateway authorization]
  F --> G[Create session or apply action]
  E --> H[Reject stale or unauthorized intent]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +196, Tests +837, Docs +7. Total +1040 across 39 files.

View PR surface stats
Area Files Added Removed Net
Source 20 345 149 +196
Tests 18 1084 247 +837
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 39 1436 396 +1040

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +196 lines; tests net +837 lines Production growth is explained by captured-target and dispatch-time access checks, with regression coverage for stale authority and session replacement.

Technical review

Best possible solution:

Keep the Control UI aligned with the existing Gateway session contract, preserving current-authority checks and exact session/run targeting.

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

Yes, from source: current main requires broad write authority at Guest creation entry points despite the Gateway’s established session-write contract. No local runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes. The patch extends existing access, settings-queue and cancellation owners without introducing another permission policy or changing persisted formats.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repairs a bounded mismatch between Guest session permissions and Control UI controls.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Retained production-browser evidence exercises Guest creation, first-turn handoff, controls and reconnect Stop through the maintained synthetic Gateway boundary, including foreign and revoked access. Relevant UI and harness inputs remain unchanged from recorded source 189048f; screenshots were inspected, while video playback was unavailable to this reviewer. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained production-browser evidence exercises Guest creation, first-turn handoff, controls and reconnect Stop through the maintained synthetic Gateway boundary, including foreign and revoked access. Relevant UI and harness inputs remain unchanged from recorded source 189048f; screenshots were inspected, while video playback was unavailable to this reviewer. No stored-data contract changes.

Evidence

What I checked:

  • Current main still needs the browser fix: The fetched main revision still calls the creation access helper without opting into session-scoped authority. The merged prerequisites provide authorization and discovery, but do not enable this browser entry point. (ui/src/app/app-shell-new-session.ts:33, 9db35b751469)
  • Prior integration blocker resolved: The test merge records the pinned base followed by the exact PR head. Its tree and the reviewed head both equal 85f57993747d55c46d436c9ccc807426c77f4904. Live REST metadata also reports the pinned head as mergeable; ordinary merge gates remain separate. (6b2fff5791dc)
  • Narrow creation permission: Only sessions.create bypasses the existing-row requirement. Scope checks and privileged-parameter classification remain shared with the established session policy. (ui/src/lib/session-method-access.ts:82, 5c523dee54ad)
  • Queued authority and target checks: Settings recheck access after the shared settings queue; Stop replay checks recovery identity, ownership, deletion and session incarnation before issuing the captured run request. Gateway mutation and cancellation handlers independently retain current-authority checks. (ui/src/pages/chat/run-lifecycle.ts:313, 5c523dee54ad)
  • Recorded browser boundary proof: The supplied body records production Control UI execution in Chromium with the maintained synthetic Gateway: accepted and rejected first turns, one creation request, delayed ownership, permitted settings, foreign-session denial, permission loss and an exact-run reconnect Stop. The inspected scenario asserts requests as well as visible states; it does not claim live provider execution. (ui/src/e2e/guest-session-controls.e2e.test.ts:43, 5c523dee54ad)
  • Retained execution identity: GitHub confirms that CI run 35868166647 completed successfully on recorded source 189048f068dfb41d66620b3b69c79fdda12e0fbd. Read-only GitHub tree comparisons found identical blobs for all 38 contributed UI files, unchanged dependency manifests and shared scope code, and unchanged browser harness files. This supports reuse without claiming execution on the new SHA. (189048f068df)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (8 earlier review cycles)
  • reviewed 2026-09-22T09:02:12.428Z sha f3e080c :: blocked before merge. :: none
  • reviewed 2026-09-22T09:12:06.831Z sha f3e080c :: blocked before merge. :: none
  • reviewed 2026-09-22T09:30:42.460Z sha f3e080c :: blocked before merge. :: none
  • reviewed 2026-09-23T09:54:36.477Z sha f3e080c :: blocked before merge. :: none
  • reviewed 2026-09-23T11:49:40.863Z sha 2ee9cab :: blocked before merge. :: none
  • reviewed 2026-09-23T12:33:30.444Z sha 6755c4ec205c68fbf75775bda2188f74692bcb60 :: blocked before merge. :: none
  • reviewed 2026-09-23T13:08:49.710Z sha 6755c4ec205c68fbf75775bda2188f74692bcb60 :: needs changes before merge. :: none
  • reviewed 2026-09-23T14:04:38.127Z sha 189048f068dfb41d66620b3b69c79fdda12e0fbd :: blocked before merge. :: none

@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 22, 2026
@shakkernerd
shakkernerd force-pushed the fix/guest-session-controls branch from f3e080c to 2ee9cab Compare September 23, 2026 11:41
@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 Sep 23, 2026
@shakkernerd
shakkernerd force-pushed the fix/guest-session-controls branch from 6755c4e to 189048f Compare September 23, 2026 13:35
Base automatically changed from fix/session-read-management to main September 23, 2026 13:56
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: 5c523dee54adf7da5de236a23f6f331f4c3d1c6c

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@shakkernerd
shakkernerd force-pushed the fix/guest-session-controls branch from 189048f to 5c523de Compare September 23, 2026 14:07
@shakkernerd shakkernerd self-assigned this Sep 23, 2026
@shakkernerd
shakkernerd merged commit 2a88df0 into main Sep 23, 2026
116 checks passed
@shakkernerd
shakkernerd deleted the fix/guest-session-controls branch September 23, 2026 14:54
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: Guests with session-write access can create sessions and use Stop and permitted settings in their own conversations.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
Enable Guest session creation and permitted controls for owned conversations. Keep delayed settings and Stop actions bound to their original session and run.
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 gateway Gateway runtime maintainer Maintainer-authored PR 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: XL 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