-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathpi-args.test.ts
More file actions
33 lines (29 loc) · 1.07 KB
/
pi-args.test.ts
File metadata and controls
33 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { buildPiArgs } from "./pi-args.ts";
describe("buildPiArgs session wiring", () => {
it("uses --session when sessionFile is provided", () => {
const { args } = buildPiArgs({
baseArgs: ["-p"],
task: "hello",
sessionEnabled: true,
sessionFile: "/tmp/forked-session.jsonl",
sessionDir: "/tmp/should-not-be-used",
});
assert.ok(args.includes("--session"));
assert.ok(args.includes("/tmp/forked-session.jsonl"));
assert.ok(!args.includes("--session-dir"), "--session-dir should not be emitted with --session");
assert.ok(!args.includes("--no-session"), "--no-session should not be emitted with --session");
});
it("keeps fresh mode behavior (sessionDir + no session file)", () => {
const { args } = buildPiArgs({
baseArgs: ["-p"],
task: "hello",
sessionEnabled: true,
sessionDir: "/tmp/subagent-sessions",
});
assert.ok(args.includes("--session-dir"));
assert.ok(args.includes("/tmp/subagent-sessions"));
assert.ok(!args.includes("--session"));
});
});