Problem
I have a code agent that can have multiple reasons to stop mid-run (critical tool fail, user initiated stop, etc...). I would to be able to stop the agent and return a message based on what lead the agent to stop instead of a generic "Agent interrupted."
Proposed solution
Maybe the interrupt() method could be extended to accept an optional string that would be put inside the AgentError exception instead of the default "Agent interrupted."
Is this not possible with the current options.
Right now, we can stop an agent with the agent.interrupt() method. This method however does not take any argument, and it is therefore not possible to indicate the "reason" we are stopping the agent.
Checklist
Problem
I have a code agent that can have multiple reasons to stop mid-run (critical tool fail, user initiated stop, etc...). I would to be able to stop the agent and return a message based on what lead the agent to stop instead of a generic "Agent interrupted."
Proposed solution
Maybe the
interrupt()method could be extended to accept an optional string that would be put inside theAgentErrorexception instead of the default "Agent interrupted."Is this not possible with the current options.
Right now, we can stop an agent with the
agent.interrupt()method. This method however does not take any argument, and it is therefore not possible to indicate the "reason" we are stopping the agent.Checklist