Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a fresh-session scheduled run no longer takes over the thread's conversation #36103

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/36103/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 132 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
132 additions and 0 deletionsapps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.tsModified
View file
@@ -3417,6 +3417,138 @@
+ it.live("keeps the user's conversation after a scheduled fresh run in the same thread", () =>
+ Effect.gen(function* () {
+ const cwd = yield* checkpointWorkspace("scheduled-fresh-user-chat");
+ const capturedTurns = yield* Ref.make<ReadonlyArray<CapturedTurn>>([]);
+ const layerRegistry = ProviderAdapterRegistry.layerFromAdapters([
+ makeTestAdapter({
+ instanceId: CLAUDE_MODEL_SELECTION.instanceId,
+ driver: CLAUDE_DRIVER,
+ capabilities: ClaudeProviderCapabilitiesV2,
+ modelSelection: CLAUDE_MODEL_SELECTION,
+ responseByRunOrdinal: {},
+ capturedTurns,
+ nativeThreadGeneration: yield* Ref.make(0),
+ }),
+ ]);
+ const threadId = ThreadId.make("thread:scheduled-fresh-user-chat");
+ yield* Effect.gen(function* () {
+ const orchestrator = yield* Orchestrator.OrchestratorV2;
+ const worker = yield* EffectWorker.OrchestrationEffectWorkerV2;
+ const send = (name: string, scheduled: boolean) =>
+ orchestrator.dispatch({
+ type: "message.dispatch",
+ createdBy: "user",
+ creationSource: "web",
+ commandId: CommandId.make(`command:scheduled-fresh-user-chat:${name}`),
+ threadId,