Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/src/orchestration-v2/Orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8033,7 +8033,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
events,
effects,
projection,
modelSelection: projection.thread.modelSelection,
modelSelection: queuedRun.modelSelection,
targetRunId: command.targetRunId,
messageId: queuedMessage.id,
text: queuedMessage.text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,48 @@ it.effect("keeps a held commentary draft before the steer when turn end flushes
),
);

it.effect("steers a promoted queued message with the selection it was queued with", () =>
Effect.scoped(
Effect.gen(function* () {
const { started, steered, layer, startFirstTurn } = yield* nextTurnSelectionHarness(
"promote-queued-selection",
);
yield* Effect.gen(function* () {
const orchestrator = yield* Orchestrator.OrchestratorV2;
const worker = yield* EffectWorker.OrchestrationEffectWorkerV2;
const threadId = yield* startFirstTurn;
yield* orchestrator.dispatch({
type: "message.dispatch",
commandId: CommandId.make("queued"),
threadId,
messageId: MessageId.make("message:queued"),
text: "queued",
attachments: [],
modelSelection: composerSelection,
dispatchMode: { type: "queue_after_active" },
createdBy: "user",
creationSource: "web",
});
const queuedRun = (yield* orchestrator.getThreadProjection(threadId)).runs.find(
(run) => run.status === "queued",
)!;
yield* orchestrator.dispatch({
type: "queued-message.promote-to-steer",
commandId: CommandId.make("promote"),
threadId,
queuedRunId: queuedRun.id,
targetRunId: started[0]!.runId,
});
yield* worker.drain();

const projection = yield* orchestrator.getThreadProjection(threadId);
assert.deepEqual(steered, ["queued"]);
assert.deepEqual(projection.thread.modelSelection, composerSelection);
}).pipe(Effect.provide(layer));
}),
),
);

it.effect("keeps a queued message queued when promoted into a run that Stop reached", () =>
Effect.scoped(
Effect.gen(function* () {
Expand Down
Loading