mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-09 07:29:51 +00:00
fix(cli): preserve invoked cwd for local launcher (#299)
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user