Module: LLM::Intercept::Rescue
- Includes:
- Rescue
- Defined in:
- lib/llm/intercept/rescue.rb
Overview
The Rescue module prepends itself to every subclass of LLM::Intercept and ensures that an intercept callback never crashes an agent.
When an error occurs, it is dumped to standard error and the tool call is allowed through. But LLM::Interrupt, and any other exception not covered by the 'ERRORS' constant can crash the intercept. So it handles most cases but not all, and LLM::Interrupt travelling up the stack is intentional.