MCPcopy Index your code
hub / github.com/coder/mux / shouldDeferBestOfFallback

Method shouldDeferBestOfFallback

src/node/services/taskService.ts:9974–10010  ·  view source on GitHub ↗
(params: {
    parentWorkspaceId: string;
    groupId: string;
    total: number;
  })

Source from the content-addressed store, hash-verified

9972 }
9973
9974 private async shouldDeferBestOfFallback(params: {
9975 parentWorkspaceId: string;
9976 groupId: string;
9977 total: number;
9978 }): Promise<boolean> {
9979 const parentTaskToolState = await this.getTaskToolPartialState(params.parentWorkspaceId);
9980 if (
9981 parentTaskToolState.pendingBestOfTaskToolCount !== 1 ||
9982 parentTaskToolState.pendingTaskToolCount !== 1
9983 ) {
9984 return false;
9985 }
9986
9987 const siblings = this.listBestOfSiblingTasks({
9988 parentWorkspaceId: params.parentWorkspaceId,
9989 groupId: params.groupId,
9990 });
9991 const hasRecoverableSibling = siblings.some((sibling) => {
9992 return (
9993 sibling.taskStatus === "queued" ||
9994 sibling.taskStatus === "starting" ||
9995 sibling.taskStatus === "running" ||
9996 sibling.taskStatus === "awaiting_report"
9997 );
9998 });
9999 if (hasRecoverableSibling) {
10000 return true;
10001 }
10002
10003 return (
10004 (await this.buildBestOfCompletedTaskToolOutput({
10005 parentWorkspaceId: params.parentWorkspaceId,
10006 groupId: params.groupId,
10007 total: params.total,
10008 })) != null
10009 );
10010 }
10011
10012 private async deliverReportToParent(
10013 parentWorkspaceId: string,

Tested by

no test coverage detected