Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): archived threads no longer start work after setup finishes #14907

ClosedLucenx9(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/14907/headopened View on GitHub

Showing 3 changed files with 137 additions and 0 deletions.

x
0 of 3 viewed, 3 left
59 additions and 0 deletionsapps/server/src/orchestration-v2/Orchestrator.control-reads.test.tsModified
View file
@@ -23,6 +23,7 @@
import * as SqlClient from "effect/unstable/sql/SqlClient";
import { SqlitePersistenceMemory } from "../persistence/Layers/Sqlite.ts";
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
+import * as EffectOutbox from "./EffectOutbox.ts";
import * as Orchestrator from "./Orchestrator.ts";
import * as ProjectionStore from "./ProjectionStore.ts";
import type { ProviderAdapterV2Shape } from "./ProviderAdapter.ts";
@@ -42,6 +43,7 @@
const testLayer = Layer.mergeAll(
database,
ProjectionStore.layer.pipe(Layer.provide(database)),
+ EffectOutbox.layer.pipe(Layer.provide(database)),
makeOrchestratorV2ReplayLayerWithRegistry(
{ name: "control-reads" },
ProviderAdapterRegistry.makeLayer([adapter]),
@@ -49,6 +51,63 @@
),
);
​
+for (const terminalCommand of ["thread.archive", "thread.delete"] as const) {
+ it.effect(`rejects prepared-run.release after ${terminalCommand}`, () =>
+ Effect.gen(function* () {
+ const orchestrator = yield* Orchestrator.OrchestratorV2;
+ const projections = yield* ProjectionStore.ProjectionStoreV2;
+ const outbox = yield* EffectOutbox.EffectOutboxV2;
+ const threadId = ThreadId.make("thread:terminal-preparation");
+ yield* orchestrator.dispatch({