This commit is contained in:
Shreya Keshive
2026-03-03 14:00:54 -05:00
parent fe332bbef7
commit df256803d4
12 changed files with 44 additions and 13 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ and parameters.
| `--sandbox` | `-s` | boolean | `false` | Run in a sandboxed environment for safer execution | | `--sandbox` | `-s` | boolean | `false` | Run in a sandboxed environment for safer execution |
| `--approval-mode` | - | string | `default` | Approval mode for tool execution. Choices: `default`, `auto_edit`, `yolo` | | `--approval-mode` | - | string | `default` | Approval mode for tool execution. Choices: `default`, `auto_edit`, `yolo` |
| `--yolo` | `-y` | boolean | `false` | **Deprecated.** Auto-approve all actions. Use `--approval-mode=yolo` instead. | | `--yolo` | `-y` | boolean | `false` | **Deprecated.** Auto-approve all actions. Use `--approval-mode=yolo` instead. |
| `--experimental-acp` | - | boolean | - | Start in ACP (Agent Code Pilot) mode. **Experimental feature.** | | `--acp` | - | boolean | - | Start in ACP (Agent Client Protocol) mode. |
| `--experimental-zed-integration` | - | boolean | - | Run in Zed editor integration mode. **Experimental feature.** | | `--experimental-zed-integration` | - | boolean | - | **Deprecated.** Use `--acp` instead. Run in Zed editor integration mode. |
| `--allowed-mcp-server-names` | - | array | - | Allowed MCP server names (comma-separated or multiple flags) | | `--allowed-mcp-server-names` | - | array | - | Allowed MCP server names (comma-separated or multiple flags) |
| `--allowed-tools` | - | array | - | **Deprecated.** Use the [Policy Engine](../reference/policy-engine.md) instead. Tools that are allowed to run without confirmation (comma-separated or multiple flags) | | `--allowed-tools` | - | array | - | **Deprecated.** Use the [Policy Engine](../reference/policy-engine.md) instead. Tools that are allowed to run without confirmation (comma-separated or multiple flags) |
| `--extensions` | `-e` | array | - | List of extensions to use. If not provided, all extensions are enabled (comma-separated or multiple flags) | | `--extensions` | `-e` | array | - | List of extensions to use. If not provided, all extensions are enabled (comma-separated or multiple flags) |
@@ -14,7 +14,7 @@ import {
type Mock, type Mock,
type Mocked, type Mocked,
} from 'vitest'; } from 'vitest';
import { GeminiAgent, Session } from './zedIntegration.js'; import { GeminiAgent, Session } from './acp.js';
import * as acp from '@agentclientprotocol/sdk'; import * as acp from '@agentclientprotocol/sdk';
import { import {
AuthType, AuthType,
@@ -61,7 +61,7 @@ import { loadCliConfig } from '../config/config.js';
import { runExitCleanup } from '../utils/cleanup.js'; import { runExitCleanup } from '../utils/cleanup.js';
import { SessionSelector } from '../utils/sessionUtils.js'; import { SessionSelector } from '../utils/sessionUtils.js';
export async function runZedIntegration( export async function runAcp(
config: Config, config: Config,
settings: LoadedSettings, settings: LoadedSettings,
argv: CliArgs, argv: CliArgs,
@@ -13,7 +13,7 @@ import {
type Mocked, type Mocked,
type Mock, type Mock,
} from 'vitest'; } from 'vitest';
import { GeminiAgent } from './zedIntegration.js'; import { GeminiAgent } from './acp.js';
import * as acp from '@agentclientprotocol/sdk'; import * as acp from '@agentclientprotocol/sdk';
import { import {
ApprovalMode, ApprovalMode,
+24 -1
View File
@@ -82,6 +82,8 @@ export interface CliArgs {
allowedMcpServerNames: string[] | undefined; allowedMcpServerNames: string[] | undefined;
allowedTools: string[] | undefined; allowedTools: string[] | undefined;
experimentalAcp: boolean | undefined; experimentalAcp: boolean | undefined;
experimentalZedIntegration: boolean | undefined;
acp: boolean | undefined;
extensions: string[] | undefined; extensions: string[] | undefined;
listExtensions: boolean | undefined; listExtensions: boolean | undefined;
resume: string | typeof RESUME_LATEST | undefined; resume: string | typeof RESUME_LATEST | undefined;
@@ -180,6 +182,16 @@ export async function parseArguments(
.option('experimental-acp', { .option('experimental-acp', {
type: 'boolean', type: 'boolean',
description: 'Starts the agent in ACP mode', description: 'Starts the agent in ACP mode',
hidden: true,
})
.option('experimental-zed-integration', {
type: 'boolean',
description: 'Run in Zed editor integration mode',
hidden: true,
})
.option('acp', {
type: 'boolean',
description: 'Starts the agent in ACP mode',
}) })
.option('allowed-mcp-server-names', { .option('allowed-mcp-server-names', {
type: 'array', type: 'array',
@@ -633,6 +645,8 @@ export async function loadCliConfig(
const interactive = const interactive =
!!argv.promptInteractive || !!argv.promptInteractive ||
!!argv.experimentalAcp || !!argv.experimentalAcp ||
!!argv.experimentalZedIntegration ||
!!argv.acp ||
(!isHeadlessMode({ prompt: argv.prompt, query: argv.query }) && (!isHeadlessMode({ prompt: argv.prompt, query: argv.query }) &&
!argv.isCommand); !argv.isCommand);
@@ -821,7 +835,16 @@ export async function loadCliConfig(
bugCommand: settings.advanced?.bugCommand, bugCommand: settings.advanced?.bugCommand,
model: resolvedModel, model: resolvedModel,
maxSessionTurns: settings.model?.maxSessionTurns, maxSessionTurns: settings.model?.maxSessionTurns,
experimentalZedIntegration: argv.experimentalAcp || false, acp:
argv.acp ||
argv.experimentalAcp ||
argv.experimentalZedIntegration ||
false,
experimentalZedIntegration:
argv.experimentalAcp ||
argv.acp ||
argv.experimentalZedIntegration ||
false,
listExtensions: argv.listExtensions || false, listExtensions: argv.listExtensions || false,
listSessions: argv.listSessions || false, listSessions: argv.listSessions || false,
deleteSession: argv.deleteSession, deleteSession: argv.deleteSession,
+3 -3
View File
@@ -79,7 +79,7 @@ import {
type InitializationResult, type InitializationResult,
} from './core/initializer.js'; } from './core/initializer.js';
import { validateAuthMethod } from './config/auth.js'; import { validateAuthMethod } from './config/auth.js';
import { runZedIntegration } from './zed-integration/zedIntegration.js'; import { runAcp } from './acp/acp.js';
import { validateNonInteractiveAuth } from './validateNonInterActiveAuth.js'; import { validateNonInteractiveAuth } from './validateNonInterActiveAuth.js';
import { checkForUpdates } from './ui/utils/updateCheck.js'; import { checkForUpdates } from './ui/utils/updateCheck.js';
import { handleAutoUpdate } from './utils/handleAutoUpdate.js'; import { handleAutoUpdate } from './utils/handleAutoUpdate.js';
@@ -672,8 +672,8 @@ export async function main() {
await getOauthClient(settings.merged.security.auth.selectedType, config); await getOauthClient(settings.merged.security.auth.selectedType, config);
} }
if (config.getExperimentalZedIntegration()) { if (config.getAcp()) {
return runZedIntegration(config, settings, argv); return runAcp(config, settings, argv);
} }
let input = config.getQuestion(); let input = config.getQuestion();
+1 -1
View File
@@ -271,7 +271,7 @@ async function initOauthClient(
await triggerPostAuthCallbacks(client.credentials); await triggerPostAuthCallbacks(client.credentials);
} else { } else {
// In Zed integration, we skip the interactive consent and directly open the browser // In ACP integration, we skip the interactive consent and directly open the browser
if (!config.getExperimentalZedIntegration()) { if (!config.getExperimentalZedIntegration()) {
const userConsent = await getConsentForOauth(''); const userConsent = await getConsentForOauth('');
if (!userConsent) { if (!userConsent) {
+11 -3
View File
@@ -504,6 +504,7 @@ export interface ConfigParameters {
disableLoopDetection?: boolean; disableLoopDetection?: boolean;
maxSessionTurns?: number; maxSessionTurns?: number;
experimentalZedIntegration?: boolean; experimentalZedIntegration?: boolean;
acp?: boolean;
listSessions?: boolean; listSessions?: boolean;
deleteSession?: string; deleteSession?: string;
listExtensions?: boolean; listExtensions?: boolean;
@@ -699,6 +700,8 @@ export class Config implements McpContext {
private readonly summarizeToolOutput: private readonly summarizeToolOutput:
| Record<string, SummarizeToolOutputSettings> | Record<string, SummarizeToolOutputSettings>
| undefined; | undefined;
private readonly acp: boolean = false;
/** @deprecated Use acp instead */
private readonly experimentalZedIntegration: boolean = false; private readonly experimentalZedIntegration: boolean = false;
private readonly loadMemoryFromIncludeDirectories: boolean = false; private readonly loadMemoryFromIncludeDirectories: boolean = false;
private readonly includeDirectoryTree: boolean = true; private readonly includeDirectoryTree: boolean = true;
@@ -894,8 +897,8 @@ export class Config implements McpContext {
DEFAULT_PROTECT_LATEST_TURN, DEFAULT_PROTECT_LATEST_TURN,
}; };
this.maxSessionTurns = params.maxSessionTurns ?? -1; this.maxSessionTurns = params.maxSessionTurns ?? -1;
this.experimentalZedIntegration = this.acp = !!(params.acp || params.experimentalZedIntegration);
params.experimentalZedIntegration ?? false; this.experimentalZedIntegration = this.acp;
this.listSessions = params.listSessions ?? false; this.listSessions = params.listSessions ?? false;
this.deleteSession = params.deleteSession; this.deleteSession = params.deleteSession;
this.listExtensions = params.listExtensions ?? false; this.listExtensions = params.listExtensions ?? false;
@@ -2205,8 +2208,13 @@ export class Config implements McpContext {
return this.usageStatisticsEnabled; return this.usageStatisticsEnabled;
} }
getAcp(): boolean {
return this.acp;
}
/** @deprecated Use getAcp() instead */
getExperimentalZedIntegration(): boolean { getExperimentalZedIntegration(): boolean {
return this.experimentalZedIntegration; return this.acp;
} }
async waitForMcpInit(): Promise<void> { async waitForMcpInit(): Promise<void> {