queue

package
v0.0.142 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollapsedThinkText

func CollapsedThinkText(thinks []types.AgentEvent) string

CollapsedThinkText joins prefix think event text with spaces.

func ConsumedEvents

func ConsumedEvents(batch Batch) []types.AgentEvent

ConsumedEvents returns all AgentEvents served for one breakpoint dequeue.

func DelayFor added in v0.0.142

func DelayFor(events []types.AgentEvent) time.Duration

DelayFor is the sum of DelayMs on events (sleep events and delay_ms on others).

func SleepFor added in v0.0.142

func SleepFor(events []types.AgentEvent)

SleepFor sleeps DelayFor(events). No-op when the sum is 0.

Types

type Batch

type Batch struct {
	PrefixSleep []types.AgentEvent
	PrefixThink []types.AgentEvent
	Breakpoint  types.AgentEvent
}

Batch is the slice consumed for one HTTP serve: leading sleep/think events plus one breakpoint.

func DequeueToBreakpoint

func DequeueToBreakpoint(queue *[]types.AgentEvent) (batch Batch, ok bool)

DequeueToBreakpoint pops leading sleep and think events and exactly one tool_call or message breakpoint. Sleep events are consumed (not a breakpoint). If the queue holds only sleep/think (no breakpoint), nothing is consumed and ok is false.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL