fix(core): call tool-level onEnd once on errors

JE
1d ago
+49-8

Summary

  • remove the duplicated tool-level onEnd invocation in the tool execution error path
  • add a regression test for failing tools
  • add a patch changeset for @voltagent/core

Testing

  • pnpm --filter @voltagent/core exec vitest run src/agent/agent.spec.ts --reporter=default

With issues #1536


Summary by cubic

Fixes the tool-level onEnd hook being called twice when a tool execution fails in @voltagent/core.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed tool-level onEnd hooks so they are called exactly once when tool execution fails.