fix(server): let stopped threads settle immediately (#5553)
This commit is contained in:
1 parent
6da92244cc
commit
7aad7911f6
2 files changed
+9
-1
No files matched your search
@@ -1430,6 +1430,13 @@ it.layer(BaseTestLayer)("OrchestrationProjectionPipeline", (it) => {
|
||||
assert.deepEqual(settledRows, [
|
||||
{ state: "completed", completedAt: "2026-01-01T00:01:00.000Z" },
|
||||
]);
|
||||
|
||||
const threadRows = yield* sql<{ readonly latestTurnId: string | null }>`
|
||||
SELECT latest_turn_id AS "latestTurnId"
|
||||
FROM projection_threads
|
||||
WHERE thread_id = ${threadId}
|
||||
`;
|
||||
assert.deepEqual(threadRows, [{ latestTurnId: turnId }]);
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
@@ -850,7 +850,8 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti
|
||||
}
|
||||
yield* projectionThreadRepository.upsert({
|
||||
...existingRow.value,
|
||||
latestTurnId: event.payload.session.activeTurnId,
|
||||
// activeTurnId describes current work; a terminal session must not erase history.
|
||||
latestTurnId: event.payload.session.activeTurnId ?? existingRow.value.latestTurnId,
|
||||
updatedAt: event.occurredAt,
|
||||
});
|
||||
yield* refreshThreadShellSummary(event.payload.threadId);
|
||||
|
||||
Reference in new issue
Block a user