Simplify Galaxy permissions and preserve explicit user authorization

This commit is contained in:
2026-10-02 01:58:37 -05:00
parent 5a70995502
commit 2796fdd114
37 changed files with 1818 additions and 3530 deletions
+15 -23
View File
@@ -7429,7 +7429,8 @@ impl TerminalView {
);
}
}
BlocklistAIActionEvent::QueuedAction { .. }
BlocklistAIActionEvent::PermissionReviewChanged { .. }
| BlocklistAIActionEvent::QueuedAction { .. }
| BlocklistAIActionEvent::ToolLifecycle { .. } => {}
}
}
@@ -27434,31 +27435,22 @@ impl TypedActionView for TerminalView {
self.write_codebase_index(ctx);
}
ToggleAutoexecuteMode => {
// Cloud (ambient) agent conversations run with fast-forward conceptually
// always on, so toggling it from the chip or keybinding is a no-op there.
let is_locked = {
let terminal_model = self.model.lock();
is_in_cloud_context(
terminal_model.block_list().agent_view_state(),
&terminal_model,
)
};
if is_locked {
return;
}
// If there's a pending (blocked) requested code diff, accept it first.
if let Some(ai_block) = self.last_ai_block() {
ai_block.update(ctx, |ai_block, ctx| {
ai_block.accept_pending_action(ctx);
});
}
self.ai_context_model.update(ctx, |context_model, ctx| {
context_model.toggle_pending_query_autoexecute(ctx);
AIExecutionProfilesModel::handle(ctx).update(ctx, |profiles, ctx| {
let profile = profiles.active_profile(Some(self.view_id), ctx);
let next = match profile.data().permission_mode {
crate::ai::execution_profiles::PermissionMode::ReadOnly => return,
crate::ai::execution_profiles::PermissionMode::AskFirst => {
crate::ai::execution_profiles::PermissionMode::GalaxyDecides
}
crate::ai::execution_profiles::PermissionMode::GalaxyDecides => {
crate::ai::execution_profiles::PermissionMode::AskFirst
}
};
profiles.set_permission_mode(*profile.id(), next, ctx);
});
ctx.notify();
}
ToggleQueueNextPrompt => {
let Some(conversation_id) =
BlocklistAIHistoryModel::as_ref(ctx).active_conversation_id(self.view_id)
+1 -1
View File
@@ -969,7 +969,7 @@ pub fn init(app: &mut AppContext) {
app.register_editable_bindings([
EditableBinding::new(
TOGGLE_AUTOEXECUTE_MODE_KEYBINDING,
"Toggle Auto-execute Mode",
"Toggle Ask First / Galaxy Decides",
TerminalAction::ToggleAutoexecuteMode,
)
.with_key_binding("cmdorctrl-shift-I")