Python: Sanitize workflow error messages - #8368
Evan Mattson (moonbox3) merged 3 commits into
Conversation
Keep workflow diagnostics server-side while preserving public error codes. Remove HTTP response body previews from declarative action exceptions and cover serialized workflow errors with regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Real executor failures currently produce three duplicate traceback logs, increasing alert noise and ingestion volume.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Sanitizes client-facing workflow errors while preserving server-side diagnostics and error codes.
Changes:
- Replaces internal AG-UI error details with a consistent public message.
- Removes HTTP response bodies from declarative action exceptions.
- Adds serialization, logging, and success-path regression tests.
File summaries
| File | Description |
|---|---|
python/packages/declarative/tests/test_http_request_executor.py |
Tests body sanitization and AG-UI serialization. |
python/packages/declarative/agent_framework_declarative/_workflows/_executors_http.py |
Removes response-body previews from errors. |
python/packages/ag-ui/tests/ag_ui/test_workflow_run.py |
Tests sanitized workflow and executor failures. |
python/packages/ag-ui/tests/ag_ui/golden/test_scenario_workflow.py |
Validates real executor failure behavior. |
python/packages/ag-ui/agent_framework_ag_ui/_workflow_run.py |
Sanitizes public errors and logs internal diagnostics. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): 2e673a81ecc5
Model: gpt-5.6-sol-fast
Overview
The PR consistently replaces client-facing workflow failure details with a generic message while preserving error codes and server-side diagnostics, and removes declarative HTTP response bodies from non-success exceptions. Structured, unexpected-stream, real-executor, and cross-package serialization tests cover the principal disclosure paths while retaining successful-response, cancellation, and response-header behavior. The review found no supported Critical, High, or Medium defect.
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.
Prefer one complete exception traceback when a workflow emits failure events and then re-raises. Retain a single structured diagnostic when no exception follows or the stream is closed early. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for the update. Before this is ready, could you please:
Once those are addressed, please re-request review. Thanks! |
Motivation & Context
Keep internal workflow diagnostics separate from client-facing AG-UI error messages while retaining useful error codes and server-side troubleshooting information.
Description & Review Guide
Related Issue
N/A.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.