pub struct WorkItem<P> {
pub agent_id: AgentId,
pub prompt: P,
pub step: CycleStep,
pub prefix_hash: u64,
pub model: String,
pub queued_at: Instant,
pub token_count: u32,
}Expand description
A unit of work: one agent’s prompt for one cycle step.
The P type parameter is the prompt type — typically
misanthropic::Prompt<'static> but kept generic for testability.
Fields§
§agent_id: AgentIdWhich agent this work item belongs to.
prompt: PThe prompt to submit to the backend.
step: CycleStepWhich cycle step this represents.
prefix_hash: u64Hash of the cacheable prefix (system prompt, tools, constitution). Items with the same prefix_hash should be batched together for cache efficiency.
model: StringModel identifier (e.g. “claude-opus-4-6”, “cogito:14b”).
queued_at: InstantWhen this item was queued. Used for starvation prevention.
token_count: u32Approximate token count for the full prompt (from token count API). Used for context-length bucketing on Ollama.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for WorkItem<P>where
P: Freeze,
impl<P> RefUnwindSafe for WorkItem<P>where
P: RefUnwindSafe,
impl<P> Send for WorkItem<P>where
P: Send,
impl<P> Sync for WorkItem<P>where
P: Sync,
impl<P> Unpin for WorkItem<P>where
P: Unpin,
impl<P> UnsafeUnpin for WorkItem<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for WorkItem<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more