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:
parent
c91a886d49
commit
8c08087337
1 changed files with 9 additions and 0 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue