diff --git a/package-lock.json b/package-lock.json index db7dd48..e085a28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-agent-fleet", - "version": "0.13.6", + "version": "0.15.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "obsidian-agent-fleet", - "version": "0.13.6", + "version": "0.15.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/src/adapters/claudeCodeAdapter.test.ts b/src/adapters/claudeCodeAdapter.test.ts index 17555a5..ab2ee95 100644 --- a/src/adapters/claudeCodeAdapter.test.ts +++ b/src/adapters/claudeCodeAdapter.test.ts @@ -77,13 +77,14 @@ function makeBuildOptions(overrides: Partial = {}): ExecBuildO } describe("claudeCodeAdapter.buildExec", () => { - it("builds the streaming invocation with -p prompt and verbose stream-json", async () => { + it("builds the streaming invocation with -p (prompt via stdin) and verbose stream-json", async () => { const inv = await claudeCodeAdapter.buildExec(makeBuildOptions()); expect(inv.cliPath).toBe("claude"); - expect(inv.args.slice(0, 2)).toEqual(["-p", "do the thing"]); + expect(inv.args[0]).toBe("-p"); expect(inv.args).toContain("stream-json"); expect(inv.args).toContain("--verbose"); - expect(inv.stdinPayload).toBeUndefined(); + expect(inv.args).not.toContain("do the thing"); + expect(inv.stdinPayload).toBe("do the thing"); }); it("uses plain json without --verbose when not streaming", async () => { diff --git a/src/adapters/claudeCodeAdapter.ts b/src/adapters/claudeCodeAdapter.ts index b2e4a93..9a5e720 100644 --- a/src/adapters/claudeCodeAdapter.ts +++ b/src/adapters/claudeCodeAdapter.ts @@ -226,7 +226,6 @@ export const claudeCodeAdapter: CliAdapter = { buildExec(opts: ExecBuildOptions): Promise { const args = [ "-p", - opts.prompt, "--output-format", opts.streaming ? "stream-json" : "json", ]; @@ -256,7 +255,7 @@ export const claudeCodeAdapter: CliAdapter = { args.push("--permission-mode", "bypassPermissions"); } - return Promise.resolve({ cliPath: opts.settings.claudeCliPath, args }); + return Promise.resolve({ cliPath: opts.settings.claudeCliPath, args, stdinPayload: opts.prompt }); }, parseExecOutput(stdout: string, stderr: string, streaming: boolean): ExecParseResult { diff --git a/src/adapters/types.ts b/src/adapters/types.ts index 24d1a01..bd21b52 100644 --- a/src/adapters/types.ts +++ b/src/adapters/types.ts @@ -27,9 +27,8 @@ export interface ExecBuildOptions { export interface ExecInvocation { cliPath: string; args: string[]; - /** Written to stdin right after spawn, then stdin is closed. Codex takes - * the prompt this way (positional `-`) to dodge argv length limits; - * Claude takes the prompt via `-p` and needs nothing on stdin. */ + /** Written to stdin right after spawn, then stdin is closed. Both adapters + * use this to dodge OS argv length limits (Windows: 32 767 chars). */ stdinPayload?: string; }