Skip to content

[Agent] Allow exposing some tool exceptions to the LLM #255

@valtzu

Description

@valtzu

Currently we always return the same static response in

return \sprintf('An error occurred while executing tool "%s".', $e->toolCall->name);

For example, if a tool execution is prevented due to AccessDeniedException, the LLM still sees this static error.

I think we could have some exception interface, like

interface ToolCallExceptionInterface 
{
    public function getToolCallResult(): ?string;
}

and then return that as tool call response instead of static message.

Use cases

  1. The AI agent would be able to tell the user "Sorry mate, permission denied to perform the requested action".
  2. The AI agent could auto-fix the issue of providing wrong parameters to the function call

Metadata

Metadata

Assignees

No one assigned

    Labels

    AgentIssues & PRs about the AI Agent componentFeatureNew featureRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions