Repository navigation
fix(gateway): allow write-scoped session model changes - #120875
Conversation
|
Land-ready verification for head
Known proof gap: the disposable local Gateway did not finish serving Control UI assets, so browser screenshot capture was unavailable. The changed UI access split is covered by focused Control UI tests, while the underlying public Gateway behavior was proven source-blind end to end. |
|
Follow-up: merged #146343 extends the write-scoped session model-setting policy from #120875 to thinkingLevel and fastMode updates, including clearing overrides. Existing per-session access checks and privileged-field restrictions are preserved. The original model-picker fix remains #120875; #146343 addresses the effort controls deliberately excluded from that earlier change. These fixes are complementary, not duplicates. |
Closes #120867
What Problem This Solves
Fixes an issue where operators using the Control UI or another bounded client could not change the current session model with
operator.write. The model picker was disabled with an administrator-access message becausesessions.patch { model }was rejected before the existing session-only handler path could run.Why This Change Was Made
The canonical params-aware session policy now treats
modelas a write-scoped session mutation while keeping thinking, fast, verbose, trace, reasoning, unknown fields, and mixed privileged patches admin-only. Public compare-and-swap envelope fields no longer accidentally escalate an otherwise write-scoped patch.The handler's existing ownership boundary remains intact: write-scoped model changes affect only the session, while only
operator.admincallers can persist the selection as the configured agent default. The Control UI now evaluates model and effort access separately so widening model access does not expose admin-only controls.This PR is AI-assisted and was reviewed against the full diff.
User Impact
Operators with
operator.writecan select or clear an allowed model for their current session without receiving administrator authority. Thinking and fast-mode controls remain unavailable withoutoperator.admin, and mixed model-plus-privileged patches still fail atomically.The separate owner handoff problem was already fixed by #119785 and is not changed here. Live Roboclaw verification showed the active pane currently receives the full administrator scope set.
Evidence
operator.writechanged and cleared the session model successfully;thinkingLevelandfastModereturned structuredmissing scope: operator.adminerrors;git diff --checkpassed.--mode uncommitted, P1) reported no accepted/actionable findings; TruffleHog was clean.origin/mainwas conflict-free and preserved the reviewed patch ID.Production delta: +49/−35 lines (net +14). Tests are net +60 lines; docs are net +5 lines.