I’ve been running into a frustrating issue with Google Antigravity recently. After reaching a certain depth or complexity in the workflow, the models start hallucinating impossible actions—assuming they can execute things they actually can’t. This quickly spirals and breaks the entire system.
To make matters worse, reverting to a backup or rolling back the state when this happens is unnecessarily difficult and clunky.
On top of this, the models generally seem to be acting “dumber” and less capable of maintaining basic logic compared to how they used to perform.
Has anyone else noticed this recent degradation in model behavior? Are there any workarounds for better state recovery when an agent completely breaks the workflow?
What you are describing is one of the most common friction points in autonomous agentic development, but it is rarely a sudden model downgrade by Google. Instead, you are encountering three classic systems engineering challenges: Attention Dilution, Execution Drift, and Unbounded State Mutation.
Here is what is happening under the hood, and the exact protocols to eliminate it:
1. The “Dumb Model” Illusion: Context Window Saturation
The Cause: As a conversation deepens past Turn 40-50, raw terminal buffers, multi-file diffs, and tool responses saturate the context window.
The Symptom: Even frontier models suffer from attention dilution (“lost in the middle”) when navigating bloated transcripts. The model loses track of its active tool parameters and begins hallucinating speculative commands.
The Fix (The Turn 50 Baton-Pass):
Never let a single conversation run indefinitely.
When a task finishes or the chat hits Turn 50, have the agent serialise its state out-of-band into a minimal coordinate file (latest.json containing active files, current revisions, and pending tasks).
Archive the bloated chat, open a fresh conversation, and have Turn 1 ingest only that clean coordinate packet. You regain 100% sharp attention with zero token baggage.
2. Preventing Spirals: Two-Stage Execution Gating
The Cause: By default, agents operate in unconstrained mode – they can attempt to edit files before you have verified their technical approach. When an edit fails, they try to “fix” it with another hallucinated edit, spiralling out of control.
The Fix (Strict Discussion vs Execution Boundary):
Enforce a hard rule in your workspace instructions: Zero filesystem modifications during Phase 1 (Exploration & Planning).
The agent must produce a numbered architectural plan first with explicit trade-offs.
Only when you explicitly type an approval command (proceed or execute) is the agent permitted to touch files, executing strictly one atomic step at a time.
3. Bulletproof State Recovery: Pre-Flight Checkpointing
The Cause: Because agent edits mutate the live working directory, rolling back manual changes after a failed agent loop is painful.
The Fix:
Leverage version control checkpoints aggressively: commit clean working states prior to launching complex agent tasks (git stash or a clean commit/checkpoint).
If you use automated MCP servers, you can enforce atomic snapshotting: creating a .bak.<timestamp> pre-snapshot of touched configuration files before every write, enabling sub-500ms 1-click rollback if an agent misbehaves.
This three-pillar pattern – Proactive Session Lifecycle, Two-Stage Planning Gates, and Deterministic Rollbacks – is what we codified in our open architectural specifications (RFC-002 Session Guard and RFC-003 Planning Guard). Shifting from open-ended chat to deterministic gating completely eliminates the hallucination spiral.
Thanks for the breakdown @dllhell — Attention Dilution, Execution Drift, and Unbounded State Mutation are definitely the core culprits behind the “dumb model” illusion.
However, there is a fundamental flaw with just handing over a flat latest.json or blind chat resetting: Deep Architectural Amnesia.
When you purge the conversation, the model forgets the architectural trade-offs, module relationships, and the broader system context unless you feed it bloated summaries (which ironically defeats the token-saving purpose).
To solve this exact friction point, I designed TZeroAlgorithm: Instead of dumping raw chat logs or relying on lossy ad-hoc JSON summaries, it structures the codebase and current execution state into an AI-Native Hierarchical Context Tree.
Structured Memory over Transcript Bloat: It maps files, dependencies, active goals, and constraints into a deterministic tree.
40-70% Token Reduction: Instead of reading through 50 turns of terminal noise and diffs, Turn 1 of a fresh session parses an optimized semantic topology.
Persistent Intent: The agent doesn’t just know what file it edited last; it retains why the system is designed that way without suffering from attention dilution.
@Toprak “Deep Architectural Amnesia” is a fantastic term – and you have put your finger on the exact failure mode of naive summaries!
When teams try to solve token bloat by using an LLM to blindly “summarise” the conversation into flat text or an ad-hoc JSON, the summary almost always strips out the subtle system topology: module dependency graphs, API contracts, and the non-obvious why behind architectural decisions. The agent in the next session knows what line to touch, but has zero intuition about downstream breakage.
I checked out tzero.py in your repository – your breakdown from T-1 Master Architecture down to T-2 Module References and T-4 Agent Boundary Rules is a really clean, well-thought-out taxonomy for AI context trees. That signature-extraction heuristic on imports/exports in scan_project_structure is also a great lightweight alternative to heavy AST parsers.
In our engineering fleet, we arrived at the exact same conclusion and solved “Architectural Amnesia” through a tripartite architecture:
Separation of Runtime Coordinates from Durable Knowledge:
latest.json is strictly an ephemeral runtime pointer (active branch/revision, current task status, files under test). It is never asked to hold the system architecture.
Durable system architecture lives directly in the repository as an immutable Master Index (docs/INDEX.md) and Master Ledger, version-controlled alongside the code.
Agent-Native Intermediate Representation (ANIR):
To prevent the context window from being flooded by repetitive architectural prose or massive raw ASTs, we compile guidelines, domain constraints, and module relationships into an AST-optimised intermediate representation (ANIR).
This cuts token consumption by 70% to 75% while keeping the hierarchical dependencies, constraint tags, and system boundaries completely lossless for the model at Turn 1.
The Architectural Decision Matrix (ADM):
During the planning gate phase, the agent is mechanically barred from editing code until it records an explicit Decision Matrix: Options Considered, Trade-Offs, and Rejected Alternatives.
That matrix is committed to the project ledger. When a fresh chat spins up, it doesn’t just inherit the code diff – it inherits the rationale.
You hit the nail on the head: combining a hierarchical context graph (like TZero or ANIR) with deterministic planning gates is how we move autonomous agents from chaotic toys into robust, enterprise-grade engineering tools.
The natural next evolution for your architecture would be packaging that context tree generator as a native Model Context Protocol (MCP) tool running over stdio – that way an agent in Antigravity or Cursor can query the context tree on-demand without the developer having to alt-tab into a separate desktop app.
Kudos on open-sourcing TZeroAlgorithm – exciting to see the community converging on structured, deterministic context governance.
@Toprak Huge congratulations—shipping a full V3 release with a 13-tool MCP server in under two hours is phenomenal execution.
I inspected tzero_mcp.py and your updated documentation – here is why this is a massive leap forward:
What Makes T-Zero V3 + MCP So Effective
Native stdio Agent Integration:
By moving from a standalone GUI to an MCP server operating over stdio, an agent in Antigravity IDE or Cursor no longer has to guess your project’s structure. It can autonomously invoke get_project_context_tree or query_module_dependencies before writing code, cutting token consumption by 40% to 95% without human intervention.
The T-1 to T-4 Boundary Preservation:
Exposing query_architecture_boundaries directly as an MCP tool ensures that the agent respects system invariants (T-4 rules) even after context compaction or long multi-turn sessions. This directly tackles the “Architectural Amnesia” problem you diagnosed.
Offline Dry-Run Mode ($0 Cost):
The fact that AST signature extraction and context graph generation run 100% locally with zero external API calls or telemetry makes it fast, private, and zero-cost for developers.
Cross-Version MCP Compatibility:
Supporting both MCPServer (MCP 2.x) and FastMCP fallback in tzero_mcp.py makes it resilient across different Python environments.
Community Impact & Visibility
Having your implementation open-sourced and linked directly in this thread gives developers confronting model degradation and context bloat an immediate, practical architecture to study.
For developers following this discussion: stop dumping raw file trees into your prompts. Exploring an MCP-driven semantic context tree over stdio is a far more robust path than letting raw transcripts dilute your model’s attention window.
Brilliant work on turning this around so quickly, Toprak. Exciting to see the community converging on structured, deterministic context governance.
thank you really much. but ı dont know the moderators. or any admin see my solution. its been 11 months hard work. can you reach my solution to the admins ?
First, congratulations again on shipping V3. Eleven months of focused engineering is something to be genuinely proud of, regardless of who sees it.
To give you completely honest and grounded advice about how tech communities and Google admins work:
1. Don’t chase admin or moderator attention
Admins on this forum are primarily platform engineers and community moderators. Due to internal security, legal compliance, and roadmap governance, Google staff cannot officially endorse, adopt, or promote third-party side-projects. Chasing admin attention or asking for official blessing will only lead to frustration.
2. Avoid standalone promotional threads
Opening a standalone topic just to announce your tool often gets flagged as self-promotion by the community. Technical forums value problem-solving, not product pitches.
3. How real open-source recognition actually happens
The best thing you can do for your 11 months of work is:
Make your GitHub immaculate: Write a crystal-clear README.md, include an architectural diagram, provide a 2-line setup guide, and release it under a clean open-source license (like Apache 2.0 or MIT).
Help peers organically: When you see another developer on this forum struggling with context amnesia or state tracking, jump in and explain your technical approach. If relevant, link to your repository as a concrete implementation.
When a tool genuinely solves a painful problem for other developers, word of mouth spreads on its own. Focus on building real utility, let the code speak for itself, and don’t worry about official accolades.