GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): provider switches hand off started cancelled runs (#34016) · AIdoesmyjob/t3code@d756fed

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/orchestration-v2
    • Orchestrator.ts
    • testkit
      • ProviderSwitch.integration.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Orchestrator.ts
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,13 @@ function rootProviderThreadsForProvider(
11011101
}
11021102

11031103
function isHandoffSourceRun(run: OrchestrationV2Run): boolean {
1104-
return run.status === "completed" || run.status === "failed" || run.status === "interrupted";
1104+
return (
1105+
run.status === "completed" ||
1106+
run.status === "failed" ||
1107+
run.status === "interrupted" ||
1108+
// A queued request cancelled before it started never reached any provider.
1109+
(run.status === "cancelled" && run.startedAt !== null)
1110+
);
11051111
}
11061112

11071113
function lastDeliveredRunForProviderThread(
Collapse file

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

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function makeTestAdapter(input: {
114114
readonly failure?: ReturnType<typeof makeProviderFailure>;
115115
readonly failedRunOrdinals?: ReadonlySet<number>;
116116
readonly interruptedRunOrdinals?: ReadonlySet<number>;
117+
readonly cancelledRunOrdinals?: ReadonlySet<number>;
117118
readonly holdRunOrdinal?: number;
118119
readonly pendingBackgroundWork?: Ref.Ref<boolean>;
119120
readonly subagentOnlyBackgroundWork?: boolean;
@@ -295,7 +296,9 @@ function makeTestAdapter(input: {
295296
? "failed"
296297
: input.interruptedRunOrdinals?.has(turnInput.runOrdinal)
297298
? "interrupted"
298-
: "completed";
299+
: input.cancelledRunOrdinals?.has(turnInput.runOrdinal)
300+
? "cancelled"
301+
: "completed";
299302
const response =
300303
input.responseByThreadId?.[turnInput.threadId]?.[turnInput.runOrdinal] ??
301304
input.responseByRunOrdinal[turnInput.runOrdinal] ??
@@ -1587,6 +1590,8 @@ describe("orchestration v2 provider switching", () => {
15871590
["failed", true, true, true],
15881591
["interrupted", false, true, false],
15891592
["interrupted", true, false, true],
1593+
["cancelled", false, false, false],
1594+
["cancelled", true, true, false],
15901595
] as const
15911596
).map(
15921597
([status, queued, returning, native]) =>
@@ -1631,6 +1636,7 @@ describe("orchestration v2 provider switching", () => {
16311636
interruptedRunOrdinals: new Set(
16321637
status === "interrupted" ? [sourceOrdinal] : [],
16331638
),
1639+
cancelledRunOrdinals: new Set(status === "cancelled" ? [sourceOrdinal] : []),
16341640
holdRunOrdinal: sourceOrdinal,
16351641
holdFirstTurn: started,
16361642
releaseFirstTurn: release,
@@ -1644,7 +1650,7 @@ describe("orchestration v2 provider switching", () => {
16441650
const worker = yield* EffectWorker.OrchestrationEffectWorkerV2;
16451651
const waitForRun = (
16461652
ordinal: number,
1647-
expectedStatus: "completed" | "failed" | "interrupted",
1653+
expectedStatus: "completed" | "failed" | "interrupted" | "cancelled",
16481654
) =>
16491655
orchestrator.streamStoredEvents.pipe(
16501656
Stream.filter(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.