v1.3.127
v1.3.127
New Features
-
Mid-point progress checkpoint — At 60% of the max iteration budget, the agent receives a one-time progress assessment prompt encouraging strategy re-evaluation. Implements the lightweight "overseer" pattern from the SICA paper (arXiv 2504.15228). Only fires when maxIter >= 20.
-
Proactive ratchet rule injection — Learned error prevention rules (from past build/test failures) are now visible to the agent from the start of each run, not just reactively when a tool pattern matches. The top 5 most frequently-hit rules are appended to the system prompt, implementing the "rules as first-class citizens" pattern from self-improving agent literature.
-
Known model context window table — Instant context window detection for 40+ popular models (Claude, GPT, Gemini, DeepSeek, Qwen, GLM, Mistral, Llama, Yi, Command R+) without API probing. Eliminates the slow tiered probe for well-known models.
Bug Fixes
-
Ratchet rule double-injection — Rules accumulated across runs when no systemPromptInjector was set, causing the system prompt to grow indefinitely. Fixed by merging dynamic prompt and ratchet injection into a single function that always builds from the base prompt.
-
Token estimation accuracy — EstimateTokens now accounts for message overhead, tool call structures, and image content blocks, providing more accurate context window usage tracking.
-
GOMEMLIMIT for shared machines — Increased from 1GiB to 2GiB to prevent OOM kills when multiple ggcode instances run on the same machine.
-
save_memory test HOME isolation — Tests now isolate HOME directory to prevent failures on clean machines without
~/.ggcode/pre-created.
Performance
-
ASCII tokenizer fast path — EstimateTokens now uses a character-count heuristic for ASCII-only text (5-10x faster than full tokenizer), falling back to tiktoken for text with CJK or emoji.
-
Batch session message persistence —
persistFullSessionMessages()now usesAppendMessagesBatchToDisk(1 file open + 1 index update) instead of N separateAppendMessageToDiskcalls, reducing I/O by N× per agent turn.