Skip to content
This repository was archived by the owner on May 28, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/commands/agents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe("discoverAgents", () => {
id: "session-1",
agentName: "builder-test",
capability: "builder",
runtime: "claude",
worktreePath: join(tempDir, ".overstory", "worktrees", "builder-test"),
branchName: "overstory/builder-test/task-123",
taskId: "task-123",
Expand All @@ -109,6 +110,7 @@ describe("discoverAgents", () => {
lastActivity: "2024-01-01T00:01:00Z",
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};

Expand All @@ -129,6 +131,7 @@ describe("discoverAgents", () => {
id: "session-1",
agentName: "builder-test",
capability: "builder",
runtime: "claude",
worktreePath: join(tempDir, ".overstory", "worktrees", "builder-test"),
branchName: "overstory/builder-test/task-123",
taskId: "task-123",
Expand All @@ -142,13 +145,15 @@ describe("discoverAgents", () => {
lastActivity: "2024-01-01T00:01:00Z",
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};

const scout: AgentSession = {
id: "session-2",
agentName: "scout-test",
capability: "scout",
runtime: "claude",
worktreePath: join(tempDir, ".overstory", "worktrees", "scout-test"),
branchName: "overstory/scout-test/task-456",
taskId: "task-456",
Expand All @@ -162,6 +167,7 @@ describe("discoverAgents", () => {
lastActivity: "2024-01-01T00:01:00Z",
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};

Expand All @@ -182,6 +188,7 @@ describe("discoverAgents", () => {
id: "session-1",
agentName: "builder-working",
capability: "builder",
runtime: "claude",
worktreePath: join(tempDir, ".overstory", "worktrees", "builder-working"),
branchName: "overstory/builder-working/task-123",
taskId: "task-123",
Expand All @@ -195,13 +202,15 @@ describe("discoverAgents", () => {
lastActivity: "2024-01-01T00:01:00Z",
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};

const completed: AgentSession = {
id: "session-2",
agentName: "builder-completed",
capability: "builder",
runtime: "claude",
worktreePath: join(tempDir, ".overstory", "worktrees", "builder-completed"),
branchName: "overstory/builder-completed/task-456",
taskId: "task-456",
Expand All @@ -215,6 +224,7 @@ describe("discoverAgents", () => {
lastActivity: "2024-01-01T00:02:00Z",
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};

Expand Down
8 changes: 8 additions & 0 deletions src/commands/clean.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ describe("--all", () => {
id: "s1",
agentName: "test-agent",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt",
branchName: "overstory/test/task",
taskId: "task-1",
Expand All @@ -165,6 +166,7 @@ describe("--all", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
store.close();
Expand Down Expand Up @@ -297,6 +299,7 @@ describe("individual flags", () => {
id: "s1",
agentName: "test-agent",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt",
branchName: "overstory/test/task",
taskId: "task-1",
Expand All @@ -310,6 +313,7 @@ describe("individual flags", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
store.close();
Expand Down Expand Up @@ -419,6 +423,7 @@ describe("synthetic session-end events", () => {
id: "s1",
agentName: "test-builder",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt",
branchName: "overstory/test-builder/task-1",
taskId: "task-1",
Expand All @@ -432,6 +437,7 @@ describe("synthetic session-end events", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
...overrides,
};
Expand Down Expand Up @@ -671,6 +677,7 @@ describe("--agent", () => {
id: "s1",
agentName: "test-builder",
capability: "builder",
runtime: "claude",
worktreePath: join(tempDir, ".overstory", "worktrees", "test-builder"),
branchName: "overstory/test-builder/task-1",
taskId: "task-1",
Expand All @@ -684,6 +691,7 @@ describe("--agent", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
...overrides,
};
Expand Down
14 changes: 14 additions & 0 deletions src/commands/coordinator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ function makeCoordinatorSession(overrides: Partial<AgentSession> = {}): AgentSes
id: `session-${Date.now()}-coordinator`,
agentName: "coordinator",
capability: "coordinator",
runtime: "claude",
worktreePath: tempDir,
branchName: "main",
taskId: "",
Expand All @@ -310,6 +311,7 @@ function makeCoordinatorSession(overrides: Partial<AgentSession> = {}): AgentSes
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
...overrides,
};
Expand Down Expand Up @@ -2215,6 +2217,7 @@ describe("checkComplete", () => {
id: "s1",
agentName: "builder-1",
capability: "builder",
runtime: "claude",
worktreePath: tempDir,
branchName: "feat/x",
taskId: "t1",
Expand All @@ -2228,6 +2231,7 @@ describe("checkComplete", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};
store.upsert(base);
Expand Down Expand Up @@ -2267,6 +2271,7 @@ describe("checkComplete", () => {
id: "s1",
agentName: "builder-1",
capability: "builder",
runtime: "claude",
worktreePath: tempDir,
branchName: "feat/x",
taskId: "t1",
Expand All @@ -2280,6 +2285,7 @@ describe("checkComplete", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};
store.upsert(session);
Expand Down Expand Up @@ -2319,6 +2325,7 @@ describe("checkComplete", () => {
id: "coord",
agentName: "coordinator",
capability: "coordinator",
runtime: "claude",
worktreePath: tempDir,
branchName: "main",
taskId: "",
Expand All @@ -2332,13 +2339,15 @@ describe("checkComplete", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
// worker session that is completed
store.upsert({
id: "worker",
agentName: "builder-1",
capability: "builder",
runtime: "claude",
worktreePath: tempDir,
branchName: "feat/x",
taskId: "t1",
Expand All @@ -2352,6 +2361,7 @@ describe("checkComplete", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
} finally {
Expand Down Expand Up @@ -2480,6 +2490,7 @@ describe("checkComplete", () => {
id: "s1",
agentName: "lead-1",
capability: "lead",
runtime: "claude",
worktreePath: tempDir,
branchName: "overstory/lead-1/task-1",
taskId: "task-1",
Expand All @@ -2493,6 +2504,7 @@ describe("checkComplete", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
} finally {
Expand Down Expand Up @@ -2546,6 +2558,7 @@ describe("checkComplete", () => {
id: "s1",
agentName: "lead-1",
capability: "lead",
runtime: "claude",
worktreePath: tempDir,
branchName: "overstory/lead-1/task-1",
taskId: "task-1",
Expand All @@ -2559,6 +2572,7 @@ describe("checkComplete", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
} finally {
Expand Down
4 changes: 4 additions & 0 deletions src/commands/coordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,11 @@ async function startCoordinator(
if (await agentDefFile.exists()) {
appendSystemPromptFile = agentDefPath;
}
const runtimeSessionId = crypto.randomUUID();
const spawnCmd = runtime.buildSpawnCommand({
model: resolvedModel.model,
permissionMode: "bypass",
sessionId: runtimeSessionId,
cwd: projectRoot,
appendSystemPromptFile,
env: {
Expand Down Expand Up @@ -451,6 +453,7 @@ async function startCoordinator(
id: sessionId,
agentName: COORDINATOR_NAME,
capability: "coordinator",
runtime: runtime.id,
worktreePath: projectRoot, // Coordinator uses project root, not a worktree
branchName: config.project.canonicalBranch, // Operates on canonical branch
taskId: "", // No specific task assignment
Expand All @@ -464,6 +467,7 @@ async function startCoordinator(
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
};

Expand Down
10 changes: 10 additions & 0 deletions src/commands/costs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ describe("costsCommand", () => {
id: "sess-001",
agentName: "builder-1",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt1",
branchName: "feat/task1",
taskId: "task-001",
Expand All @@ -781,6 +782,7 @@ describe("costsCommand", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
sessionStore.close();
Expand Down Expand Up @@ -826,6 +828,7 @@ describe("costsCommand", () => {
id: "sess-001",
agentName: "builder-1",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt1",
branchName: "feat/task1",
taskId: "task-001",
Expand All @@ -839,6 +842,7 @@ describe("costsCommand", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
sessionStore.close();
Expand Down Expand Up @@ -892,6 +896,7 @@ describe("costsCommand", () => {
id: "sess-001",
agentName: "builder-1",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt1",
branchName: "feat/task1",
taskId: "task-001",
Expand All @@ -905,12 +910,14 @@ describe("costsCommand", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
sessionStore.upsert({
id: "sess-002",
agentName: "scout-1",
capability: "scout",
runtime: "claude",
worktreePath: "/tmp/wt2",
branchName: "feat/task2",
taskId: "task-002",
Expand All @@ -924,6 +931,7 @@ describe("costsCommand", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
sessionStore.close();
Expand Down Expand Up @@ -973,6 +981,7 @@ describe("costsCommand", () => {
id: "sess-001",
agentName: "builder-1",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt1",
branchName: "feat/task1",
taskId: "task-001",
Expand All @@ -986,6 +995,7 @@ describe("costsCommand", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
});
sessionStore.close();
Expand Down
4 changes: 4 additions & 0 deletions src/commands/dashboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ describe("renderAgentPanel", () => {
id: "sess-h1",
agentName: "headless-worker",
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt/headless",
branchName: "overstory/headless/task-1",
taskId: "task-h1",
Expand All @@ -441,6 +442,7 @@ describe("renderAgentPanel", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
},
],
Expand Down Expand Up @@ -468,6 +470,7 @@ describe("renderAgentPanel", () => {
id: "sess-h2",
agentName: "dead-headless", // short enough to not be truncated
capability: "builder",
runtime: "claude",
worktreePath: "/tmp/wt/dead-headless",
branchName: "overstory/dead-headless/task-2",
taskId: "task-h2",
Expand All @@ -481,6 +484,7 @@ describe("renderAgentPanel", () => {
lastActivity: new Date().toISOString(),
escalationLevel: 0,
stalledSince: null,
rateLimitedSince: null,
transcriptPath: null,
},
],
Expand Down
Loading