feat: add comprehensive logging for permission modal debugging

Added extensive logging to help diagnose permission modal issues:

Frontend:
- Capture unhandled errors via window.addEventListener('error')
- Capture unhandled promise rejections
- All errors now visible in debug console

Backend:
- Log when emitting permission events (count and conversation ID)
- Log each individual permission request being processed
- Log when system tools are skipped
- Log each denial being processed

This will help identify where the permission flow breaks in production builds.
This commit is contained in:
2026-02-06 22:57:39 -08:00
committed by Naomi Carrigan
parent 269674678c
commit 0b69de4a43
2 changed files with 36 additions and 0 deletions
+14
View File
@@ -87,6 +87,20 @@ function createDebugConsoleStore() {
originalConsole.debug(...args);
addLog("debug", args.map((arg) => String(arg)).join(" "), "frontend");
};
// Capture unhandled errors
window.addEventListener("error", (event) => {
addLog(
"error",
`[Unhandled Error] ${event.message} at ${event.filename}:${event.lineno}:${event.colno}`,
"frontend"
);
});
// Capture unhandled promise rejections
window.addEventListener("unhandledrejection", (event) => {
addLog("error", `[Unhandled Promise Rejection] ${event.reason}`, "frontend");
});
}
function restoreConsole() {