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
@@ -10,6 +10,7 @@ import type { Update, UpdateMachineBody } from '@hapi/protocol'
import type { RunnerState, Machine, MachineMetadata } from './types'
import { RunnerStateSchema, MachineMetadataSchema } from './types'
import { backoff } from '@/utils/time'
import { getInvokedCwd } from '@/utils/invokedCwd'
import { RpcHandlerManager } from './rpc/RpcHandlerManager'
import { registerCommonHandlers } from '../modules/common/registerCommonHandlers'
import type { SpawnSessionOptions, SpawnSessionResult } from '../modules/common/rpcTypes'
@@ -77,7 +78,7 @@ export class ApiMachineClient {
logger: (msg, data) => logger.debug(msg, data)
})
registerCommonHandlers(this.rpcHandlerManager, process.cwd())
registerCommonHandlers(this.rpcHandlerManager, getInvokedCwd())
this.rpcHandlerManager.registerHandler<PathExistsRequest, PathExistsResponse>('path-exists', async (params) => {
const rawPaths = Array.isArray(params?.paths) ? params.paths : []