Skip to content
TypeScript

perf(server): avoid full thread reads on turn start (#10108)

Theo Browne17490c0a00a6
diff --git a/apps/server/src/checkpointing/CheckpointDiffQuery.test.ts b/apps/server/src/checkpointing/CheckpointDiffQuery.test.ts
index d05ca5ec854..c9f51403780 100644
--- a/apps/server/src/checkpointing/CheckpointDiffQuery.test.ts
+++ b/apps/server/src/checkpointing/CheckpointDiffQuery.test.ts
@@ -109,6 +109,7 @@ describe("CheckpointDiffQuery.layer", () => {
});
}),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.succeed(Option.none()),
getThreadDetailById: () => Effect.succeed(Option.none()),
getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
@@ -207,6 +208,7 @@ describe("CheckpointDiffQuery.layer", () => {
getThreadCheckpointContext: () => Effect.succeed(Option.some(threadCheckpointContext)),
getFullThreadDiffContext: () => Effect.die("unused"),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.succeed(Option.none()),
getThreadDetailById: () => Effect.succeed(Option.none()),
getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
@@ -295,6 +297,7 @@ describe("CheckpointDiffQuery.layer", () => {
getThreadCheckpointContext: () => Effect.succeed(Option.some(threadCheckpointContext)),
getFullThreadDiffContext: () => Effect.die("unused"),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.succeed(Option.none()),
getThreadDetailById: () => Effect.succeed(Option.none()),
getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
@@ -368,6 +371,7 @@ describe("CheckpointDiffQuery.layer", () => {
getThreadCheckpointContext: () => Effect.succeed(Option.some(threadCheckpointContext)),
getFullThreadDiffContext: () => Effect.die("unused"),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.succeed(Option.none()),
getThreadDetailById: () => Effect.succeed(Option.none()),
getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
@@ -426,6 +430,7 @@ describe("CheckpointDiffQuery.layer", () => {
getThreadCheckpointContext: () => Effect.succeed(Option.none()),
getFullThreadDiffContext: () => Effect.succeed(Option.none()),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.succeed(Option.none()),
getThreadDetailById: () => Effect.succeed(Option.none()),
getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
diff --git a/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts b/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts
index abfb49b5305..2c426c5ee5d 100644
--- a/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts
+++ b/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts
@@ -422,6 +422,7 @@ describe("OrchestrationEngine", () => {
getThreadCheckpointContext: () => Effect.succeed(Option.none()),
getFullThreadDiffContext: () => Effect.succeed(Option.none()),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.succeed(Option.none()),
getThreadDetailById: () => Effect.succeed(Option.none()),
getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
diff --git a/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.ts b/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.ts
index a1b351de353..2e0a3c3459a 100644
--- a/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.ts
+++ b/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.ts
@@ -1,5 +1,6 @@
import {
type AgentSessionImportSource,
+ ChatAttachment,
CheckpointRef,
EventId,
MessageId,
@@ -12,6 +13,7 @@ import { assert, it } from "@effect/vitest";
import * as NodeServices from "@effect/platform-node/NodeServices";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
+import * as Option from "effect/Option";
import * as Schema from "effect/Schema";
import * as SqlClient from "effect/unstable/sql/SqlClient";
@@ -31,6 +33,9 @@ const asTurnId = (value: string): TurnId => TurnId.make(value);
const asMessageId = (value: string): MessageId => MessageId.make(value);
const asEventId = (value: string): EventId => EventId.make(value);
const asCheckpointRef = (value: string): CheckpointRef => CheckpointRef.make(value);
+const encodeChatAttachments = Schema.encodeEffect(
+ Schema.fromJsonString(Schema.Array(ChatAttachment)),
+);
const projectionSnapshotLayer = it.layer(
OrchestrationProjectionSnapshotQueryLive.pipe(
@@ -598,6 +603,142 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
}),
);
+ it.effect("reads one turn-start message without decoding unrelated history", () =>
+ Effect.gen(function* () {
+ const query = yield* ProjectionSnapshotQuery;
+ const sql = yield* SqlClient.SqlClient;
+ const threadId = ThreadId.make("thread-turn-start-read");
+ const messageId = MessageId.make("message-turn-start-read");
+ const createdAt = "2026-09-05T00:00:00.000Z";
+ const attachments = [
+ {
+ type: "file" as const,
+ id: "notes",
+ name: "notes.txt",
+ mimeType: "text/plain",
+ sizeBytes: 8,
+ },
+ ];
+ const attachmentsJson = yield* encodeChatAttachments(attachments);
+ yield* sql`
+ WITH RECURSIVE history(n) AS (
+ VALUES (1) UNION ALL SELECT n + 1 FROM history WHERE n < 2000
+ )
+ INSERT INTO projection_thread_messages (
+ message_id, thread_id, turn_id, role, text, attachments_json,
+ is_streaming, created_at, updated_at
+ )
+ SELECT 'turn-start-history:' || n, ${threadId}, 'old-turn:' || n, 'assistant',
+ 'Unrelated assistant output', 'not-json', 0, ${createdAt}, ${createdAt}
+ FROM history
+ `;
+ yield* sql`
+ INSERT INTO projection_thread_messages (
+ message_id, thread_id, role, text, attachments_json, is_streaming, created_at, updated_at
+ ) VALUES (${messageId}, ${threadId}, 'user', 'Read these notes',
+ ${attachmentsJson}, 0, ${createdAt}, ${createdAt})
+ `;
+ yield* sql`
+ INSERT INTO projection_thread_messages (
+ message_id, thread_id, role, text, attachments_json, is_streaming, created_at, updated_at
+ ) VALUES ('turn-start-unrelated-user', 'thread-turn-start-unrelated', 'user', 'Unrelated prompt',
+ 'not-json', 0, ${createdAt}, ${createdAt})
+ `;
+
+ const counter = makeSqlStatementCounter();
+ const context = yield* query
+ .getTurnStartMessage({ threadId, messageId })
+ .pipe(Effect.withTracer(counter.tracer));
+ assert.equal(counter.count(), 1);
+ assert.deepEqual(
+ context,
+ Option.some({
+ message: {
+ id: messageId,
+ role: "user",
+ text: "Read these notes",
+ turnId: null,
+ streaming: false,
+ createdAt,
+ updatedAt: createdAt,
+ attachments,
+ },
+ hasOtherUserMessages: false,
+ }),
+ );
+ assert.equal(
+ (yield* query.getTurnStartMessage({
+ threadId: ThreadId.make("thread-turn-start-unrelated"),
+ messageId,
+ }))._tag,
+ "None",
+ );
+ assert.equal(
+ (yield* query.getTurnStartMessage({ threadId, messageId: MessageId.make("missing") }))._tag,
+ "None",
+ );
+ }).pipe(
+ Effect.ensuring(
+ Effect.gen(function* () {
+ const sql = yield* SqlClient.SqlClient;
+ yield* sql`
+ DELETE FROM projection_thread_messages
+ WHERE thread_id IN ('thread-turn-start-read', 'thread-turn-start-unrelated')
+ `;
+ }).pipe(Effect.orDie),
+ ),
+ ),
+ );
+
+ it.effect("keeps compaction and queued-message eligibility in the turn-start query", () =>
+ Effect.gen(function* () {
+ const query = yield* ProjectionSnapshotQuery;
+ const sql = yield* SqlClient.SqlClient;
+ const threadId = ThreadId.make("thread-turn-start-eligibility");
+ const messageId = MessageId.make("message-turn-start-eligibility");
+ const createdAt = "2026-09-05T00:00:00.000Z";
+ yield* sql`
+ INSERT INTO projection_thread_messages (
+ message_id, thread_id, role, text, is_streaming, created_at, updated_at
+ ) VALUES (${messageId}, ${threadId}, 'user', 'Start a turn', 0, ${createdAt}, ${createdAt})
+ `;
+ yield* sql`
+ INSERT INTO projection_thread_messages (
+ message_id, thread_id, role, text, attachments_json, is_streaming, created_at, updated_at
+ ) VALUES ('turn-start-other-user', ${threadId}, 'user', '/compact', NULL, 0,
+ '2026-09-05T00:00:01.000Z', '2026-09-05T00:00:01.000Z')
+ `;
+
+ for (const { text, attachments, hasOtherUserMessages } of [
+ { text: "/compact", attachments: null, hasOtherUserMessages: false },
+ {
+ text: "\t\n\r /CoMpAcT\u00a0\u2028\ufeff",
+ attachments: "[ ]",
+ hasOtherUserMessages: false,
+ },
+ { text: "/compact keep recent errors", attachments: "[]", hasOtherUserMessages: true },
+ { text: "", attachments: null, hasOtherUserMessages: true },
+ { text: "Queued prompt", attachments: null, hasOtherUserMessages: true },
+ {
+ text: "/compact",
+ attachments:
+ '[{"type":"file","id":"notes","name":"notes.txt","mimeType":"text/plain","sizeBytes":8}]',
+ hasOtherUserMessages: true,
+ },
+ ]) {
+ yield* sql`
+ UPDATE projection_thread_messages SET text = ${text}, attachments_json = ${attachments}
+ WHERE message_id = 'turn-start-other-user'
+ `;
+ const context = yield* query.getTurnStartMessage({ threadId, messageId });
+ assert.equal(context._tag, "Some");
+ if (context._tag === "Some") {
+ assert.equal(context.value.hasOtherUserMessages, hasOtherUserMessages);
+ }
+ }
+ }),
+ );
+
it.effect("keeps archived threads out of the main shell snapshot", () =>
Effect.gen(function* () {
const snapshotQuery = yield* ProjectionSnapshotQuery;
diff --git a/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts b/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
index 86e0b94573d..d9f4526e9e6 100644
--- a/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
+++ b/apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
@@ -91,6 +91,9 @@ const THREAD_DETAIL_ACTIVITY_LIMIT = 500;
// Snapshot payloads are decoded and projected in small sequential batches so
// one client read does not retain the raw payloads for the full activity window.
const THREAD_DETAIL_ACTIVITY_PAYLOAD_BATCH_SIZE = 25;
+// SQLite trim defaults to spaces. Match the whitespace removed by String.trim.
+const MESSAGE_TRIM_WHITESPACE =
+ "\t\n\v\f\r \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff";
const ProjectionProjectDbRowSchema = ProjectionProject.mapFields(
Struct.assign({
defaultModelSelection: Schema.NullOr(Schema.fromJsonString(ModelSelection)),
@@ -105,6 +108,9 @@ const ProjectionThreadMessageDbRowSchema = ProjectionThreadMessage.mapFields(
attachments: Schema.NullOr(Schema.fromJsonString(Schema.Array(ChatAttachment))),
}),
);
+const ProjectionTurnStartMessageDbRowSchema = ProjectionThreadMessageDbRowSchema.mapFields(
+ Struct.assign({ hasOtherUserMessages: Schema.Number }),
+);
const ProjectionThreadProposedPlanDbRowSchema = ProjectionThreadProposedPlan;
const ProjectionThreadDbRowSchema = ProjectionThread.mapFields(
Struct.assign({
@@ -180,6 +186,10 @@ const ProjectionImportedAgentSessionSourcesRowSchema = Schema.Struct({
const ThreadIdLookupInput = Schema.Struct({
threadId: ThreadId,
});
+const TurnStartMessageLookupInput = Schema.Struct({
+ threadId: ThreadId,
+ messageId: MessageId,
+});
const ThreadActivityKindsLookupInput = Schema.Struct({
threadId: ThreadId,
activityKinds: Schema.Array(Schema.String),
@@ -1117,6 +1127,37 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
),
});
+ const getTurnStartMessageRow = SqlSchema.findOneOption({
+ Request: TurnStartMessageLookupInput,
+ Result: ProjectionTurnStartMessageDbRowSchema,
+ execute: ({ threadId, messageId }) => sql`
+ SELECT
+ message_id AS "messageId",
+ thread_id AS "threadId",
+ turn_id AS "turnId",
+ role,
+ text,
+ attachments_json AS "attachments",
+ is_streaming AS "isStreaming",
+ created_at AS "createdAt",
+ updated_at AS "updatedAt",
+ EXISTS (
+ SELECT 1
+ FROM projection_thread_messages AS other
+ WHERE other.thread_id = ${threadId}
+ AND other.message_id != ${messageId}
+ AND other.role = 'user'
+ AND (
+ LOWER(TRIM(other.text, ${MESSAGE_TRIM_WHITESPACE})) != '/compact'
+ OR COALESCE(json_array_length(other.attachments_json), 0) > 0
+ )
+ ) AS "hasOtherUserMessages"
+ FROM projection_thread_messages
+ WHERE thread_id = ${threadId} AND message_id = ${messageId}
+ LIMIT 1
+ `,
+ });
+
const listThreadMessageRowsByThread = SqlSchema.findAll({
Request: ThreadIdLookupInput,
Result: ProjectionThreadMessageDbRowSchema,
@@ -2887,6 +2928,32 @@ pending_approval_requests AS (
}));
});
+ const getTurnStartMessage: ProjectionSnapshotQueryShape["getTurnStartMessage"] = Effect.fn(
+ "ProjectionSnapshotQuery.getTurnStartMessage",
+ )(function* (input) {
+ const message = yield* getTurnStartMessageRow(input).pipe(
+ Effect.mapError(
+ toPersistenceSqlOrDecodeError(
+ "ProjectionSnapshotQuery.getTurnStartMessage:query",
+ "ProjectionSnapshotQuery.getTurnStartMessage:decodeRow",
+ ),
+ ),
+ );
+ return Option.map(message, (row) => ({
+ message: {
+ id: row.messageId,
+ role: row.role,
+ text: row.text,
+ turnId: row.turnId,
+ streaming: row.isStreaming === 1,
+ createdAt: row.createdAt,
+ updatedAt: row.updatedAt,
+ ...(row.attachments !== null ? { attachments: row.attachments } : {}),
+ },
+ hasOtherUserMessages: row.hasOtherUserMessages === 1,
+ }));
+ });
+
// Contiguous turn range bounding a windowed detail read; undefined loads the
// full thread. Resolved from a window request inside the snapshot
// transaction (see getThreadDetailSnapshot).
@@ -3326,6 +3393,7 @@ pending_approval_requests AS (
getFullThreadDiffContext,
getThreadShellById,
getThreadRuntimeContext,
+ getTurnStartMessage,
getThreadDetailById,
getThreadDetailSnapshot,
} satisfies ProjectionSnapshotQueryShape;
diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
index a8b26fe52cb..d93fec5a3cf 100644
--- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
+++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
@@ -909,6 +909,48 @@ describe("ProviderCommandReactor", () => {
}),
);
+ effectIt.effect("starts a turn and generates its title without loading old message bodies", () =>
+ Effect.gen(function* () {
+ const started = yield* Deferred.make<void>();
+ const titleGenerated = yield* Deferred.make<void>();
+ const harness = yield* Effect.promise(() =>
+ createHarness({
+ unreadableHistory: true,
+ startSessionEffect: (session) =>
+ Deferred.succeed(started, undefined).pipe(Effect.as(session)),
+ }),
+ );
+ harness.generateThreadTitle.mockReturnValue(
+ Deferred.succeed(titleGenerated, undefined).pipe(Effect.as({ title: "Generated title" })),
+ );
+ yield* harness.engine.dispatch({
+ type: "thread.turn.start",
+ commandId: CommandId.make("cmd-turn-start-with-old-history"),
+ threadId: ThreadId.make("thread-1"),
+ message: {
+ messageId: MessageId.make("message-turn-start-with-old-history"),
+ role: "user",
+ text: "Use the current message",
+ attachments: [],
+ },
+ titleSeed: "Thread",
+ interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
+ runtimeMode: "approval-required",
+ createdAt: "2026-01-01T00:00:01.000Z",
+ });
+ yield* Deferred.await(started);
+ yield* Deferred.await(titleGenerated);
+ yield* Effect.promise(() => harness.drain());
+
+ expect(harness.sendTurn).toHaveBeenCalledWith(
+ expect.objectContaining({ input: "Use the current message" }),
+ );
+ expect(harness.generateThreadTitle).toHaveBeenCalledWith(
+ expect.objectContaining({ message: "Use the current message" }),
+ );
+ }),
+ );
+
effectIt.effect("rejects /compact without conversation context", () =>
Effect.gen(function* () {
const harness = yield* Effect.promise(() => createHarness());
diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
index fc963bcc9cb..5c1086b9e29 100644
--- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
+++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
@@ -1188,12 +1188,15 @@ const make = Effect.gen(function* () {
return;
}
- const thread = yield* resolveThreadDetail(event.payload.threadId);
+ const thread = yield* resolveThreadShell(event.payload.threadId);
if (!thread) {
return;
}
- const message = thread.messages.find((entry) => entry.id === event.payload.messageId);
- if (!message || message.role !== "user") {
+ const turnStart = yield* projectionSnapshotQuery.getTurnStartMessage({
+ threadId: thread.id,
+ messageId: event.payload.messageId,
+ });
+ if (Option.isNone(turnStart) || turnStart.value.message.role !== "user") {
yield* appendProviderFailureActivity({
threadId: event.payload.threadId,
kind: "provider.turn.start.failed",
@@ -1205,6 +1208,7 @@ const make = Effect.gen(function* () {
});
return;
}
+ const { message, hasOtherUserMessages } = turnStart.value;
const appendTurnStartFailure = (summary: string, detail: string) =>
appendProviderFailureActivity({
threadId: event.payload.threadId,
@@ -1297,10 +1301,7 @@ const make = Effect.gen(function* () {
yield* ensureThreadWorktree(thread);
const isCompactCommand = isCompactCommandMessage(message);
- const nonCompactUserMessageCount = thread.messages.filter(
- (entry) => entry.role === "user" && !isCompactCommandMessage(entry),
- ).length;
- if (nonCompactUserMessageCount === 1 && !isCompactCommand) {
+ if (!hasOtherUserMessages && !isCompactCommand) {
const project = yield* resolveProject(thread.projectId);
const generationCwd =
resolveThreadWorkspaceCwd({
@@ -1371,7 +1372,7 @@ const make = Effect.gen(function* () {
),
);
if (isCompactCommand) {
- if (nonCompactUserMessageCount === 0) {
+ if (!hasOtherUserMessages) {
return yield* appendTurnStartFailure(
"Context compaction failed",
"Context compaction requires an existing conversation.",
diff --git a/apps/server/src/orchestration/Services/ProjectionSnapshotQuery.ts b/apps/server/src/orchestration/Services/ProjectionSnapshotQuery.ts
index 37bcc1ae8f3..35d5bacc239 100644
--- a/apps/server/src/orchestration/Services/ProjectionSnapshotQuery.ts
+++ b/apps/server/src/orchestration/Services/ProjectionSnapshotQuery.ts
@@ -10,7 +10,9 @@ import type {
AgentSessionImportSource,
ApprovalRequestId,
CheckpointRef,
+ MessageId,
OrchestrationCheckpointSummary,
+ OrchestrationMessage,
OrchestrationProject,
OrchestrationProjectShell,
OrchestrationReadModel,
@@ -211,6 +213,21 @@ export interface ProjectionSnapshotQueryShape {
ProjectionRepositoryError
>;
+ /**
+ * Read one requested message and whether another non-compaction user message exists.
+ * Newer queued messages count too, preserving first-turn title eligibility.
+ */
+ readonly getTurnStartMessage: (input: {
+ readonly threadId: ThreadId;
+ readonly messageId: MessageId;
+ }) => Effect.Effect<
+ Option.Option<{
+ readonly message: OrchestrationMessage;
+ readonly hasOtherUserMessages: boolean;
+ }>,
+ ProjectionRepositoryError
+ >;
+
/**
* Read a single active thread detail snapshot by id.
*/
diff --git a/apps/server/src/project/AgentSessionScanner.test.ts b/apps/server/src/project/AgentSessionScanner.test.ts
index dc6d72a0ce6..aee64cf4b5d 100644
--- a/apps/server/src/project/AgentSessionScanner.test.ts
+++ b/apps/server/src/project/AgentSessionScanner.test.ts
@@ -58,6 +58,7 @@ const makeProjectionSnapshotQueryLayer = (importedWorkspaceRoots: ReadonlyArray<
getFullThreadDiffContext: () => Effect.die("unused"),
getThreadShellById: () => Effect.die("unused"),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadDetailById: () => Effect.die("unused"),
getThreadDetailSnapshot: () => Effect.die("unused"),
searchThreads: () => Effect.die("unused"),
diff --git a/apps/server/src/project/ProjectSetupScriptRunner.test.ts b/apps/server/src/project/ProjectSetupScriptRunner.test.ts
index 225458d7142..3a8c3ad71e6 100644
--- a/apps/server/src/project/ProjectSetupScriptRunner.test.ts
+++ b/apps/server/src/project/ProjectSetupScriptRunner.test.ts
@@ -46,6 +46,7 @@ const makeProjectionSnapshotQueryLayer = (project: OrchestrationProject) =>
getThreadCheckpointContext: () => Effect.die("unused"),
getFullThreadDiffContext: () => Effect.die("unused"),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.die("unused"),
getThreadDetailById: () => Effect.die("unused"),
getThreadDetailSnapshot: () => Effect.die("unused"),
diff --git a/apps/server/src/provider/Layers/ProviderService.test.ts b/apps/server/src/provider/Layers/ProviderService.test.ts
index fecd7fca909..0342f3ca79e 100644
--- a/apps/server/src/provider/Layers/ProviderService.test.ts
+++ b/apps/server/src/provider/Layers/ProviderService.test.ts
@@ -4330,6 +4330,7 @@ describe("agent browser access", () => {
Layer.provide(runtimeRepositoryLayer),
);
const projectionLayer = Layer.succeed(ProjectionSnapshotQuery.ProjectionSnapshotQuery, {
+ getTurnStartMessage: () => Effect.die("unused"),
getImportedAgentSessionSources: () => Effect.die("unused"),
getUserInputActivity: () => Effect.die("unused"),
getCommandReadModel: () => Effect.die("unused"),
diff --git a/apps/server/src/provider/Layers/ProviderSessionReaper.test.ts b/apps/server/src/provider/Layers/ProviderSessionReaper.test.ts
index c680a8228e3..4998f710c29 100644
--- a/apps/server/src/provider/Layers/ProviderSessionReaper.test.ts
+++ b/apps/server/src/provider/Layers/ProviderSessionReaper.test.ts
@@ -221,6 +221,7 @@ describe("ProviderSessionReaper", () => {
getThreadCheckpointContext: () => Effect.die("unused"),
getFullThreadDiffContext: () => Effect.die("unused"),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: (threadId) =>
Effect.succeed(
input.readModel.threads.find((thread) => thread.id === threadId)
diff --git a/apps/server/src/serverRuntimeStartup.test.ts b/apps/server/src/serverRuntimeStartup.test.ts
index 88e3c2e8858..0426df44bce 100644
--- a/apps/server/src/serverRuntimeStartup.test.ts
+++ b/apps/server/src/serverRuntimeStartup.test.ts
@@ -171,6 +171,7 @@ it.effect("resolveAutoBootstrapWelcomeTargets returns existing project and threa
getThreadCheckpointContext: () => Effect.succeed(Option.none()),
getFullThreadDiffContext: () => Effect.succeed(Option.none()),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.die("unused"),
getThreadDetailById: () => Effect.die("unused"),
getThreadDetailSnapshot: () => Effect.die("unused"),
@@ -257,6 +258,7 @@ it.effect.each([
getThreadCheckpointContext: () => Effect.succeed(Option.none()),
getFullThreadDiffContext: () => Effect.succeed(Option.none()),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.die("unused"),
getThreadDetailById: () => Effect.die("unused"),
getThreadDetailSnapshot: () => Effect.die("unused"),
@@ -325,6 +327,7 @@ it.effect(
getThreadCheckpointContext: () => Effect.succeed(Option.none()),
getFullThreadDiffContext: () => Effect.succeed(Option.none()),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.die("unused"),
getThreadDetailById: () => Effect.die("unused"),
getThreadDetailSnapshot: () => Effect.die("unused"),
@@ -386,6 +389,7 @@ it.effect("resolveAutoBootstrapWelcomeTargets preserves typed UUID generation fa
getThreadCheckpointContext: () => Effect.succeed(Option.none()),
getFullThreadDiffContext: () => Effect.succeed(Option.none()),
getThreadRuntimeContext: () => Effect.die("unused"),
+ getTurnStartMessage: () => Effect.die("unused"),
getThreadShellById: () => Effect.die("unused"),
getThreadDetailById: () => Effect.die("unused"),
getThreadDetailSnapshot: () => Effect.die("unused"),