diff --git a/vscode-extension/src/acpAgentActor.ts b/vscode-extension/src/acpAgentActor.ts index 19d0a287..a65db508 100644 --- a/vscode-extension/src/acpAgentActor.ts +++ b/vscode-extension/src/acpAgentActor.ts @@ -244,16 +244,21 @@ export class AcpAgentActor { spawnArgs.push("--log", agentLogLevel); } + const traceDir = vsConfig.get("traceDir", ""); + if (traceDir) { + spawnArgs.push("--trace-dir", traceDir); + } + if (resolved.isSymposiumBuiltin) { - // Symposium builtin (e.g., eliza) - run conductor with subcommand directly - spawnArgs.push(resolved.command, ...resolved.args); + // Symposium builtin (e.g., eliza) - wrap with conductor using the same binary + spawnArgs.push( + "--", + conductorCommand, + resolved.command, + ...resolved.args, + ); } else { // External agent - wrap with conductor - const traceDir = vsConfig.get("traceDir", ""); - if (traceDir) { - spawnArgs.push("--trace-dir", traceDir); - } - spawnArgs.push("--", resolved.command, ...resolved.args); } diff --git a/vscode-extension/src/agentRegistry.ts b/vscode-extension/src/agentRegistry.ts index cad996f3..62df477e 100644 --- a/vscode-extension/src/agentRegistry.ts +++ b/vscode-extension/src/agentRegistry.ts @@ -36,7 +36,14 @@ export interface SymposiumDistribution { args?: string[]; } +export interface LocalDistribution { + command: string; + args?: string[]; + env?: Record; +} + export interface Distribution { + local?: LocalDistribution; // explicit local binary path npx?: NpxDistribution; pipx?: PipxDistribution; binary?: Record; // keyed by platform, e.g., "darwin-aarch64" @@ -206,7 +213,16 @@ export async function resolveDistribution( ): Promise { const dist = agent.distribution; - // Try symposium builtin first (e.g., eliza subcommand) + // Try local first (explicit path takes priority) + if (dist.local) { + return { + command: dist.local.command, + args: dist.local.args ?? [], + env: dist.local.env, + }; + } + + // Try symposium builtin (e.g., eliza subcommand) if (dist.symposium) { return { command: dist.symposium.subcommand, diff --git a/vscode-extension/src/chatViewProvider.ts b/vscode-extension/src/chatViewProvider.ts index c2f27c02..c6069cda 100644 --- a/vscode-extension/src/chatViewProvider.ts +++ b/vscode-extension/src/chatViewProvider.ts @@ -868,11 +868,17 @@ export class ChatViewProvider implements vscode.WebviewViewProvider { // Generate unique approval ID const approvalId = uuidv4(); - // Find the tab for this session (we don't have sessionId in params, so we'll send to all tabs) - // For now, we'll use the first tab - TODO: improve this to target the right tab - const tabIds = Array.from(this.#tabToAgentSession.keys()); - if (tabIds.length === 0) { - logger.error("approval", "No tabs available for approval request"); + // Find the tab for this agent by looking up which tab has a config with matching agentId + let tabId: string | undefined; + for (const [tid, config] of this.#tabToConfig.entries()) { + if (config.agentId === agentId) { + tabId = tid; + break; + } + } + + if (!tabId) { + logger.error("approval", "No tab found for agent", { agentId }); // Fallback: deny const rejectOption = params.options.find( (opt) => opt.kind === "reject_once", @@ -885,8 +891,6 @@ export class ChatViewProvider implements vscode.WebviewViewProvider { return { outcome: { outcome: "cancelled" } }; } - const tabId = tabIds[0]; // Use first tab for now - logger.debug("approval", "Requesting user approval", { approvalId, tabId, diff --git a/vscode-extension/src/test/conversation.test.ts b/vscode-extension/src/test/conversation.test.ts index 8f64cea6..fb9069f0 100644 --- a/vscode-extension/src/test/conversation.test.ts +++ b/vscode-extension/src/test/conversation.test.ts @@ -80,7 +80,9 @@ suite("Conversation Tests", () => { response.toLowerCase().includes("hello") || response.toLowerCase().includes("hi") || response.toLowerCase().includes("how") || - response.toLowerCase().includes("what"), + response.toLowerCase().includes("what") || + response.toLowerCase().includes("you") || + response.toLowerCase().includes("thank"), "Response should be relevant to the prompt", );