feat(storage): gate JSON write operations on OpenCode beta, document degraded features

- Gate session-recovery writes: injectTextPart, prependThinkingPart, replaceEmptyTextParts, stripThinkingParts

- Gate context-window-recovery writes: truncateToolResult

- Add isSqliteBackend() checks with log warnings

- Create beta-degraded-features.md documentation
This commit is contained in:
YeonGyu-Kim
2026-02-14 18:28:19 +09:00
parent e80211c1fd
commit 804895b24a
5 changed files with 25 additions and 1 deletions
@@ -2,8 +2,14 @@ import { existsSync, readdirSync, readFileSync, unlinkSync } from "node:fs"
import { join } from "node:path"
import { PART_STORAGE, THINKING_TYPES } from "../constants"
import type { StoredPart } from "../types"
import { log, isSqliteBackend } from "../../../shared"
export function stripThinkingParts(messageID: string): boolean {
if (isSqliteBackend()) {
log("[session-recovery] Disabled on SQLite backend: stripThinkingParts")
return false
}
const partDir = join(PART_STORAGE, messageID)
if (!existsSync(partDir)) return false