test(orchestration-v2): make observability regressions explicit

This commit is contained in:
T3 Code Test committed 2026-08-14 15:04:13 +05:30
1 parent da996a85f9
commit 200bcc9d8c
3 files changed
+27 -5

No files matched your search

@@ -1298,6 +1298,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
const makeWakeHarnessWithOptions = (options?: {
readonly close?: (sdkMessages: Queue.Queue<SDKMessage>) => Effect.Effect<void>;
readonly interrupt?: Effect.Effect<void>;
readonly stopTask?: (taskId: string) => Effect.Effect<void>;
}) =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
@@ -1332,7 +1333,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
}),
setModel: () => Effect.void,
interrupt: options?.interrupt ?? Effect.void,
stopTask: () => Effect.void,
stopTask: options?.stopTask ?? (() => Effect.void),
close: options?.close?.(sdkMessages) ?? Effect.void,
}),
forkSession: () => Effect.die("unused forkSession"),
@@ -1386,11 +1387,29 @@ describe("ClaudeAdapterV2 background wake turns", () => {
it.effect("treats a stop after query release as already complete", () =>
Effect.scoped(
Effect.gen(function* () {
const harness = yield* makeWakeHarness;
const stoppedTaskIds = yield* Ref.make<ReadonlyArray<string>>([]);
const harness = yield* makeWakeHarnessWithOptions({
stopTask: (taskId) => Ref.update(stoppedTaskIds, (current) => [...current, taskId]),
});
if (harness.runtime.stopTask === undefined) {
return yield* Effect.die("Claude adapter runtime must expose stopTask.");
}
const now = yield* DateTime.now;
yield* harness.runtime.startTurn(
makeClaudeTestTurnInput({
threadId: harness.threadId,
providerThread: harness.providerThread,
now,
attemptId: RunAttemptId.make("attempt-claude-stop-after-release"),
text: "Start a query that will be released.",
attachments: [],
}),
);
yield* Queue.shutdown(harness.sdkMessages);
yield* awaitUntil(() => harness.terminalEvents().length === 1, "released query terminal");
yield* harness.runtime.stopTask({ nativeTaskId: WAKE_TASK_ID });
assert.deepEqual(yield* Ref.get(stoppedTaskIds), []);
}).pipe(Effect.provide(Layer.merge(idAllocatorLayer, NodeServices.layer))),
),
);
@@ -63,11 +63,14 @@ describe("subagent observability", () => {
it("bounds recent activity and deduplicates adjacent updates", () => {
const now = DateTime.makeUnsafe("2026-07-26T00:00:00.000Z");
const activity = Array.from({ length: 8 }, (_, index) => `step ${index}`).reduce(
const first = appendSubagentActivity([], "step 0", now);
const deduplicated = appendSubagentActivity(first, "step 0", now);
const activity = Array.from({ length: 7 }, (_, index) => `step ${index + 1}`).reduce(
(current, summary) => appendSubagentActivity(current, summary, now),
appendSubagentActivity([], "step 0", now),
deduplicated,
);
expect(deduplicated).toBe(first);
expect(activity).toHaveLength(6);
expect(activity.map((entry) => entry.summary)).toEqual([
"step 2",
@@ -1219,7 +1219,7 @@ describe("MessagesTimeline", () => {
expect(markup).not.toContain("Work Log");
});
it("keeps completed subagent detail in the Agents panel", async () => {
it("omits completed subagent detail from the timeline CTA", async () => {
const { MessagesTimeline } = await import("./MessagesTimeline");
const markup = renderToStaticMarkup(
<MessagesTimeline