fix(cli): preserve invoked cwd for local launcher (#299)

This commit is contained in:
ROOOO
2026-03-17 22:55:23 +08:00
committed by GitHub
parent 1691100328
commit caa76826f4
16 changed files with 127 additions and 16 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { AcpSdkBackend } from '@/agent/backends/acp';
import { buildOpencodeEnv } from './config';
import { getInvokedCwd } from '@/utils/invokedCwd';
function filterEnv(env: NodeJS.ProcessEnv): Record<string, string> {
const result: Record<string, string> = {};
@@ -15,7 +16,7 @@ export function createOpencodeBackend(opts: {
cwd?: string;
}): AcpSdkBackend {
const env = buildOpencodeEnv();
const args = ['acp', '--cwd', opts.cwd ?? process.cwd()];
const args = ['acp', '--cwd', opts.cwd ?? getInvokedCwd()];
return new AcpSdkBackend({
command: 'opencode',