Skip to content

Commit e1b5345

Browse files
test(server): interactive fresh sends are still refused while background work runs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 0c17a7b commit e1b5345

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎apps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,6 +3005,23 @@ describe("orchestration v2 provider switching", () => {
30053005
// The previous run left a background command or subagent behind.
30063006
yield* Ref.set(backgroundWork, true);
30073007

3008+
// Someone sending from the client is still told to wait or press Stop.
3009+
const refused = yield* orchestrator
3010+
.dispatch({
3011+
type: "message.dispatch",
3012+
createdBy: "user",
3013+
creationSource: "web",
3014+
commandId: CommandId.make("command:fresh-context:scheduled:interactive"),
3015+
threadId: scheduledThreadId,
3016+
messageId: MessageId.make("message:fresh-context:scheduled:interactive"),
3017+
text: "Prompt interactive",
3018+
attachments: [],
3019+
freshContext: true,
3020+
dispatchMode: { type: "start_immediately" },
3021+
})
3022+
.pipe(Effect.flip);
3023+
assert.include(String(refused.cause), "a fresh session would end them");
3024+
30083025
// Nobody watches a scheduled fire to wait or press Stop, so refusing it stalls the schedule.
30093026
yield* fire("beta");
30103027
yield* worker.drain();

0 commit comments

Comments
 (0)