fix(debug): unify LETTA_DEBUG and DEBUG gating (#1408)

Co-authored-by: Letta Code <noreply@letta.com>
This commit is contained in:
jnjpng
2026-03-16 13:14:25 -07:00
committed by GitHub
parent 95304a557e
commit f65a751ff0
8 changed files with 47 additions and 33 deletions

View File

@@ -121,7 +121,12 @@ import {
} from "../tools/manager";
import type { ToolsetName, ToolsetPreference } from "../tools/toolset";
import { formatToolsetName } from "../tools/toolset-labels";
import { debugLog, debugLogFile, debugWarn } from "../utils/debug";
import {
debugLog,
debugLogFile,
debugWarn,
isDebugEnabled,
} from "../utils/debug";
import { getVersion } from "../version";
import {
handleMcpAdd,
@@ -3050,7 +3055,7 @@ export default function App({
const agentName = agentState?.name || "Unnamed Agent";
const isResumingConversation =
resumedExistingConversation || messageHistory.length > 0;
if (process.env.DEBUG) {
if (isDebugEnabled()) {
console.log(
`[DEBUG] Header: resumedExistingConversation=${resumedExistingConversation}, messageHistory.length=${messageHistory.length}`,
);
@@ -4721,7 +4726,7 @@ export default function App({
})
.catch((err) => {
// Silently ignore - not critical
if (process.env.DEBUG) {
if (isDebugEnabled()) {
console.error(
"[DEBUG] Failed to set conversation summary:",
err,