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): 报告阻塞排队代理任务的前序请求 · pingdotgg/t3code@8120e11

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/mcp
    • OrchestratorMcpService.test.ts
    • OrchestratorMcpService.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/mcp/OrchestratorMcpService.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/mcp/OrchestratorMcpService.test.ts
+18-4Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,9 @@ describe("OrchestratorMcpService", () => {
357357
const childThreadId = ThreadId.make("thread:mcp-next-child");
358358
const taskId = NodeId.make("node:mcp-next-task");
359359
let finished = false;
360+
let queued = false;
360361
let pendingRequest = false;
361-
let requestOwner: "task" | "finished" | "unrelated" = "task";
362+
let requestOwner: "task" | "finished" | "unrelated" | "blocker" = "task";
362363
let pendingSecret = false;
363364
let secretCompleted = false;
364365
let secretOwner: "task" | "finished" | "unrelated" = "task";
@@ -383,8 +384,12 @@ describe("OrchestratorMcpService", () => {
383384
}) as unknown as OrchestrationV2ThreadProjection;
384385
const childRun = () => ({
385386
id: RunId.make("run:mcp-next-child"),
386-
ordinal: 1,
387-
status: finished ? ("completed" as const) : ("running" as const),
387+
ordinal: 2,
388+
status: finished
389+
? ("completed" as const)
390+
: queued
391+
? ("queued" as const)
392+
: ("running" as const),
388393
delegatedTaskId: taskId,
389394
});
390395
const childProjection = () =>
@@ -393,7 +398,8 @@ describe("OrchestratorMcpService", () => {
393398
runs: [
394399
childRun(),
395400
{ id: "run:finished", ordinal: 0, status: "completed" },
396-
{ id: "run:unrelated", ordinal: 2, status: "running" },
401+
{ id: "run:unrelated", ordinal: 3, status: "running" },
402+
...(queued ? [{ id: "run:blocker", ordinal: 1, status: "running" }] : []),
397403
],
398404
contextTransfers: [],
399405
messages: [],
@@ -492,6 +498,14 @@ describe("OrchestratorMcpService", () => {
492498
assert.isFalse(unrelated.hasPendingQuestion);
493499
assert.equal(unrelated.next, ORCHESTRATOR_MCP_RUNNING_TASK_NEXT);
494500
}
501+
queued = true;
502+
requestOwner = "blocker";
503+
const blocked = yield* service.taskStatus(scope, taskId);
504+
assert.isTrue(blocked.hasPendingQuestion);
505+
assert.notProperty(blocked, "next");
506+
requestOwner = "unrelated";
507+
assert.isFalse((yield* service.taskStatus(scope, taskId)).hasPendingQuestion);
508+
queued = false;
495509
requestOwner = "task";
496510
pendingRequest = false;
497511

Collapse file

‎apps/server/src/mcp/OrchestratorMcpService.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/mcp/OrchestratorMcpService.ts
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,14 +534,24 @@ function activeTaskRunIds(
534534
taskId: NodeId,
535535
originalRun: OrchestrationV2Run | undefined,
536536
) {
537+
const queuedOrdinal = child.runs.reduce(
538+
(last, run) =>
539+
run.status === "queued" &&
540+
(run.delegatedTaskId === taskId ||
541+
(run.delegatedTaskId === undefined && run.id === originalRun?.id))
542+
? Math.max(last, run.ordinal)
543+
: last,
544+
-1,
545+
);
537546
return new Set(
538547
child.runs
539548
.filter(
540549
(run) =>
541550
!ThreadManagementService.isTerminalRunStatus(run.status) &&
542551
(run.delegatedTaskId === taskId ||
543552
// Legacy tasks own only their original run, not later turns in the child thread.
544-
(run.delegatedTaskId === undefined && run.id === originalRun?.id)),
553+
(run.delegatedTaskId === undefined && run.id === originalRun?.id) ||
554+
(run.status !== "queued" && run.ordinal < queuedOrdinal)),
545555
)
546556
.map((run) => run.id),
547557
);

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.