MCPcopy
hub / github.com/coder/mux / ensureParallelSlot

Method ensureParallelSlot

src/node/services/taskService.ts:2960–2969  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2958 );
2959 const activeAgentCount = this.countActiveAgentTasks(cfg);
2960 const ensureParallelSlot = async (): Promise<Result<void, string>> => {
2961 const activeWorkspaceTurnCount = await this.countActiveWorkspaceTurns(allWorkspaceTurns);
2962 const activeCount = activeAgentCount + activeWorkspaceTurnCount;
2963 if (activeCount >= taskSettings.maxParallelAgentTasks) {
2964 return Err(
2965 `Task.createWorkspaceTurn: maxParallelAgentTasks exceeded (active=${activeCount}, max=${taskSettings.maxParallelAgentTasks})`
2966 );
2967 }
2968 return Ok(undefined);
2969 };
2970
2971 const handleId = `${WORKSPACE_TURN_TASK_ID_PREFIX}${this.config.generateStableId()}`;
2972 const turnId = this.config.generateStableId();

Callers

nothing calls this directly

Calls 3

ErrFunction · 0.90
OkFunction · 0.90

Tested by

no test coverage detected