feat(auth): separate environment administration permissions - #9786
feat(auth): separate environment administration permissions#9786juliusmarminge wants to merge 13 commits into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This is a broad authentication and authorization capability change that alters RPC enforcement, pairing defaults, and production behavior across server, web, and mobile clients. Existing unresolved Medium findings also concern keybinding cleanup and environment-specific shortcut dispatch, so the change warrants human review. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
ee2b738 to
5a020b3
Compare
25f5cbd to
5f1623b
Compare
5f0ec69 to
7355eae
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit 7355eae. Configure here.
5c02cde to
64d67b0
Compare
64d67b0 to
4cde5f6
Compare
| > | ||
| {activeProjectScripts && ( | ||
| <ProjectScriptsControl | ||
| environmentId={activeThreadEnvironmentId} |
There was a problem hiding this comment.
🟡 Medium chat/ChatHeader.tsx:424
The scripts menu displays shortcuts from activeThreadEnvironmentId, but the active chat keydown handler resolves script commands from the primary environment's keybindings, so shortcuts shown for a secondary environment do not run the displayed script and a primary-environment shortcut may run instead. Update the handler to resolve bindings for activeThreadEnvironmentId (or otherwise use the same environment-specific bindings as the menu).
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/web/src/components/chat/ChatHeader.tsx around line 424:
The scripts menu displays shortcuts from `activeThreadEnvironmentId`, but the active chat keydown handler resolves script commands from the primary environment's `keybindings`, so shortcuts shown for a secondary environment do not run the displayed script and a primary-environment shortcut may run instead. Update the handler to resolve bindings for `activeThreadEnvironmentId` (or otherwise use the same environment-specific bindings as the menu).

Provider setup, settings changes and server maintenance all shared
orchestration:operate. Parts of Connections also required access administration to configure an environment. A workspace operator could not be granted these capabilities independently.Adds three scopes:
settings:writefor environment settings and keybindings.providers:managefor provider configuration, sign-in, installation, updates and reset credits.environment:maintainfor server updates, process signals, resource collector recovery and host power controls.Settings patches require permission for every domain they change, including
settings:writefor model pricing overrides. Web, desktop and mobile use the selected environment's grant for controls and check it again before writes. Shared settings sync includes only writable environments. Access and relay administration remain separate, and local preferences stay editable.New Standard and Administrative grants include these scopes. Existing paired clients keep their grants and must pair again to receive the new permissions. Reconnecting does not expand access.
Validation: 93 focused web tests and the mobile TypeScript check passed. Targeted formatting and diff checks passed. RPC tests cover individual settings/provider grants, mixed patches and denied maintenance actions.
Pairing controls, captured from this layer’s base and head with the same viewport and default selection:
Model: GPT-6. Harness: Codex.
Note
Add
settings:write,providers:manage, andenvironment:maintainauth scopesorchestration:operatefor settings writes, provider management, and environment maintenance operations.requiredScopesForServerSettingsPatchhelper, skipping writes to environments that lack the needed grants.settings:writeandproviders:manage.orchestration:operateforserverUpdateScopewhenauth.serverUpdateScopeis absent, but other operations (provider management, settings writes, environment maintenance) now require the new scopes explicitly — clients or pairings that previously relied onorchestration:operatefor these actions will be denied until re-paired. See remote-access.md.Macroscope summarized 4cde5f6.
Note
High Risk
Changes authentication scope boundaries and RPC enforcement across server, web, desktop, and mobile; existing pairings keep old grants until re-paired.
Overview
Splits environment administration out of
orchestration:operateintosettings:write,providers:manage, andenvironment:maintain, and wires server RPC/HTTP authorization plus Standard vs Administrative grant bundles to those scopes.serverUpdateSettingsnow requires every scope implied by the patch (viarequiredScopesForServerSettingsPatch), and the auth descriptor advertisesserverUpdateScopefor self-update checks.Clients add
useEnvironmentScope/readEnvironmentScopeand use them to disable or block provider updates, reset credits, server updates, T3 Connect reconcile, pairing delegation, keybindings, and Connections access UI when the grant is missing—often re-checking immediately before writes. Mobile auto-settle shared settings waits on session resolution, picks the first writable reference, still shows read-only values, and fans edits only to writable environments.Project scripts treat keybinding as optional on save so script-only edits do not overwrite shortcuts changed elsewhere; explicit shortcut changes still require
settings:write. Pairing link creation is limited to scopes the current session holds, and “revoke others” stays enabled when the client list is unknown.Reviewed by Cursor Bugbot for commit 4cde5f6. Bugbot is set up for automated code reviews on this repo. Configure here.