Skip to main content

Class: RunManager

Defined in: packages/orchestration/src/run/run-manager.ts:184

Runs tickets on agents. A run is a core run at the local place (startLocalRun): core drives the agent, owns its identity and journal, its cancel and its yield. This manager is the place's record: it admits the run (budgets, concurrency slots, the ticket claim), keeps the run and its events in the RunStore, heartbeats it, and settles the ticket from how the drive ended.

Constructors​

Constructor​

new RunManager(runStore, ticketStore, registry, events, costs, options?): RunManager

Defined in: packages/orchestration/src/run/run-manager.ts:195

Parameters​

runStore​

RunStore

ticketStore​

TicketStore

registry​

AgentRegistry

events​

EventBus<OrchestrationEventMap>

costs​

CostTracker

options?​

RunManagerOptions = {}

Returns​

RunManager

Accessors​

slotStore​

Get Signature​

get slotStore(): SlotStore

Defined in: packages/orchestration/src/run/run-manager.ts:208

Returns​

SlotStore

Methods​

cancel()​

cancel(runId): Promise<void>

Defined in: packages/orchestration/src/run/run-manager.ts:653

Cancel a running run; throws when it is not running.

Parameters​

runId​

string

Returns​

Promise<void>


getActive()​

getActive(): Map<string, { run: Run; }>

Defined in: packages/orchestration/src/run/run-manager.ts:676

The runs this instance is executing, by id.

Returns​

Map<string, { run: Run; }>


getActiveCount()​

getActiveCount(): number

Defined in: packages/orchestration/src/run/run-manager.ts:680

Returns​

number


isLocal()​

isLocal(runId): boolean

Defined in: packages/orchestration/src/run/run-manager.ts:213

Whether this instance is executing the run.

Parameters​

runId​

string

Returns​

boolean


resumeQuestion()​

resumeQuestion(question): Promise<Run>

Defined in: packages/orchestration/src/run/run-manager.ts:604

Resume a claimed question now; a host may retry this after a dispatch failure.

Parameters​

question​

HumanQuestion

Returns​

Promise<Run>


spawn()​

spawn(ticket, agentName, spawnOptions?): Promise<Run>

Defined in: packages/orchestration/src/run/run-manager.ts:310

Run ticket on agentName: claim it, drive the agent with every stream event persisted and emitted (run.event), then settle the run and its ticket. Resolves when the run has completed, paused, yielded, failed or been cancelled.

Parameters​

ticket​

Ticket

agentName​

string

spawnOptions?​
parentRunId?​

string

Returns​

Promise<Run>


tryCancel()​

tryCancel(runId): Promise<boolean>

Defined in: packages/orchestration/src/run/run-manager.ts:658

Cancel the run if it is still running; false when it had already ended.

Parameters​

runId​

string

Returns​

Promise<boolean>