Skip to content

Commit 8ec0842

Browse files
d-csclaude
andcommitted
fix(run-engine): scope getSnapshotsSince anchor lookup to the polled run
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 63fcdf8 commit 8ec0842

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
Snapshot polling now rejects a since-snapshot id that doesn't belong to the run being polled,
7+
instead of using its timestamp to return a too-wide window of the run's snapshots.

internal-packages/run-engine/src/engine/systems/executionSnapshotSystem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export async function getExecutionSnapshotsSince(
274274
): Promise<EnhancedExecutionSnapshot[]> {
275275
// Step 1: Find the createdAt of the sinceSnapshotId
276276
const sinceSnapshot = await prisma.taskRunExecutionSnapshot.findFirst({
277-
where: { id: sinceSnapshotId },
277+
where: { id: sinceSnapshotId, runId },
278278
select: { createdAt: true },
279279
});
280280

0 commit comments

Comments
 (0)