AI Agent News/stories/gemini-4-argon-overnight-run-trims-adk-session-prep-and-import-overhead.md

Frameworks

Gemini 4 Argon overnight run trims ADK session prep and import overhead

Google ran Gemini 4 Argon unattended for 11 hours on the google/adk-python repository, and two of the six optimizations it proposed were merged after maintainer review. The merged changes cut in-memory session preparation by about 40% in long sessions and sped up import google.adk by 21%.

Source: developers.googleblog.com/optimizing-a-200000-line-python-codebase-overnight-with-gemini-4-argon

Google's developer team wanted to see whether Argon could find and fix cross-file performance bottlenecks in ADK's Python repository, which spans roughly 205,000 lines across nearly 800 source files. A first round with a single prompt and no repository guidance found real bottlenecks, but it altered a public JSON schema, missed edge cases in its mock handling, and ran only 216 nearby unit tests. For the second round, the team added maintainer guidelines in a .agents/skills directory and used /goal mode in Google Antigravity to keep the goal in view across context compaction.

Argon's pull request proposed six optimizations across 32 files, and reviewers shipped two. The first made the in-memory session service filter events before copying them, and swapped Pydantic's generic deep copy for a cycle-safe copier. The second deferred heavy modules such as live audio, OpenTelemetry and the web servers using lazy accessors, after a simpler removal of top-level imports broke 25 internal test targets that patched those attributes. The four rejected changes included a memory-reference cache that could return stale data and a read of a private OpenTelemetry attribute.

The team measured the merged commit against the previous release with an independent holdout benchmark that the agent never saw. Across 158 internal turns of tool calling, a run dropped from 65.6 seconds to 56.1 seconds. Time from a new process to its first model request stayed flat at 3.07 to 3.09 seconds, because deferred modules load on the first turn.

Why it matters if you build agents

Developers using InMemorySessionService, including InMemoryRunner, local evaluation loops, CI suites and default Cloud Run or GKE setups without an external database, should see less per-turn overhead in long sessions after updating. Teams running production servers should send a warm-up request before taking live traffic, since the first user call still pays the deferred import cost. Session stores backed by external databases, SQLite, Firestore or Redis are not affected by the session-copy change.

Get stories like this every weekday

One short email with the day's agent tooling news.

Subscribe