Commit d9522065c72d
Changed files (1)
dots
pi
agent
extensions
subagent
dots/pi/agent/extensions/subagent/index.ts
@@ -283,7 +283,11 @@ async function runSingleAgent(
let wasAborted = false;
const exitCode = await new Promise<number>((resolve) => {
- const proc = spawn("pi", args, { cwd: cwd ?? defaultCwd, shell: false, stdio: ["ignore", "pipe", "pipe"] });
+ const workingDir = cwd ?? defaultCwd;
+ if (!workingDir) {
+ throw new Error(`Working directory is undefined. cwd=${cwd}, defaultCwd=${defaultCwd}`);
+ }
+ const proc = spawn("pi", args, { cwd: workingDir, shell: false, stdio: ["ignore", "pipe", "pipe"] });
let buffer = "";
const processLine = (line: string) => {