feat: add debug logging for silently caught errors (#809)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -386,8 +386,8 @@ function sendDesktopNotification(
|
||||
// Send terminal bell for native notification
|
||||
process.stdout.write("\x07");
|
||||
// Run Notification hooks (fire-and-forget, don't block)
|
||||
runNotificationHooks(message, level).catch(() => {
|
||||
// Silently ignore hook errors
|
||||
runNotificationHooks(message, level).catch((error) => {
|
||||
debugLog("hooks", "Notification hook error", error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import type { LettaStreamingResponse } from "@letta-ai/letta-client/resources/agents/messages";
|
||||
import { INTERRUPTED_BY_USER } from "../../constants";
|
||||
import { runPostToolUseHooks, runPreToolUseHooks } from "../../hooks";
|
||||
import { debugLog } from "../../utils/debug";
|
||||
import { extractCompactionSummary } from "./backfill";
|
||||
import { findLastSafeSplitPoint } from "./markdownSplit";
|
||||
import { isShellTool } from "./toolNameMapping";
|
||||
@@ -652,7 +653,9 @@ export function onChunk(b: Buffers, chunk: LettaStreamingResponse) {
|
||||
toolCallId,
|
||||
undefined,
|
||||
b.agentId,
|
||||
).catch(() => {});
|
||||
).catch((error) => {
|
||||
debugLog("hooks", "PreToolUse hook error (accumulator)", error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,7 +751,9 @@ export function onChunk(b: Buffers, chunk: LettaStreamingResponse) {
|
||||
b.agentId,
|
||||
precedingReasoning,
|
||||
precedingAssistantMessage,
|
||||
).catch(() => {});
|
||||
).catch((error) => {
|
||||
debugLog("hooks", "PostToolUse hook error (accumulator)", error);
|
||||
});
|
||||
|
||||
b.serverToolCalls.delete(toolCallId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user