fix: console error leak (#1049)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-19 16:49:21 -08:00
committed by GitHub
parent b7f381c183
commit 5378cc6dd8
6 changed files with 31 additions and 18 deletions

View File

@@ -8,6 +8,7 @@ import { LETTA_CLOUD_API_URL } from "../../auth/oauth.js";
import { resizeImageIfNeeded } from "../../cli/helpers/imageResize.js";
import { SYSTEM_REMINDER_CLOSE, SYSTEM_REMINDER_OPEN } from "../../constants";
import { settingsManager } from "../../settings-manager.js";
import { debugLog } from "../../utils/debug.js";
import { OVERFLOW_CONFIG, writeOverflowFile } from "./overflow.js";
import { LIMITS } from "./truncation.js";
import { validateRequiredParams } from "./validation.js";
@@ -179,7 +180,7 @@ function formatWithLineNumbers(
overflowPath = writeOverflowFile(content, workingDirectory, "Read");
} catch (error) {
// Silently fail if overflow file creation fails
console.error("Failed to write overflow file:", error);
debugLog("read", "Failed to write overflow file: %O", error);
}
}

View File

@@ -4,6 +4,7 @@
* When outputs exceed limits, full content can be written to overflow files.
*/
import { debugLog } from "../../utils/debug.js";
import { OVERFLOW_CONFIG, writeOverflowFile } from "./overflow.js";
// Limits based on Claude Code's proven production values
@@ -64,7 +65,7 @@ export function truncateByChars(
);
} catch (error) {
// Silently fail if overflow file creation fails
console.error("Failed to write overflow file:", error);
debugLog("truncation", "Failed to write overflow file: %O", error);
}
}
@@ -167,7 +168,7 @@ export function truncateByLines(
);
} catch (error) {
// Silently fail if overflow file creation fails
console.error("Failed to write overflow file:", error);
debugLog("truncation", "Failed to write overflow file: %O", error);
}
}
@@ -250,7 +251,7 @@ export function truncateArray<T>(
);
} catch (error) {
// Silently fail if overflow file creation fails
console.error("Failed to write overflow file:", error);
debugLog("truncation", "Failed to write overflow file: %O", error);
}
}