fix: always log outer loop exception traceback at DEBUG level

Replace the verbose_logging-gated logging.exception() with an
unconditional logger.debug(exc_info=True). The full traceback now
always lands in agent.log when debug logging is enabled, without
requiring the verbose_logging flag or spamming the console.

Previously, production errors in the 700-line response processing
block (normalization, tool dispatch, final response handling) were
logged as one-line messages with the traceback hidden behind
verbose_logging — making post-mortem debugging difficult.
This commit is contained in:
Teknium 2026-04-11 15:51:56 -07:00
parent 289d2745af
commit 08f35076c9
No known key found for this signature in database

View file

@ -9988,8 +9988,7 @@ class AIAgent:
except (OSError, ValueError):
logger.error(error_msg)
if self.verbose_logging:
logging.exception("Detailed error information:")
logger.debug("Outer loop error in API call #%d", api_call_count, exc_info=True)
# If an assistant message with tool_calls was already appended,
# the API expects a role="tool" result for every tool_call_id.