Skip to content

Commit 282206f

Browse files
committed
fix(server): queued delegated completions keep a newer model choice
A delegated-task completion is queued with no selection of its own, so its run stores a copy of the thread's selection. Starting on that copy reverted a model change made while the notice waited. Queued delegated completions now follow the thread's current selection and conversation, as queued PR-watch updates do since #21314.
1 parent 39a6731 commit 282206f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ function followsCurrentConversation(
658658
message: OrchestrationV2ConversationMessage | undefined,
659659
): boolean {
660660
return (
661-
message?.notification?.source.kind === "monitor" && !isBufferedProviderNotification(message)
661+
message?.delegatedCompletion !== undefined ||
662+
(message?.notification?.source.kind === "monitor" && !isBufferedProviderNotification(message))
662663
);
663664
}
664665

@@ -667,7 +668,6 @@ function queuedRunModelSelection(
667668
run: OrchestrationV2Run,
668669
): ModelSelection {
669670
const message = projection.messages.find((candidate) => candidate.id === run.userMessageId);
670-
// App-owned monitor updates follow the agent currently handling the thread.
671671
return followsCurrentConversation(message)
672672
? projection.thread.modelSelection
673673
: run.modelSelection;

0 commit comments

Comments
 (0)