diff --git a/packages/gateway/src/modules/bridge-spawner.ts b/packages/gateway/src/modules/bridge-spawner.ts index 77d240c..6344eff 100644 --- a/packages/gateway/src/modules/bridge-spawner.ts +++ b/packages/gateway/src/modules/bridge-spawner.ts @@ -21,7 +21,6 @@ interface RunningBridge { } const runningBridges = new Map(); -const PROMPT_ARG = '__LLM_GATEWAY_PROMPT__'; function extractCliContent(stdout: string): string { let lastAgentMessage = ''; @@ -55,11 +54,9 @@ async function runCli( ): Promise<{ success: boolean; content?: string; error?: string }> { return new Promise((resolve) => { try { - const finalArgs = args.map((arg) => arg === PROMPT_ARG ? prompt : arg); - const promptPassedAsArg = args.includes(PROMPT_ARG); const child = execFile( command, - finalArgs, + args as string[], { timeout: timeoutMs, maxBuffer: 10 * 1024 * 1024 }, (err, stdout) => { if (err) { @@ -69,7 +66,7 @@ async function runCli( } } ); - if (child.stdin && !promptPassedAsArg) { + if (child.stdin) { child.stdin.write(prompt); child.stdin.end(); } @@ -94,21 +91,6 @@ function buildCliInvocation(desc: SubscriptionDescriptor, model?: string): { cmd return { cmd: 'gh', args: ['copilot', 'suggest', '--shell'] }; } case 'inline-openai': { - if (desc.id === 'aider') { - const args = [ - '--yes-always', - '--no-show-model-warnings', - '--no-check-update', - '--no-analytics', - '--no-pretty', - '--no-stream', - '--no-git', - '--no-gitignore', - ]; - if (model && model !== 'aider-default') args.push('--model', model); - args.push('--message', PROMPT_ARG); - return { cmd: 'aider', args }; - } // Generic OpenAI-compatible CLI (chatgpt-cli, gemini-cli with OpenAI compat) return { cmd: desc.command, args: model ? ['--model', model] : [] }; }