Skip to main content

compact_when_turn_ends

Function compact_when_turn_ends 

Source
async fn compact_when_turn_ends(
    state: AppState,
    block_id: String,
    message: String,
    container: bool,
)
Expand description

Send message as AgentMux’s own turn once block_id’s turn has ended. A container agent’s turn is not waited for: it runs one turn at a time from a queue, and the compaction is placed at the head of that queue, so it starts the moment the turn in flight ends and ahead of the messages already waiting. Waiting for a moment with no turn running could take as long as the queue stays full, and the compaction would then go behind it (the queue is never empty for a busy agent: the next waiting message starts the moment a turn ends).