loadConfigForCwd
loadConfigForCwd(
cwd):Promise<GthConfig>
Defined in: packages/agent/src/modules/acp/acpCommon.ts:101
Points config discovery — and with it the filesystem toolkit’s allowed root, grep’s boundary and the shell tool’s spawn directory — at the ACP session’s workspace.
All of them read getCurrentWorkDir(), which prefers INIT_CWD. In a normal CLI run that is
npm’s, and correct. In an editor-spawned agent it is whatever the install shell left behind, and
pointing an agent’s file tools at a stale directory is worse than any error: it reads and writes
real files in the wrong project. Setting it to the workspace the CLIENT named replaces a guess
with the one authoritative value, and does it without process.chdir(), which in a process
serving several sessions would be a race rather than a fix.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<GthConfig>