Repository navigation
Python: preserve server RUN_ERROR code in AG-UI event conversion - #9772
Dhruv Shaswat (Dhruv-Sh-git) wants to merge 1 commit into
Conversation
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): e3420f5b623f
Model: gpt-5.6-sol
Overview
The change preserves meaningful server-provided RUN_ERROR.code values while retaining the existing "RUN_ERROR" fallback for events without a usable code. Direct converter and streaming client tests cover both the fallback and specific-code propagation, and the existing partial-tool invalidation path still intercepts terminal errors before conversion. No publishable Critical, High, or Medium issue was established.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
|
Dhruv Shaswat (@Dhruv-Sh-git), this pull request is waiting on your response. If there is no further activity within 4 days, it will be closed automatically. (This is an automated message.) |
Fixes #8828
Summary
When
AGUIEventConverterconverted aRUN_ERRORevent, it hard-codederror_code="RUN_ERROR", discarding any specific error code emitted by the server, such asAPPROVAL_INVOCATION_DISABLED,APPROVAL_RESUME_INVALID, orTimeoutError.This PR preserves the event's
codefield when present and falls back to"RUN_ERROR"when it is missing. This allowsAGUIChatClientcallers to inspect and handle specific error types.Changes
packages/ag-ui/agent_framework_ag_ui/_event_converters.py: Preserve the event'scodefield, falling back to"RUN_ERROR"when absent.packages/ag-ui/tests/ag_ui/test_event_converters.py: Add a regression test verifying that specific error codes are preserved.packages/ag-ui/tests/ag_ui/test_ag_ui_client.py: Add a streaming regression test verifying that the preserved error code is propagated in client updates.Validation
packages/ag-ui.