test: finish pi-subagents rename and regression cleanup
This commit is contained in:
@@ -7,7 +7,7 @@ import { BUILTIN_AGENTS } from "./builtin-agents.ts";
|
||||
import { discoverAgents } from "./agents.ts";
|
||||
|
||||
test("discoverAgents returns built-ins and lets user markdown override by name", async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "tmux-subagent-agents-"));
|
||||
const root = await mkdtemp(join(tmpdir(), "pi-subagents-agents-"));
|
||||
const agentDir = join(root, "agent-home");
|
||||
const userAgentsDir = join(agentDir, "agents");
|
||||
await mkdir(userAgentsDir, { recursive: true });
|
||||
@@ -30,7 +30,7 @@ test("discoverAgents returns built-ins and lets user markdown override by name",
|
||||
});
|
||||
|
||||
test("discoverAgents lets project agents override user agents when scope is both", async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "tmux-subagent-agents-"));
|
||||
const root = await mkdtemp(join(tmpdir(), "pi-subagents-agents-"));
|
||||
const repo = join(root, "repo");
|
||||
const agentDir = join(root, "agent-home");
|
||||
const userAgentsDir = join(agentDir, "agents");
|
||||
|
||||
@@ -6,7 +6,7 @@ import { tmpdir } from "node:os";
|
||||
import { createRunArtifacts } from "./artifacts.ts";
|
||||
|
||||
test("createRunArtifacts writes metadata and reserves stable artifact paths", async () => {
|
||||
const cwd = await mkdtemp(join(tmpdir(), "tmux-subagent-run-"));
|
||||
const cwd = await mkdtemp(join(tmpdir(), "pi-subagents-run-"));
|
||||
|
||||
const artifacts = await createRunArtifacts(cwd, {
|
||||
runId: "run-1",
|
||||
|
||||
@@ -6,7 +6,7 @@ import { tmpdir } from "node:os";
|
||||
import { monitorRun } from "./monitor.ts";
|
||||
|
||||
test("monitorRun streams normalized events and resolves when result.json appears", async () => {
|
||||
const dir = await mkdtemp(join(tmpdir(), "tmux-subagent-monitor-"));
|
||||
const dir = await mkdtemp(join(tmpdir(), "pi-subagents-monitor-"));
|
||||
const eventsPath = join(dir, "events.jsonl");
|
||||
const resultPath = join(dir, "result.json");
|
||||
await writeFile(eventsPath, "", "utf8");
|
||||
|
||||
@@ -35,7 +35,7 @@ test("createTmuxSingleRunner always kills the pane after monitor completion", as
|
||||
test("createTmuxSingleRunner surfaces explicit tmux precondition errors", async () => {
|
||||
const runSingleTask = createTmuxSingleRunner({
|
||||
assertInsideTmux() {
|
||||
throw new Error("tmux-backed subagents require pi to be running inside tmux.");
|
||||
throw new Error("tmux runner requires pi to be running inside tmux.");
|
||||
},
|
||||
getCurrentWindowId: async () => "@1",
|
||||
createArtifacts: async () => ({
|
||||
@@ -55,6 +55,6 @@ test("createTmuxSingleRunner surfaces explicit tmux precondition errors", async
|
||||
|
||||
await assert.rejects(
|
||||
() => runSingleTask({ cwd: "/repo", meta: { task: "inspect auth" } as any }),
|
||||
/tmux-backed subagents require pi to be running inside tmux/,
|
||||
/tmux runner requires pi to be running inside tmux/,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -14,13 +14,13 @@ test("isInsideTmux reads the TMUX environment variable", () => {
|
||||
test("buildWrapperShellCommand single-quotes paths safely", () => {
|
||||
const command = buildWrapperShellCommand({
|
||||
nodePath: "/usr/local/bin/node",
|
||||
wrapperPath: "/repo/tmux-subagent/src/wrapper/cli.mjs",
|
||||
wrapperPath: "/repo/subagents/src/wrapper/cli.mjs",
|
||||
metaPath: "/repo/.pi/subagents/runs/run-1/meta.json",
|
||||
});
|
||||
|
||||
assert.equal(
|
||||
command,
|
||||
"'/usr/local/bin/node' '/repo/tmux-subagent/src/wrapper/cli.mjs' '/repo/.pi/subagents/runs/run-1/meta.json'",
|
||||
"'/usr/local/bin/node' '/repo/subagents/src/wrapper/cli.mjs' '/repo/.pi/subagents/runs/run-1/meta.json'",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user