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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user