fix(team): reset autoAllowAll when launching team with manual approval

When the user previously clicked 'Allow all', autoAllowAll persists
globally in localStorage. New teams launched with skipPermissions=false
(manual tool approval) would silently auto-approve everything.

Now createTeam/launchTeam reset autoAllowAll to false when
skipPermissions is explicitly false, ensuring the ToolApprovalSheet
appears for the new team.
This commit is contained in:
iliya 2026-03-29 22:32:30 +03:00
parent c91a886d49
commit 8c08087337

View file

@ -1848,6 +1848,11 @@ export const createTeamSlice: StateCreator<AppState, [], [], TeamSlice> = (set,
},
},
}));
// When launching WITHOUT auto-approve, reset the global autoAllowAll flag
// so the user sees the ToolApprovalSheet for this team's tool requests.
if (request.skipPermissions === false && get().toolApprovalSettings.autoAllowAll) {
await get().updateToolApprovalSettings({ autoAllowAll: false });
}
try {
if (typeof api.teams.createTeam !== 'function') {
throw new Error(
@ -2020,6 +2025,10 @@ export const createTeamSlice: StateCreator<AppState, [], [], TeamSlice> = (set,
[request.teamName]: pendingRunId,
},
}));
// When launching WITHOUT auto-approve, reset the global autoAllowAll flag
if (request.skipPermissions === false && get().toolApprovalSettings.autoAllowAll) {
await get().updateToolApprovalSettings({ autoAllowAll: false });
}
try {
const response = await unwrapIpc('team:launch', () => api.teams.launchTeam(request));