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
@@ -4,8 +4,14 @@ import { PART_STORAGE } from "../constants"
import type { StoredPart, StoredTextPart } from "../types"
import { readMessages } from "./messages-reader"
import { readParts } from "./parts-reader"
import { log, isSqliteBackend } from "../../../shared"
export function replaceEmptyTextParts(messageID: string, replacementText: string): boolean {
if (isSqliteBackend()) {
log("[session-recovery] Disabled on SQLite backend: replaceEmptyTextParts")
return false
}
const partDir = join(PART_STORAGE, messageID)
if (!existsSync(partDir)) return false