Repository navigation
Description
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.
Parts of this have landed. #611 redacts upstream HTTP bodies from inner call records, #794 covers Advisor fail-open reporting, and #826 covers server request and SSE logs.
One remaining case is ContextWindowExceeded. The HTTP client keeps the provider body in its message, and the client-call observer still formats that error into the span. That can expose request content quoted by the provider.
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: Context-window failures still reach the client trace through the error's
Displayoutput, which includes the upstream message.
Scope notes
Please settle the common logging behavior and apply it consistently to:
libsy.client_call,libsy.llm_call, andlibsy.run- terminal
switchyard_server::requestevents - 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
- fix(libsy): drop reasoning from task classifier history #610 exposed the original upstream-body case during review.
- fix(llm-client): redact upstream body from client-call span #611, fix: redact advisor fail-open errors in logs and the audit trail #794 and fix(server): redact upstream error content from request and SSE logs #826 are merged fixes, but do not cover every error variant.
- The remaining path is visible in error construction and client trace recording. This was checked in source, not with a new live reproduction.
Activity
joshuacox commentedon Oct 16, 2026
This looks fixed on current
main, so it may be closable.The sinks named in the scope are covered:
libsy.client_call,libsy.llm_call, andlibsy.run).The typed error itself is unchanged in flight, so retries, fallback, and the response returned to the caller keep the complete error; only the log and trace formatting drops the free-form upstream content in favour of safe structured fields.
Happy to be corrected if a sink still formats the raw error.