refactor(app): make auto-accept permissions an app-level setting - #44608
Conversation
|
Addressed in ab7dc5d. Each finding was verified against the code before fixing: 1. Reconnects do not resweep — fixed. Verified the stream never replays: 2. Unloaded servers are not swept — fixed. Verified 3. Sweeps discard 4. Failed reply invisible — bounded retry added. 5. Unbounded Testing gap — covered.
All 3 e2e tests pass, plus |
|
All three findings verified as valid and addressed in fb7f250. 1. Retry after disable — fixed. Confirmed the gap: the catch checked 2. Idle detached requests — mitigated. Confirmed the path: 3. Sweep failures — bounded retry added. A sweep now reports completeness: Coverage. The reconnect e2e test now also injects a 500 on the first |
|
Thanks for the correction on the exhausted-retry finding. The three remaining findings are all valid and addressed in 7163804. 1. High: stale locations for moved active sessions — fixed. Confirmed the mechanism: 2. Medium: idle detached requests / late discovery — fixed for everything the client can see. Added a reactive effect that approves any pending request present in the local store ( 3. Medium: reply mock returned 200 instead of 204 — fixed. Confirmed against the generated client: All 4 e2e tests, 42 unit tests, and both typechecks pass. |
Summary
Auto-accept permissions was scoped per session (and per directory, per server) in the desktop/web app. This PR makes it a single app-level setting: one client-local boolean that applies to every session, tab, project, and server connection at once.
settings.permissions.autoApprove— a client-local persisted settings slot that already existed but was consumed nowhere. The settings switch, themod+shift+acommand, and the auto-responder all read and write this one value.session/requests/auto-approve.ts) is wired into each server connection. It approves new requests frompermission.askedevents and sweeps already-pending requests per known session directory while the setting is on (covers toggle-on, app startup, and late-synced sessions).Removed
server-permission.tsx: the persisted per-serverautoAcceptmap, storage migrations, enable versioning, TTL-pruned responded cache, and dead API surface (enableConfiguredDirectory,permissionsEnabled,isPermissionAllowAllhad no callers)auto-respond.ts+ test: session/directory accept keys, parent-lineage inheritance, key relocationusePermissioncontext,ctx.permissiononServerCtx, the storybook mock and its vite aliasuseSessionTabAvatarState(directory),SettingsGeneral.sessionID,DialogSettings.sessionID,createPermissionScopeController, and the new-session directory-inheritance block incomposer-adapter.tsNet: +74 / −679 lines.
Behavior notes
Verification
bun typecheckandbun run typecheck:e2epass inpackages/appbun run test)remote-session-settingse2e tests pass