Skip to content

Commit e23910a

Browse files
fix(server): refine generic titles after the first completed run
1 parent b5bb08f commit e23910a

4 files changed

Lines changed: 399 additions & 142 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,6 +2557,17 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
25572557
cause: `Thread ${command.threadId} branch changed before the metadata update could be applied.`,
25582558
});
25592559
}
2560+
if (
2561+
command.type === "thread.metadata.update" &&
2562+
command.expectedTitle !== undefined &&
2563+
command.expectedTitle !== thread.title
2564+
) {
2565+
return yield* new OrchestratorDispatchError({
2566+
commandId: command.commandId,
2567+
commandType: command.type,
2568+
cause: `Thread ${command.threadId} title changed before the metadata update could be applied.`,
2569+
});
2570+
}
25602571
if (command.type === "thread.metadata.update" && command.expectedEmpty === true) {
25612572
const records = yield* projectionStore
25622573
.getThreadRecords(command.threadId, ["runs"])

0 commit comments

Comments
 (0)