fix: address Cubic review comments (P2/P3 issues)

- Fix empty catch block in opencode-message-dir.ts (P2)

- Add log deduplication for truncateToolResult to prevent spam (P3)
This commit is contained in:
YeonGyu-Kim
2026-02-14 18:53:58 +09:00
parent 804895b24a
commit 31e9829741
2 changed files with 11 additions and 4 deletions
@@ -7,6 +7,8 @@ import type { StoredToolPart, ToolResultInfo } from "./tool-part-types"
import { isSqliteBackend } from "../../shared/opencode-storage-detection"
import { log } from "../../shared/logger"
let hasLoggedTruncateWarning = false
export function findToolResultsBySize(sessionID: string): ToolResultInfo[] {
const messageIds = getMessageIds(sessionID)
const results: ToolResultInfo[] = []
@@ -51,7 +53,10 @@ export function truncateToolResult(partPath: string): {
originalSize?: number
} {
if (isSqliteBackend()) {
log("[context-window-recovery] Disabled on SQLite backend: truncateToolResult")
if (!hasLoggedTruncateWarning) {
log("[context-window-recovery] Disabled on SQLite backend: truncateToolResult")
hasLoggedTruncateWarning = true
}
return { success: false }
}