Part of #1541.
Remove the 5-second debounced write-through that flushes the full TaskHistoryStore.getAll() array into VS Code's globalState("taskHistory") on every task update. This is the change that immediately stops extension host freezes and the OOM pause.
Changes
ClineProvider.ts only:
- Delete
GLOBAL_STATE_WRITE_THROUGH_DEBOUNCE_MS constant (line 249)
- Delete
globalStateWriteThroughTimer field (line 248)
- Delete
scheduleGlobalStateWriteThrough() and flushGlobalStateWriteThrough() methods (lines ~3440–3470)
- Remove the
onWrite callback hookup that calls scheduleGlobalStateWriteThrough
Safety
Safe to merge standalone. The three getGlobalState("taskHistory") fallback reads (lines 1988, 2251, 2521) already call taskHistoryStore.get() first via ?? — the globalState fallback silently returns nothing when the key is stale or absent.
Part of #1541.
Remove the 5-second debounced write-through that flushes the full
TaskHistoryStore.getAll()array into VS Code'sglobalState("taskHistory")on every task update. This is the change that immediately stops extension host freezes and the OOM pause.Changes
ClineProvider.tsonly:GLOBAL_STATE_WRITE_THROUGH_DEBOUNCE_MSconstant (line 249)globalStateWriteThroughTimerfield (line 248)scheduleGlobalStateWriteThrough()andflushGlobalStateWriteThrough()methods (lines ~3440–3470)onWritecallback hookup that callsscheduleGlobalStateWriteThroughSafety
Safe to merge standalone. The three
getGlobalState("taskHistory")fallback reads (lines 1988, 2251, 2521) already calltaskHistoryStore.get()first via??— the globalState fallback silently returns nothing when the key is stale or absent.