Two patterns for streaming tools in Google's ADK voice agents — live progress narration with partial updates, and quiet background execution — plus the production gotchas: idempotency, stop_streaming, and barge-in semantics.
An agentic overnight drive to optimize the Google Agent Development Kit (ADK) — a 200,000-line Python codebase — with Gemini 4 Argon. The most valuable part of the story is the division of labor: the agent explores, the maintainer subtracts.
import google.adk pulled in modules for live audio/video streaming, OpenTelemetry tracing, and web servers (FastAPI, Starlette) — even for a basic text agent. Rewriting top-level imports breaks downstream tests that mock attributes directly on modules.
When Argon's round-two PR removed three internal flow imports from llm_agent.py, all 16,892 open-source tests passed — yet 25 internal Google test targets failed because they patched those exact attributes. The shipped fix: lazy module accessors so heavy packages load only on first use while every public attribute stays patchable where tests expect it.
Argon proposed six optimizations. Two shipped; four were cut in code review — and the rejects are the instructive part:
Shipped:
Rejected, and why:
The final change: a 22-file change backed by 17 new test functions, landed with the commit note "Argon generated these changes."
The commit's turn count is explained precisely: a "turn" in ADK is the cycle from prompt to final answer — across a full agent session with tool calls, sub-agents, and retries, a single user interaction can span many model turns. 158 turns is the measured optimization-driven count for this workload, which is why raw "turns" without this definition mislead.
This is the pattern agentic refactoring should follow everywhere: let the model explore and propose broadly, keep a rigorous human review with a real test suite and a holdout benchmark, and reject clever-but-fragile changes by measuring what they actually move. The agent found creative solutions humans wouldn't have — and the review process is exactly what made them safe to ship.