Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/src/gemini/geminiRemoteLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class GeminiRemoteLauncher extends RemoteLauncherBase {
token: runtimeConfig.token,
resumeSessionId: session.sessionId,
hookSettingsPath: this.hookSettingsPath,
cwd: session.path
cwd: session.path,
permissionMode: session.getPermissionMode() as string | undefined
});
this.backend = backend;

Expand Down
4 changes: 4 additions & 0 deletions cli/src/gemini/utils/geminiBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function createGeminiBackend(opts: {
resumeSessionId?: string | null;
hookSettingsPath?: string;
cwd?: string;
permissionMode?: string;
}): AcpSdkBackend {
const { model, token } = resolveGeminiRuntimeConfig({
model: opts.model,
Expand All @@ -30,6 +31,9 @@ export function createGeminiBackend(opts: {
if (model) {
args.push('--model', model);
}
if (opts.permissionMode === 'yolo' || opts.permissionMode === 'safe-yolo') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MAJOR] Safe-yolo currently maps to full --yolo, collapsing Safe Yolo into Yolo and bypassing intended safeguards. Suggest mapping safe-yolo to the same approval mode as local launcher (auto_edit) and reserving --yolo for yolo.

Suggested fix:

if (opts.permissionMode === 'safe-yolo') {
    args.push('--approval-mode', 'auto_edit');
} else if (opts.permissionMode === 'yolo') {
    args.push('--yolo');
}

args.push('--yolo');
}

const env = buildGeminiEnv({
model,
Expand Down