Repository navigation
fix: enable Guest session creation and controls - #155565
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. Reviewed September 23, 2026, 10:15 AM ET / 14:15 UTC (Revision 9). ClawSweeper reviewWhat this changesEnables 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +196, Tests +837, Docs +7. Total +1040 across 39 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
f3e080c to
2ee9cab
Compare
6755c4e to
189048f
Compare
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
189048f to
5c523de
Compare
|
Fixed: Guests with session-write access can create sessions and use Stop and permitted settings in their own conversations. |
Enable Guest session creation and permitted controls for owned conversations. Keep delayed settings and Stop actions bound to their original session and run.
What Problem This Solves
Guests with
operator.sessions.writecan 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 squash282fc78eaf64208d6b6db70c56557ca24fc29097in main. The two browser commits remain patch-equivalent to tested189048f; 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
189048fadditionally 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 maintainednode scripts/run-vitest.mjs <file> --maxWorkers=1entry point was used, with the UI E2E config for browser files. Current CI seconds are native full-file Vitest durations from run35868166647, on the exact current tree. Job setup and overlapping work are not summed.ui/src/api/gateway.node.test.tsapp/app-host-native-shell.test.tscomponents/keyboard-shortcuts-dialog.test.tse2e/chat-flow.models-reasoning.e2e.test.tse2e/chat-model-controls.e2e.test.tse2e/guest-session-controls.e2e.test.tse2e/session-management.operator-scopes.e2e.test.tslib/session-method-access.test.tspages/chat/chat-commands.test.tspages/chat/chat-pane-connection-lifecycle.test.tspages/chat/chat-pane-session-access.test.tspages/chat/chat-pane-session-controls.permissions.test.tspages/chat/chat-pane-session-controls.test.tspages/chat/chat-pane-stop.test.tspages/chat/chat-send-abort.test.tspages/chat/chat-send-settings.test.tspages/chat/chat-view.test.tspages/chat/run-lifecycle.abort.test.tsVisual evidence
Guest creation, controls and cross-agent reconnect Stop, annotated at half speed
proof.mp4
Visual verification
5c523dee54adf7da5de236a23f6f331f4c3d1c6c