Symptom
Upstream errors can contain provider response text. Providers sometimes quote request content in validation errors, so formatting the full error into a log or trace can expose prompts, source code, or other request data.
The handling is currently inconsistent. #611 removes this content from the inner libsy.client_call, libsy.llm_call, and libsy.run records, but the server request log, Advisor fail-open audit, and SSE error path can still record the raw message.
Expected vs. actual
- Expected: Keep the complete typed error available for retries, fallback, and the response returned to the caller. Logs and traces should contain only safe structured fields such as the error kind, status, target, and phase.
- Actual: Several paths use the error's
Display output, which can include the upstream body or another free-form message. Other paths remove all error detail, including useful operational information.
Scope notes
Please settle the common logging behavior and apply it consistently to:
libsy.client_call, libsy.llm_call, and libsy.run
- terminal
switchyard_server::request events
- Advisor fail-open warnings and audit events
- server SSE errors
- runner and Relay failure reporting
The original error should remain unchanged in flight. Avoid adding another public formatting API unless an external integration needs it. Add regression tests at the final log and trace sinks, not only the inner client span.
#536 and #537 added the typed RouteErrorSummary used by embedded runner integrations. This work should align with that shape where it fits rather than introduce a second string-based contract.
Additional context
Symptom
Upstream errors can contain provider response text. Providers sometimes quote request content in validation errors, so formatting the full error into a log or trace can expose prompts, source code, or other request data.
The handling is currently inconsistent. #611 removes this content from the inner
libsy.client_call,libsy.llm_call, andlibsy.runrecords, but the server request log, Advisor fail-open audit, and SSE error path can still record the raw message.Expected vs. actual
Displayoutput, which can include the upstream body or another free-form message. Other paths remove all error detail, including useful operational information.Scope notes
Please settle the common logging behavior and apply it consistently to:
libsy.client_call,libsy.llm_call, andlibsy.runswitchyard_server::requesteventsThe original error should remain unchanged in flight. Avoid adding another public formatting API unless an external integration needs it. Add regression tests at the final log and trace sinks, not only the inner client span.
#536 and #537 added the typed
RouteErrorSummaryused by embedded runner integrations. This work should align with that shape where it fits rather than introduce a second string-based contract.Additional context