Skip to content

Commit e0db659

Browse files
test(server): cover task ids that leave the Claude task directory
AI-assisted; verified with the tests and tools listed above.
1 parent f796488 commit e0db659

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/ClaudeTaskOutputTail.test.ts‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe("tailClaudeTaskOutput", () => {
129129
),
130130
);
131131

132-
it.effect("reads nothing when the session id leaves the Claude task directory", () =>
132+
it.effect("reads nothing when a session or task id leaves the Claude task directory", () =>
133133
Effect.scoped(
134134
Effect.gen(function* () {
135135
const fileSystem = yield* FileSystem.FileSystem;
@@ -145,13 +145,17 @@ describe("tailClaudeTaskOutput", () => {
145145
const chunks: Array<string> = [];
146146
const stop = yield* Deferred.make<void>();
147147
yield* Deferred.succeed(stop, undefined);
148-
yield* tailClaudeTaskOutput({
149-
root,
150-
sessionId: "../../outside",
151-
taskId: TASK_ID,
152-
stop,
153-
onChunk: (chunk) => Effect.sync(() => chunks.push(chunk)),
154-
});
148+
for (const ids of [
149+
{ sessionId: "../../outside", taskId: TASK_ID },
150+
{ sessionId: SESSION_ID, taskId: `../../../../outside/tasks/${TASK_ID}` },
151+
]) {
152+
yield* tailClaudeTaskOutput({
153+
root,
154+
...ids,
155+
stop,
156+
onChunk: (chunk) => Effect.sync(() => chunks.push(chunk)),
157+
});
158+
}
155159
assert.deepEqual(chunks, []);
156160
}),
157161
).pipe(Effect.provide(NodeServices.layer)),

0 commit comments

Comments
 (0)