diff --git a/src/agents/subagent-registry-completion.test.ts b/src/agents/subagent-registry-completion.test.ts index 484830cd3132..8077f6cf9eef 100644 --- a/src/agents/subagent-registry-completion.test.ts +++ b/src/agents/subagent-registry-completion.test.ts @@ -55,23 +55,23 @@ describe("emitSubagentEndedHookOnce", () => { it("treats timing differences as different only after both outcomes have timing", () => { expect( - mod.runOutcomesEqual( + mod.shouldUpdateRunOutcome( { status: "timeout", startedAt: 1_000, endedAt: 2_000, elapsedMs: 1_000 }, { status: "timeout", startedAt: 1_000, endedAt: 2_500, elapsedMs: 1_500 }, ), - ).toBe(false); + ).toBe(true); expect( - mod.runOutcomesEqual( + mod.shouldUpdateRunOutcome( { status: "error", error: "boom", startedAt: 1_000, endedAt: 2_000, elapsedMs: 1_000 }, { status: "error", error: "boom", startedAt: 1_000, endedAt: 2_000, elapsedMs: 1_000 }, ), - ).toBe(true); + ).toBe(false); expect( - mod.runOutcomesEqual( + mod.shouldUpdateRunOutcome( { status: "ok", startedAt: 1_000, endedAt: 2_000, elapsedMs: 1_000 }, { status: "ok" }, ), - ).toBe(true); + ).toBe(false); expect( mod.shouldUpdateRunOutcome( { status: "ok" }, diff --git a/src/agents/subagent-registry-completion.ts b/src/agents/subagent-registry-completion.ts index 2db9ca2e5b3e..30d1b43fd76d 100644 --- a/src/agents/subagent-registry-completion.ts +++ b/src/agents/subagent-registry-completion.ts @@ -19,7 +19,7 @@ import type { SubagentRunRecord } from "./subagent-registry.types.js"; const log = createSubsystemLogger("agents/subagent-registry-completion"); /** Compares subagent run outcomes, treating missing timing as compatible. */ -export function runOutcomesEqual( +function runOutcomesEqual( a: SubagentRunOutcome | undefined, b: SubagentRunOutcome | undefined, ): boolean { @@ -44,7 +44,7 @@ export function runOutcomesEqual( } /** Returns true when an outcome carries timing fields. */ -export function runOutcomeHasTiming(outcome: SubagentRunOutcome | undefined): boolean { +function runOutcomeHasTiming(outcome: SubagentRunOutcome | undefined): boolean { return ( Number.isFinite(outcome?.startedAt) || Number.isFinite(outcome?.endedAt) ||