Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Stop reaches background commands older than the recent window #16867

Closedvoltcrash(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/16867/headopened View on GitHub

Showing 9 changed files with 156 additions and 0 deletions (loading 8).

x
0 of 9 viewed, 9 left
156 additions and 0 deletionsapps/server/src/orchestration-v2/ProjectionStore.test.tsModified
View file
@@ -37,12 +37,15 @@
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
import * as ProjectionStore from "./ProjectionStore.ts";
import {
+ boundedTimelineEncodedBytes,
buildBoundedThreadProjection,
decodeThreadHistoryCursor,
selectHistoryPageFromCursor,
THREAD_HISTORY_PAGE_POLICY,
} from "./threadHistoryPaging.ts";
​
+import { projectThreadProjectionForWire } from "./WireProjection.ts";
+​
const layerTest = Layer.mergeAll(
ProjectionStore.layer.pipe(Layer.provideMerge(SqlitePersistence.layerMemory)),
SqlitePersistence.layerMemory,
@@ -1263,6 +1266,159 @@
+ it.effect("retains only actionable old work with bounded output until it settles", () =>
+ Effect.gen(function* () {
+ const store = yield* ProjectionStore.ProjectionStoreV2;
+ const sql = yield* SqlClient.SqlClient;
+ const threadId = yield* addRolledBackRecoveryCandidate("old-background-command");
+ const original = yield* store.getThreadProjection(threadId);
+ const now = original.updatedAt;
+ const nowIso = DateTime.formatIso(now);
+ yield* store.apply({