Skip to content

increase coverage of Toolbox#2258

Open
makomweb wants to merge 4 commits into
symfony:mainfrom
makomweb:increase_coverage
Open

increase coverage of Toolbox#2258
makomweb wants to merge 4 commits into
symfony:mainfrom
makomweb:increase_coverage

Conversation

@makomweb

Copy link
Copy Markdown
Contributor
Q A
Bug fix? no
New feature? no
Docs? no
Issues -
License MIT

This PR is to increase coverage of Toolbox code to 100%.
Only change in non-test code was in FaultTolerantToolbox to use the exceptions getToolCall method for full coverage. Side-note: Noticing this brought me to the idea to simplify the exception hierarchy of the Toolbox (see #2257 for details).


Before
grafik


After

grafik

@carsonbot carsonbot changed the title increase coverage of Toolbox increase coverage of Toolbox Jun 30, 2026
@makomweb makomweb changed the title increase coverage of Toolbox [Agent] increase coverage of Toolbox Jun 30, 2026
Comment on lines +41 to +42
} catch (ToolExecutionException $e) {
return new ToolResult($e->getToolCall(), $e->getToolCallResult());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a duplicate of line 43+44 since ToolExecutionException implements the ToolExecutionExceptionInterface

Comment on lines +45 to +49
} catch (ToolNotFoundException $e) {
$names = array_map(static fn (Tool $metadata) => $metadata->getName(), $this->getTools());

return new ToolResult(
$toolCall,
$e->getToolCall() ?? $toolCall,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

@chr-hertel chr-hertel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Martin, thanks for working on the test coverage here 👍
just have some questions about the changes in the prod code

@carsonbot carsonbot changed the title [Agent] increase coverage of Toolbox increase coverage of Toolbox Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants