pub async fn run_fighter_loop(
params: FighterLoopParams,
) -> PunchResult<FighterLoopResult>Expand description
Run the fighter loop: the core agent execution engine.
This function:
- Loads message history from the bout and repairs it
- Recalls relevant memories
- Builds the system prompt with context
- Applies context budget management before each LLM call
- Calls the LLM with available tools
- If the LLM requests tool use, executes tools and loops
- Handles empty responses, MaxTokens continuation, and errors
- Enforces loop guards against runaway iterations