---
id: 18879
lang: en
title: "The Russian localization patch for Google AntiGravity has grown into Toolkit: agent context fill shown in 4 ms"
published_at: "2026-12-01 22:25:27"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1114764/?utm_campaign=1114764&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18879"
categories: ["llm", "research"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# The Russian localization patch for Google AntiGravity has grown into Toolkit: agent context fill shown in 4 ms

> **Краткая суть (BLUF):** In the agentic IDE Google AntiGravity 2.0, the model's context can suddenly compress in the middle of a task, and the agent loses details. The author of the localizer has released the open-source Toolkit v3.0.5. Its fill indicator reads the tail of the local session log in 4 ms, with no network requests. When the bar reaches 80%, you can call /compact yourself in advance. For long sessions, this is a cheap way to keep the thread of a task.  • Settings are stored in the IDE's native appStorage.json and no longer reset • Bookmarks are drawn in a separate layer and do not break the React tree of the chat • 12 interface languages: a dictionary of 7,077 terms, with only one language in memory

Picture this: you have been working with an agent in the IDE on a complex task for an hour, and suddenly the model's context window, the "memory" that holds the entire conversation and code, overflows and is compressed automatically. The agent loses some details, and you find out only after the fact. That pain is what led an independent developer to turn their local localizer for Google AntiGravity 2.0 into Toolkit v3.0.5, an open set of add-ons under the MIT license. The main feature is a context fill indicator that reads data from the local log in 4 milliseconds (roughly tens of times faster than a single screen frame) and makes not a single network request. Beyond it, the kit includes bookmarks for messages and an interface in 12 languages. This is an unofficial add-on, not a Google product, but the lessons from working around the quirks of an Electron application are useful to anyone building extensions for other people's desktop IDEs.

## A context monitor with no network requests

The idea: don't intercept traffic to the model, but read what the IDE already writes to disk. AntiGravity keeps a local session log, transcript.jsonl, in the ~/.gemini/antigravity/brain/ folder. Each model response record contains token telemetry: how many went into the prompt, how many were read from the cache, and where the last compression happened.

The file can be megabytes in size, so the local service on 127.0.0.1:39228 does not read it whole. It opens the file and takes only the tail, using a window of fixed size. According to the author, this takes less than 4 ms, does not load the disk, and creates no network calls. A fill indicator appears in the IDE header and changes color from green to coral. Clicking it shows exact token counts, the active model, and the cache hit rate, along with a button to copy the /compact command. The threshold for the silent warning is configurable from 50% to 95%.

The practical point is simple: you decide when to compress the context, rather than finding out when the agent has already lost half the details. For sessions with expensive models, this is also a way to control token spending.

## Bookmarks in a React app and "rubber" scrolling

The obvious way to add bookmarks to messages is to put a button directly inside the message element. In React, this breaks: when the list re-renders, a removeChild error appears. So the author moved the bookmarks into a separate layer in document.body, clipped to the bounds of the chat's scroll area. The React tree does not touch this layer. Bookmarks are tied to a hash of the text preview and an occurrence index, so they survive re-rendering and restarts.

In version 3.0.3, bookmark icons lagged during fast scrolling. There were four causes: a CSS position animation with an 80 ms delay, updates through requestAnimationFrame, interleaved reading of geometry and writing of styles in a single loop, and a faulty position calculation for long messages. The fix is classic: remove transform from the transition, update the position synchronously within the same frame, and split the loop into phases, with all reads first and then all writes. For long agent responses, the icon behaves like position: sticky.

## Two Electron pitfalls and multilingual support

The first pitfall concerns the built-in browser. In AntiGravity it is implemented as a native WebContentsView that is drawn on top of the HTML window, so even z-index 999999 doesn't help: popups get clipped. The author hooked into the same IPC call the IDE itself uses for modal windows. But the Base-UI library leaves empty portal containers in the DOM, and the overlay would not be removed. Now removal is tied to the real classes of the native popups.

The second pitfall: settings were reset after restarts. The IDE brings up its interface on a new random port each time, and localStorage is isolated by scheme, host, and port, so the storage was empty every time. An attempt to save through a local HTTP server and cookies ran into Chromium's preflight requests and session isolation on macOS. A working solution was found in the IDE's own code: it already has an atomic StorageManager with an appStorage.json file, accessible over IPC. Settings are now written there, and a copy is kept in backups/settings.json.

The interface supports 12 languages, including Chinese, Japanese, Spanish, German, and Turkish. The language is detected from the system on first launch. Each dictionary contains 7,077 terms and the names of 109 Marketplace plugins. It is loaded on demand and cached in IndexedDB, so only one language is active in memory. Code, the terminal, and user input are not affected by the translation.

## Security and limitations

The author abandoned the CDP debugging port 9222. Updates go through local HTTP and IPC, and every JS file is checked with node --check before it is replaced. On macOS, the toolkit re-signs the bundle and verifies the SHA-512 and the Apple/Google signature before updating the IDE. There is one-click removal with a return to the original app.asar.

The caveats are obvious. The toolkit modifies a Google application, so any IDE update may break compatibility. Figures such as 4 ms and "dozens of installs per day" come from the author himself, with no independent measurements. Installing via curl or irm piped into a shell requires trust in the repository, so it is worth reading the script first. Still, the approach of reading local logs instead of intercepting the network, and storing settings in the IDE's standard storage, applies to any extension for agentic editors.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1114764/?utm_campaign=1114764&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18879
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
