Repository navigation
perf(main): skip unchanged opencode binder polls via stat stamp and retire idle reader after 30s - #49671
Merged
nwparker merged 5 commits intoNov 26, 2026
Conversation
…che getProjectGroupingForRepo
…etire idle reader after 30s
…e writes A commit landing in the same coarse mtime tick as the stat (WAL reset rewriting in place at the same size, journal-mode page overwrites, FAT's 2s resolution, or ino === 0 platforms) could leave an identical ino:size:mtimeMs stamp and skip the poll indefinitely. Trust a stamp only after every file has been quiet for 3s, and include ctimeMs in the token for extra discrimination.
Merged
11 tasks done
nwparker
changed the base branch from
perf/idle-retire-environment-store-worker
to
main
November 26, 2026 10:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents the 60s OpenCode binder poll from permanently keeping an idle
orca-foreign-sqlite-readerNodeWorkerisolate (~8 MiB dirty RAM) alive in Main whenopencode.dbhas not changed:src/main/foreign-sqlite-readers/foreign-sqlite-reader-spawn.tsdbPath,${dbPath}-wal, and${dbPath}-journal(ino:size:mtimeMs) before waking the worker inreadOpenCodeBinderSessions.[]for the exact(dbPath, cursor.ms, cursor.id)and file stamp, return[]immediately without waking the worker. Failed/timed-out reads are never cached.src/main/foreign-sqlite-readers/foreign-sqlite-reader-client.tsreadWithStatus/readOpenCodeBinderSessionsWithStatussoforeign-sqlite-reader-spawn.tsdistinguishes verified empty reads from error fallbacks.DEFAULT_IDLE_TEARDOWN_MS.openCodeBinderSessionsfrom120_000→30_000(matchingcursorProfileandopenCodePromptFailure), since unchanged polls no longer need a warm worker bridging 60s intervals.Performance
orca-foreign-sqlite-readerafter 30s of quiet and avoids waking it on unchanged 60s binder polls, reclaiming ~8 MiB of permanent dirty RAM in Main with zero negative user-facing tradeoffs.Verification
pnpm check:changed --base=perf/idle-retire-environment-store-worker: 25/25 passed (including unit tests)