(
execution: PendingExecutionClaim,
active: BackendGeneration,
run: AgentRun,
)
| 557 | } |
| 558 | |
| 559 | private reserveExecutionClaim( |
| 560 | execution: PendingExecutionClaim, |
| 561 | active: BackendGeneration, |
| 562 | run: AgentRun, |
| 563 | ): void { |
| 564 | if (execution.phase !== 'attached' || execution.run !== run) { |
| 565 | throw new Error(`Execution claim does not own attached Run ${run.runId}`); |
| 566 | } |
| 567 | try { |
| 568 | if (execution.stopIntent) { |
| 569 | this.claimRunForStop(execution.sessionId, execution.stopIntent.input, active, run); |
| 570 | } |
| 571 | } catch (error) { |
| 572 | this.unregisterRun(active, run); |
| 573 | execution.phase = 'failed'; |
| 574 | this.settleExecutionClaim(execution, { ok: false, error }); |
| 575 | throw error; |
| 576 | } |
| 577 | execution.phase = 'reserved'; |
| 578 | } |
| 579 | |
| 580 | private settleReservedExecutionClaim( |
| 581 | execution: PendingExecutionClaim, |
no test coverage detected