refactor(tray): move Permissions into shared-state MVVM ownership - #1075
refactor(tray): move Permissions into shared-state MVVM ownership#1075bkudiess wants to merge 3 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 6, 2026, 4:12 AM ET / 08:12 UTC. ClawSweeper reviewWhat this changesMoves Permissions-page state into shared WinUI-free ownership and rebuilds local MCP capabilities after permission changes and MCP restart. Merge readinessKeep this PR open. Its collaborator author requires maintainer judgment, and the final MCP restart change lacks real behavior proof from the current head; the supplied screenshot and transcript cover the earlier 57ac65d head. Priority: P2 Review scores
Verification
How this fits togetherThe tray app exposes Windows-node permissions through WinUI, tray, Hub, and local MCP settings commands. Those inputs update shared settings and execution approvals, then determine which tools local MCP and gateway-connected agents receive. flowchart LR
A[Permissions page] --> D[Shared settings store]
B[Tray and Hub controls] --> D
C[Local MCP settings commands] --> D
D --> E[Permissions view model]
D --> F[Capability gating]
F --> G[Local MCP tool list]
E --> H[WinUI presentation]
Decision needed
Why: The final commit changes the behavior the earlier screenshot and transcript do not cover, and this boundary controls tools exposed to local agents. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Add a redacted exact-head MCP-only proof that disables a capability, stops and restarts local MCP, and shows tools/list plus the reopened Permissions page converging to the persisted setting. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor must preserve established Permissions and MCP behavior; the missing evidence is an exact-head restart proof rather than a user bug reproduction. Is this the best way to solve the issue? Unclear: the ownership direction matches the architecture ledger, but the final MCP restart delta needs current-head runtime evidence before it can be judged the best safe implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against aac07abb1fbd. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
1 similar comment
|
@clawsweeper re-review |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
57ac65d to
aaebf76
Compare
Moves the Permissions page's presentation, lifecycle, and shared settings behavior out of code-behind into a WinUI-free view model while preserving current security, command exposure, and visual behavior.
What changed
PermissionsPageViewModeland no-cache runtime projection, activated through the existing navigation scope.ISettingsStorefield-scoped, serialized, versioned, and origin-aware so Settings, Permissions, tray, Hub, Connection, and local MCP writers converge without self-echo or stale updates.ExecApprovalsStore; runtime and UI continue sharing one authoritative store.NodeCapabilityGatingas the sole command-exposure owner and preserve BrowserProxyActivation/shared-token behavior.tools/listupdates immediately without requiring a gateway reconnect or app restart.PermissionsPage.xaml.csfrom 891 to 557 lines while leaving the visual tree intentionally unchanged.Ownership transfer
PermissionsPage.xaml.csdirectly owned settings mutation, runtime projection, approval-file presentation, and subscriptions.PermissionsPageViewModel,PermissionsPageRuntimeSource,ISettingsStore, and the App-ownedExecApprovalsStorepresentation contract.NotifySettingsSaved; active surfaces and MCP capability discovery converge to the newest version; command exposure remains owned byNodeCapabilityGating.Scope decision
This lands as one atomic ownership transfer. Splitting the view model, shared-settings convergence, and V2 approval observation would temporarily leave parallel mutable owners or require throwaway compatibility paths. Visible Fluent/icon/card cleanup remains separate, so this PR stays behavior- and visual-identical.
Validation
./build.ps1: all 5 projects passedOpenClaw.Shared.Tests: 3,415 passed, 32 skipped, 0 failedOpenClaw.Tray.Tests: 2,103 passed, 0 skipped, 0 failedOpenClaw.WinNode.Cli.Tests: 126 passed, 0 skipped, 0 failed./scripts/validate-mxc-e2e.ps1: 2/2 passed, 0 skippedIndependent adversarial review
Exact head reviewed:
57ac65dc0dfaefc82e751786f337da0dba0064be.Both reviewers independently inspected the complete
8ac00c5f..57ac65dcdiff. Their confidence accounts for the full suites, 20-cycle observer and concurrency stress, real gateway-to-Windows-node MXC E2E, live MCP-only camera gating, Settings persistence, active-page updates, and V2 approvals CAS/hash/UI restoration.Real behavior proof
PR head
57ac65dc0dfaefc82e751786f337da0dba0064bewas launched as an isolated side-by-side Dev app with local MCP.Local MCP only, Camera on, and the camera tools present.app.settings.getand isolatedsettings.jsonboth returnedNodeCameraEnabled=false.app.settings.setrestored Camera to true; the already-open page returned to Camera on and the live tool count returned 48 → 51.winnode --list-tools, local MCP settings commands, and the real gateway-to-Windows-node MXC proofs passed.Inspectable current-head transcript
Exact-final-head media proof
Exact source head 57ac65d was launched through the repository's normal non-isolated local path on an interactive Windows desktop. Native WinUI UI Automation read the Camera toggle, changed it from Off to On for this frame, then restored it to Off before the launched process exited.
Deferred visual work
This PR intentionally preserves the existing capability icons, colors, cards, spacing, and copy. Fluent icon/token/SettingsCard cleanup remains a separate visible-design change.