Skip to content

perf: remove globalState write-through for taskHistory #1542

Description

@edelauna

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions