fix(streaming): correlate the fatal trace line with its recorded event

The DEBUG trace for a fatal turn now carries ws and error_type,
mirroring the ERROR-level session.fatal.recorded line — without them a
stack trace under concurrent sessions correlates to its fatal event by
timestamp guesswork only. Frames-only rendering is unchanged (the
sanitize floor: no exception message text in the journal).
This commit is contained in:
Patrick Buckley
2026-08-04 04:53:00 -07:00
parent 7776cc0c2f
commit 2b43b8dd90
+5 -1
View File
@@ -5304,10 +5304,14 @@ class ChatSession:
# Frames only — ``exc_info=True`` would render the raw exception
# message, which can carry credentials verbatim (the sanitize floor
# the lines above exist to hold); format_tb renders the stack
# without the message.
# without the message. ws + error_type mirror the ERROR line so a
# trace correlates to its session.fatal.recorded event under
# concurrent sessions.
if exc.__traceback__ is not None:
log.debug(
"session.fatal.recorded.trace",
ws=self._ws_id,
error_type=type(exc).__name__,
trace="".join(traceback.format_tb(exc.__traceback__)),
)
try: