Skip to content

refactor(agents): KG-815. Tool agent event context carries the original exception#1918

Merged
sdubov merged 1 commit intodevelopfrom
sdubov/KG-815
May 1, 2026
Merged

refactor(agents): KG-815. Tool agent event context carries the original exception#1918
sdubov merged 1 commit intodevelopfrom
sdubov/KG-815

Conversation

@sdubov
Copy link
Copy Markdown
Collaborator

@sdubov sdubov commented Apr 28, 2026

  • Tool agent event context contains a serializable AIAgentError instance. This type hides important details about an exception, e.g., the exact type of the exception. Replaced this serializable type with a Throwable instead and transform to AIAgentError when needed;
  • Renamed throwable to error on Agent/Node/Subgraph failed contexts and pipeline parameters for consistency across lifecycle events;
  • Switched onToolValidationFailed and onToolCallFailed pipeline signatures to accept Throwable;
  • Added a custom serializer for ToolResultKind.Failure / ValidationError that encodes a Throwable through AIAgentError, preserving the existing JSON wire format;
  • Updated OpenTelemetry span and metric helpers to take Throwable directly, fixing a latent error.type attribute that always reported AIAgentError as the exception class;

closes: KG-815

@sdubov sdubov requested review from EugeneTheDev and Rizzen April 28, 2026 10:54
@sdubov sdubov self-assigned this Apr 28, 2026
@sdubov sdubov added the refactoring Code improvements that enhance structure, readability, and quality without changing functionality label Apr 28, 2026
@sdubov sdubov force-pushed the sdubov/KG-814 branch 2 times, most recently from 0fe9e8b to 00bf54a Compare April 30, 2026 14:24
Base automatically changed from sdubov/KG-814 to develop April 30, 2026 15:05
@sdubov sdubov force-pushed the sdubov/KG-815 branch 4 times, most recently from 4965472 to 05edbc7 Compare May 1, 2026 09:11
…al exception

- Tool agent event context contains a serializable AIAgentError instance. This type hides important details about an exception, e.g., the exact type of the exception. Replaced this serializable type with a Throwable instead and transform to AIAgentError when needed;
- Renamed `throwable` to `error` on Agent/Node/Subgraph failed contexts and pipeline parameters for consistency across lifecycle events;
- Switched `onToolValidationFailed` and `onToolCallFailed` pipeline signatures to accept Throwable;
- Added a custom serializer for ToolResultKind.Failure / ValidationError that encodes a Throwable through AIAgentError, preserving the existing JSON wire format;
- Updated OpenTelemetry span and metric helpers to take Throwable directly, fixing a latent `error.type` attribute that always reported AIAgentError as the exception class;
- Restored disabled annotation for Debugger tests.
@sdubov sdubov merged commit e40dc81 into develop May 1, 2026
29 of 31 checks passed
@sdubov sdubov deleted the sdubov/KG-815 branch May 1, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code improvements that enhance structure, readability, and quality without changing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants