PrepareNextTurnHook typedef

PrepareNextTurnHook = FutureOr<AgentLoopTurnUpdate?> Function(NextTurnContext context)

Called after turn_end and before the loop decides whether another provider request should start (pi's prepareNextTurn).

Return an AgentLoopTurnUpdate to replace the context and/or model for the next turn in this run; return null to keep the current ones.

Implementation

typedef PrepareNextTurnHook =
    FutureOr<AgentLoopTurnUpdate?> Function(NextTurnContext context);