Repository navigation
refresh: batch edits where a rebuild is slow - #1862
Merged
swapnilpaliwal-sd merged 1 commit intoOct 8, 2026
Merged
Conversation
Every edit started the refresher, which rebuilt after a 2 s quiet window. Where a rebuild takes half a minute or more, an agent editing every few seconds kept one running back to back. Once the last build took AXIOMCODE_REFRESH_BATCH_ABOVE seconds (default 20), an edit only counts and the AXIOMCODE_REFRESH_BATCH-th (default 3) starts the rebuild; the worker's re-check after a build waits for the same batch. The end of a turn, a prompt, a session start, the timer and every query still refresh at once. Repositories that build faster than the threshold are unchanged. Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
October 8, 2026 08:50
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.
Symptom
Every edit started the background refresher, which rebuilt after a 2 s quiet window. On a repository whose rebuild takes 20–30 s or more, an agent editing every few seconds kept a rebuild running back to back: the machine was busy rebuilding a graph that was stale again before it finished.
Change
AXIOMCODE_REFRESH_BATCH_ABOVEseconds (default 20), an edit tool (Edit, Write, MultiEdit, NotebookEdit) only counts; theAXIOMCODE_REFRESH_BATCH-th edit (default 3,1= off) starts the rebuild. A shell command waits for the next edit or checkpoint.Evidence
tests/refresh.py: new checks per language with the threshold forced to 0 — two edits and a shell command start no rebuild, the third edit does, the batch starts over after it, and the end of a turn rebuilds after a single edit. The existing hook check (default threshold, every edit rebuilds) is the control. Java and Python pass.tests/refresh.pyand the 1 intests/refresh_races.pyfail identically on the unmodified integration branch (allchangedreporting);tests/freshness.pypasses.A second batching-on run was invalid: the disk filled during it and the rebuild failed writing the graph (
database or disk is full).