feat: select errors that will be caught when raised within a tool#5488
feat: select errors that will be caught when raised within a tool#5488wistuba wants to merge 3 commits intomicrosoft:mainfrom
Conversation
| def schema(self) -> ToolSchema: ... | ||
|
|
||
| @property | ||
| def return_errors(self) -> tuple[type[Exception], ...] | type[Exception]: ... |
There was a problem hiding this comment.
Let's rename it return_error_types? This makes it align with the return_type property that already exists.
Let's also add API doc comment to each field of Tool and BaseTool as a good Samaritan 😄
There was a problem hiding this comment.
Let's also add API doc comment to each field of Tool and BaseTool as a good Samaritan
Not sure what you mean by this. Do you want me to add docstrings to every function in Tool/BaseTool?
There was a problem hiding this comment.
Yes. I was asking if you would be willing to add the docstrings.
|
I think there was some confusion on the Issue regarding what this feature should do. Do we want to keep adding the error types to the Tool or is there now a preference to add it to the agent? Former has the advantage that you can deal differently with each tool, latter allows you to only define it once and it is applied automatically for every tool. |
|
So sorry I am going back-and-forth here. My initial thought for #5274 is that we want to configure how However, I think there could be some issues:
So I am more inclined to configure how the errors raised from So, we need to update However, I do think we need to wait for a bit because it is an important API change, and overlaps with concepts discussed in #4721. Let's wait on this PR and consider multiple ideas together. |
|
My proposal is to pass the |
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) SummaryThis PR adds the ability to specify which exception types should be caught and forwarded to the agent when a tool execution fails, rather than catching all ArchitectureThe design is clean and fits the existing codebase well. The Issues1.
|
Conversation starter to agree on the implementation. When we are aligned, I'll add tests.
Why are these changes needed?
Not every tool error should be returned to the agent. This change allows to cherry-pick which exceptions we want to share with the agent.
Related issue number
Closes: #5274
Checks