Revert "fix(gateway): run aider bridge non-interactively"
This reverts commit 861457719b32644a450cc414f2f07ba522b65a62.
This commit is contained in:
parent
861457719b
commit
eb7525e97b
@ -21,7 +21,6 @@ interface RunningBridge {
|
||||
}
|
||||
|
||||
const runningBridges = new Map<string, RunningBridge>();
|
||||
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] : [] };
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user