Repository navigation
fix: allow session thinking and fast-mode changes with write access - #146343
Conversation
Keep context-window and other privileged overrides admin-scoped while aligning ordinary model, thinking, and fast-mode controls. Cover existing-session persistence, resets, and rendered permission boundaries. Co-authored-by: VACInc <[email protected]>
|
🦞👀 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. |
Keep the existing organization and composer test files within the lint limit without suppressions; retain the real Gateway and rendered-control regression coverage. Co-authored-by: VACInc <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 3:25 PM ET / 19:25 UTC. ClawSweeper reviewWhat this changesAllows write-scoped clients to change session thinking and fast-mode preferences while keeping the Control UI’s context-window control separately admin-scoped. Merge readiness✅ Ready for maintainer review This remains useful: current main and v2026.9.4 retain the admin-only restriction. The focused implementation preserves the surrounding authorization boundaries, and no introduced correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway authorizes session-setting requests from the Control UI and other clients before storing preferences for subsequent turns. The UI consumes the same shared field-permission policy to enable its controls. flowchart LR
A[Chat controls and commands] --> B[Shared field permission policy]
C[Client scopes] --> B
B --> D[Gateway authorization]
D --> E[Current session access check]
E --> F[Persist session preferences]
F --> G[Subsequent model turns]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +13, Tests +196, Docs +2. Total +211 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep session preference permissions in the shared policy, with privileged fields and current-session authorization enforced by the existing Gateway owners. Do we have a high-confidence way to reproduce the issue? Not applicable as a regression: this changes a previously documented access policy. Source inspection confirms that current main rejects these effort patches from write-only clients. Is this the best way to solve the issue? Yes. Extending the existing shared field policy and separating context-window access avoids competing authorization logic while preserving existing persistence and validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7b374192653d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Genuine before/after and session-access clarificationA 41.92-second before/after recording is now captured and inspected. These are actual source revisions in Chromium against real isolated Gateways, not a simulated disabled UI:
Both fixtures used What “owned or assigned” means hereThis PR does not implement an owner/assignee-only restriction. It changes which session fields ordinary write access can modify; the existing per-session authorization rules remain in force.
Sources: ownership versus assignment, sharing-role resolution, mutation policy, and existing admin exception. Independent verification passed 262 existing tests across 7 policy/mutation test files. A two-identified-user, effort-field-specific RPC matrix for both patch methods was not performed; the source trace and existing tests establish the unchanged common authorization boundary. Comparison media statusThe comparison video is not attached to this PR yet. The current GitHub upload attempt still returns HTTP 400 Comparison SHA-256: Real Control UI verificationVerified on
The fixture used synthetic transcript/model labels and isolated credentials. No model inference was started ( Recording / publication statusA 28.2-second, 1280×800 H.264 recording was captured and visually inspected, including its full timeline, the High/Fast result, reload persistence, and the read-only state. Media attachment is blocked by the verification host’s upload path, not by the fix:
Video SHA-256: This verifies session-preference controls and authorization boundaries, not active-inference switching or overall CI status. |
…penclaw#146343) * fix: allow session thinking and fast-mode changes with write access Keep context-window and other privileged overrides admin-scoped while aligning ordinary model, thinking, and fast-mode controls. Cover existing-session persistence, resets, and rendered permission boundaries. Co-authored-by: VACInc <[email protected]> * test: isolate session setting permission regressions Keep the existing organization and composer test files within the lint limit without suppressions; retain the real Gateway and rendered-control regression coverage. Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: VACInc <[email protected]>
|
Follow-up to the upload blocker documented here: #144902 has merged the protected-egress fixed-length framing correction. This is separate from this PR's session thinking/Fast Mode permission changes. The transport fix does not itself attach the recording, prove GitHub attachment acceptance, or establish that the running Gateway has been updated. |
What Problem This Solves
Fixes an issue where users with ordinary session write access could change a conversation’s model but could not change its thinking level or fast mode. The same mismatch affected the Control UI pickers and its /think and /fast commands.
Related: #120875, which enabled write-scoped model changes while leaving effort controls admin-only.
Why This Change Was Made
Treat
thinkingLevelandfastModeas session-only write-scoped preferences in the existing shared policy, including clearing them withnull. Gateway single/batch patches and the Control UI use that same policy. Give the context-window control its own permission check so enabling effort controls does not accidentally enable an unrelated admin-only setting.Read-only clients remain read-only. Context-window, verbose, tool, full-permission, and unknown-field restrictions are unchanged. No configuration migration, new setting, or active-inference hot-switching is introduced.
User Impact
Users with
operator.writecan change thinking level and fast mode without starting a new conversation or receiving administrator access. Changes are persisted session preferences for subsequent turns; the composer still disables model/effort controls while a reply is running. Existing model/provider capability validation remains in place.Reported by @VACInc.
Evidence
FORBIDDEN / MISSING_SCOPE / operator.admin.git diff --checkpassed.Commands:
node scripts/run-vitest.mjs src/shared/session-method-scopes.test.ts src/gateway/method-scopes.test.ts src/gateway/server.sessions.store-rpc.test.ts node scripts/run-vitest.mjs ui/src/lib/session-method-access.test.ts ui/src/pages/chat/chat-pane-session-controls.test.ts ui/src/pages/chat/chat-command-executor.test.ts src/shared/session-method-scopes.test.ts node scripts/run-vitest.mjs ui/src/pages/new-session/model-control.test.ts ui/src/pages/chat/chat-view.test.ts node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-session-controls.test.ts ui/src/pages/chat/chat-send.test.ts node scripts/run-vitest.mjs src/gateway/server.sessions.effort-scopes.test.ts src/gateway/server.sessions.store-rpc.test.ts ui/src/pages/chat/chat-pane-session-controls.permissions.test.ts ui/src/pages/chat/chat-pane-session-controls.test.ts node scripts/run-vitest.mjs src/gateway/server.sessions.store-rpc.test.ts -t "write-scoped operators manage"Production delta: +13 lines, principally the independent context-window permission wiring; tests counted separately. No styling or layout changes. This is isolated Gateway and rendered UI test proof, not a deployed-Gateway or paid-provider live test.