BusyThreadPolicy
org.llm4s.agent.service.BusyThreadPolicy
@Experimental
enum BusyThreadPolicy
How a submission treats a thread that already has an open entry or a live run (Stage 5 W1 and W3, designs 4.55 and 4.57), reversing §5.3's "do not queue".
Reject, the default: refused withGraphError.ThreadBusywhile the thread has an open entry or a live claim - a run there, queued or direct, on any machine - as a direct run on a busy thread is refused (§5.3).Enqueue: waits behind the thread's running and queued entries, in submission order (W1's FIFO); behind a direct run, the worker that takes it waits for the run's claim.Interrupt: goes ahead of the thread's queued entries, which keep their order behind it, and asks the thread's running entry to stop at its next superstep boundary: its model call in flight is cut, tool calls already started finish and keep their results, none not yet started starts, the turn is closed with a synthetic "interrupted" result for each call left without one, and the entry closes EntryOutcome.Interrupted, not retried. Of twoInterruptentries the later goes first and the earlier is closedInterruptedbefore it runs (Stage 5 rule 5). A direct run is not interrupted - it is its owner's - so the entry waits for it, asEnqueuedoes.
A pending approval or question on the thread is not a busy thread, whatever the policy: the thread is at rest, and a queued start is refused by the runtime while the interrupts are pending (§5.3) - a resume is what answers them.
Attributes
- Graph
-
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article