RunSubmitter
The submission API (design 4.55): queue a run for a worker on any machine to take, wait for its ticket's terminal state, or follow its events, over a store's RunQueue and the Checkpointer of the same store. Every call is tenant-scoped (rule 9): a ticket is answered only to its own tenant.
Entries are submitted with settings.maxAttempts; the worker side (W2) takes them. The entries this API closes itself - one a cancel closes before it runs, an earlier unstarted Interrupt entry a new one closes - are counted on metrics as the worker counts its closes (llm4s.agent.queue.closed, design 4.59; W3): those the store reports this call closed (Ticket.interrupted, Cancellation.closed), so a close two racing calls both saw is counted once.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Entry entryId once it is closed, or as it is after timeout; QueueError.TicketExpired once it has been reclaimed. See RunQueue.awaitClosed.
Entry entryId once it is closed, or as it is after timeout; QueueError.TicketExpired once it has been reclaimed. See RunQueue.awaitClosed.
Attributes
Cancels target - one entry, or every open entry of a thread - for tenantId, from any machine (W3, design 4.57), and answers its entries as they are after: one not yet started is closed Cancelled(Requested(note)) before it runs; a running one is stopped by the worker holding it, which learns of the cancel when it next renews the entry's lease, waits for the run to exit, settles the thread and closes the entry - Cancelled, or with the run's own outcome if it reached rest first. await its ticket for the close. See RunQueue.cancel.
Cancels target - one entry, or every open entry of a thread - for tenantId, from any machine (W3, design 4.57), and answers its entries as they are after: one not yet started is closed Cancelled(Requested(note)) before it runs; a running one is stopped by the worker holding it, which learns of the cancel when it next renews the entry's lease, waits for the run to exit, settles the thread and closes the entry - Cancelled, or with the run's own outcome if it reached rest first. await its ticket for the close. See RunQueue.cancel.
Attributes
The service's delete of threadId for tenantId (W3, Stage 5 rule 4): it closes the thread's queued entries, cancels its running one - Cancelled(ThreadDeleted) - and waits up to timeout for every one of them to close, which the worker running one does only once its run has exited and the thread is settled; then it deletes the thread through runtime (GraphRuntime.deleteThread, which claims the thread and deletes its children first). An entry still open after timeout - its run has not exited - leaves the thread undeleted: GraphError.ThreadBusy, and calling again finishes it. An entry submitted meanwhile is marked by the delete itself and closes Cancelled(ThreadDeleted) without running (rule 4). Errors are the queue's, and the runtime's delete's.
The service's delete of threadId for tenantId (W3, Stage 5 rule 4): it closes the thread's queued entries, cancels its running one - Cancelled(ThreadDeleted) - and waits up to timeout for every one of them to close, which the worker running one does only once its run has exited and the thread is settled; then it deletes the thread through runtime (GraphRuntime.deleteThread, which claims the thread and deletes its children first). An entry still open after timeout - its run has not exited - leaves the thread undeleted: GraphError.ThreadBusy, and calling again finishes it. An entry submitted meanwhile is marked by the delete itself and closes Cancelled(ThreadDeleted) without running (rule 4). Errors are the queue's, and the runtime's delete's.
Attributes
The entry entryId of tenantId, as it is now.
The entry entryId of tenantId, as it is now.
Attributes
The next page of entry entryId's run events after thread event after (0 from the thread's first), at most limit, waiting up to timeout for a commit when there is nothing yet - through Checkpointer.awaitEventsAfter, so a run committed by a worker on another machine is followed as it lands - or for the entry to close, through RunQueue.awaitClosed, since a close commits no event: a follower is told it has finished as soon as the entry closes, not once timeout has passed. Pass each page's next to the next call until finished. limit below 1 is a ValidationError. Errors are the queue's for the ticket and the store's for the thread's log (GraphError.ReplayUnavailable, GraphError.ThreadDeleted).
The next page of entry entryId's run events after thread event after (0 from the thread's first), at most limit, waiting up to timeout for a commit when there is nothing yet - through Checkpointer.awaitEventsAfter, so a run committed by a worker on another machine is followed as it lands - or for the entry to close, through RunQueue.awaitClosed, since a close commits no event: a follower is told it has finished as soon as the entry closes, not once timeout has passed. Pass each page's next to the next call until finished. limit below 1 is a ValidationError. Errors are the queue's for the ticket and the store's for the thread's log (GraphError.ReplayUnavailable, GraphError.ThreadDeleted).
Attributes
Queues input for threadId, run by agentId for tenantId, and answers its ticket - or, with a submissionKey the tenant's queue already holds for the same submission, that entry's ticket. See RunQueue.submit. traceContext is the submitter's trace position, which every attempt continues (Submission.traceContext).
Queues input for threadId, run by agentId for tenantId, and answers its ticket - or, with a submissionKey the tenant's queue already holds for the same submission, that entry's ticket. See RunQueue.submit. traceContext is the submitter's trace position, which every attempt continues (Submission.traceContext).