From 67ec4421b392257d0182a241bbca7e4c246e35c1 Mon Sep 17 00:00:00 2001 From: swapnil <78632212+swapnilpaliwal-sd@users.noreply.github.com> Date: Mon, 12 Oct 2026 15:22:08 -0700 Subject: [PATCH] plugin: a slow graph rebuilds after 7 edits instead of 5 Where the last build took 20 s or more, edits are batched and the Nth one starts the rebuild. Seven lets a typical multi-file change land before the graph rebuilds. The end of a turn, a prompt, a session start and every query still refresh at once, so an answer never waits on the batch. AXIOMCODE_REFRESH_BATCH still overrides it (1 = off). Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com> --- plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py b/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py index b01925518..4716ada58 100644 --- a/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py +++ b/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py @@ -35,7 +35,7 @@ Environment: AXIOMCODE_NO_REFRESH=1 turns every trigger off (a query verb's --no-refresh, and the MCP tools' refresh=false, set it for that one query: a read-only answer from the graph as it is, still saying which edits it predates); AXIOMCODE_REFRESH_DEBOUNCE (seconds, default 2) -is the quiet window; AXIOMCODE_REFRESH_BATCH (default 5; 1 = off) is how many edits a rebuild waits for once the last build +is the quiet window; AXIOMCODE_REFRESH_BATCH (default 7; 1 = off) is how many edits a rebuild waits for once the last build took AXIOMCODE_REFRESH_BATCH_ABOVE seconds (default 20); AXIOMCODE_REFRESH_MAX (default 2, 0 = no cap) is how many background rebuilds run at once on the machine, the rest queued; AXIOMCODE_FRESH_WAIT (seconds, default 0) is the most a query whose answer touches an edited file waits for a refresh expected to finish within it, AXIOMCODE_FRESH=1 (--fresh) makes it wait for the refresh whatever it @@ -992,13 +992,13 @@ def running_line(repo, s): return started_line(repo, s, running=True) # a repository whose build takes 5 s that keeps the graph current for free, but where it takes a minute (1,300 Java # files: 48-73 s cold, and 50-88 s again after a one- or two-file edit, since the solve is whole-program) an agent # editing every few seconds kept a rebuild running back to back. So once the last build took AXIOMCODE_REFRESH_BATCH_ABOVE -# seconds (default 20), an edit tool only counts, and the AXIOMCODE_REFRESH_BATCH-th edit (default 5; 1 = off) starts the +# seconds (default 20), an edit tool only counts, and the AXIOMCODE_REFRESH_BATCH-th edit (default 7; 1 = off) starts the # rebuild; a shell command waits for the next edit or checkpoint. The end of a turn, a prompt, a session start, the # timer and every query still refresh at once, so the graph is current whenever the agent stops or asks. EDIT_TOOLS = ('Edit', 'Write', 'MultiEdit', 'NotebookEdit') def batch_size(): - try: return max(1, int(os.environ.get('AXIOMCODE_REFRESH_BATCH') or 5)) + try: return max(1, int(os.environ.get('AXIOMCODE_REFRESH_BATCH') or 7)) except ValueError: return 3 def batching(repo):