try setting cwd

This commit is contained in:
David Blass
2025-10-23 15:43:50 -04:00
parent 706ce04895
commit c0f31415a3
3 changed files with 5 additions and 2 deletions
+1
View File
@@ -114,6 +114,7 @@ export class ClaudeAgent implements Agent {
env,
input: `${instructions} ${prompt}`,
timeout: 10 * 60 * 1000, // 10 minutes
cwd: process.env.GITHUB_WORKSPACE || process.cwd(),
onStdout: (_chunk) => {
processJSONChunk(_chunk, this);
},
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@pullfrog/action",
"version": "0.0.55",
"version": "0.0.56",
"type": "module",
"files": [
"index.js",
+3 -1
View File
@@ -6,6 +6,7 @@ export interface SpawnOptions {
env?: Record<string, string>;
input?: string;
timeout?: number;
cwd?: string;
onStdout?: (chunk: string) => void;
onStderr?: (chunk: string) => void;
}
@@ -21,7 +22,7 @@ export interface SpawnResult {
* Spawn a subprocess with streaming callbacks and buffered results
*/
export async function spawn(options: SpawnOptions): Promise<SpawnResult> {
const { cmd, args, env, input, timeout, onStdout, onStderr } = options;
const { cmd, args, env, input, timeout, cwd, onStdout, onStderr } = options;
const startTime = Date.now();
let stdoutBuffer = "";
@@ -31,6 +32,7 @@ export async function spawn(options: SpawnOptions): Promise<SpawnResult> {
const child = nodeSpawn(cmd, args, {
env: env ? { ...process.env, ...env } : process.env,
stdio: ["pipe", "pipe", "pipe"],
cwd: cwd || process.cwd(),
});
let timeoutId: NodeJS.Timeout | undefined;