chore(agent): log full traceback when MasterAgent fails

Without exc_info we only see the bare exception string, which has been
unhelpful for debugging Discuss DM failures (e.g. a KeyError whose
message is just a JSON key, with no clue where it was raised).
This commit is contained in:
Carlos Garcia
2026-04-24 23:11:46 -04:00
parent b4f1f5f015
commit 4cbc4cc0f1

View File

@@ -112,7 +112,7 @@ class MasterAgent:
return MasterResponse(directive_id=directive_id, response=response_text,
status=status, escalations=all_escalations, actions_taken=all_actions)
except Exception as exc:
logger.error('MasterAgent FAILED directive=%s: %s', directive_id, exc)
logger.exception('MasterAgent FAILED directive=%s: %s', directive_id, exc)
err_msg = 'I encountered an error processing your request. Please try again or contact your administrator.'
await self._log_directive_complete(directive_id, 'failed', err_msg, error=str(exc))
return MasterResponse(directive_id=directive_id, response=err_msg, status='failed')