# issue-24136 row6 proof — test commit 08b1f88a8b on ee96b4b5a2 ## Mutation (removed runId guard only) diff --git a/apps/server/src/orchestration-v2/Orchestrator.ts b/apps/server/src/orchestration-v2/Orchestrator.ts index 6f1eedd322..e9b846ce35 100644 --- a/apps/server/src/orchestration-v2/Orchestrator.ts +++ b/apps/server/src/orchestration-v2/Orchestrator.ts @@ -3080,7 +3080,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio // Checked here, not by the caller, so a newer run or a visit that lands // while the deferred mark is in flight still wins. markUnreadVisitedAt = - latestRun?.id === command.runId && + latestRun !== undefined && latestRun.status === "completed" && latestRunCompletedAt !== null && (thread.lastVisitedAt === null || ## RED (mutated, filter 'deferred mark-unread') [11:18:41.026] ERROR (#3098): Error [AssertionError]: expected DateTime.Utc(1970-01-01T00:00:03.999Z) to deeply equal DateTime.Utc(1970-01-01T00:00:03.500Z) expected: DateTime.Utc(1970-01-01T00:00:03.500Z), × keeps a visit when a deferred mark-unread lands after a newer run completed 60ms ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL src/orchestration-v2/runtimeLayer.test.ts > OrchestrationV2LayerLive lifecycle > keeps a visit when a deferred mark-unread lands after a newer run completed AssertionError: expected DateTime.Utc(1970-01-01T00:00:03.999Z) to deeply equal DateTime.Utc(1970-01-01T00:00:03.500Z) ❯ src/orchestration-v2/runtimeLayer.test.ts:4009:14 Test Files 1 failed (1) Tests 1 failed | 1 passed | 88 skipped (90) ## GREEN (restored implementation, full runtimeLayer.test.ts) Test Files 1 passed (1) Tests 90 passed (90) Duration 12.08s (tests 51%, import 31%, transform 17%, setup 1%)