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

@@ -120,7 +120,7 @@ import type {
StreamEvent,
SystemInitMessage,
} from "./types/protocol";
import { debugLog, debugWarn } from "./utils/debug";
import { debugLog, debugWarn, isDebugEnabled } from "./utils/debug";
import {
markMilestone,
measureSinceMilestone,
@@ -1493,7 +1493,7 @@ ${SYSTEM_REMINDER_CLOSE}
agentId: agent.id,
skillSources: resolvedSkillSources,
logger: (message) => {
if (process.env.DEBUG) {
if (isDebugEnabled()) {
console.warn(`[DEBUG] ${message}`);
}
},