MCPcopy Create free account
hub / github.com/apache/maka / reserveGenerationRun

Method reserveGenerationRun

packages/runtime/src/runtime-kernel.ts:3027–3042  ·  view source on GitHub ↗
(active: BackendGeneration, run: AgentRun)

Source from the content-addressed store, hash-verified

3025 }
3026
3027 private reserveGenerationRun(active: BackendGeneration, run: AgentRun): void {
3028 if (
3029 active.phase !== 'active' ||
3030 this.backendGenerations.get(active.generation) !== active ||
3031 !this.isCurrentGeneration(active)
3032 ) {
3033 throw new Error(
3034 `Backend generation ${active.generation} no longer owns activation for session ${active.sessionId}`,
3035 );
3036 }
3037 if (active.activeRuns.has(run.runId) || active.turnToRunId.has(run.turnId)) {
3038 throw new Error(`Backend generation ${active.generation} already reserved this Run identity`);
3039 }
3040 active.activeRuns.set(run.runId, run);
3041 active.turnToRunId.set(run.turnId, run.runId);
3042 }
3043
3044 private assertRunCanDispatch(run: AgentRun, backend: AgentBackend): void {
3045 const active = [...this.backendGenerations.values()].find(

Callers 2

reserveParentRunMethod · 0.95
reserveChildRunMethod · 0.95

Calls 4

isCurrentGenerationMethod · 0.95
getMethod · 0.65
hasMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected