Quick Fix Summary: Most Anti-Gravity "Loading Models" errors are caused by invalid auth tokens, MCP port conflicts, or corrupted .gemini_cache directories. Run the diagnostic script below to identify your issue in seconds.
In 2026's AI-first development landscape, the Anti-Gravity editor isn't just a text buffer—it's the command center for your multi-agent orchestration system. When you're stuck on the "Loading Models" screen, your entire development workflow grinds to a halt.
At ikziriv.com, we've debugged hundreds of these issues. Here's the exact protocol we use to get developers back to shipping code within minutes.
Why Your Anti-Gravity Editor Won't Load Models
The "Loading Models" freeze almost always traces back to one culprit: a failed Model Context Protocol (MCP) handshake.
Here's why this happens:
- Anti-Gravity parallelizes agents across your local toolchain
- Each agent requires a verified connection to your local "Armory"
- If the gateway can't validate your auth token, or if a firewall blocks the MCP port, the handshake never completes
The result? An infinite loading spinner where your model selector should be.
The 3-Tier Diagnostic Protocol
To restore your "Shared Source of Truth," work through these tiers systematically:
Tier 1: Auth Token Validation
Following Anthropic's 2026 "spoofing" crackdown, many legacy Anti-Gravity configurations are now invalid.
What to check:
- Open your
config.json - Verify you're using a GitHub Copilot Pro Plus token or native Google Cloud credentials
- Regenerate expired tokens through your provider's dashboard
Pro Tip: Tokens generated before March 2026 are likely invalidated. Always generate fresh credentials.
Tier 2: Resolve MCP Port Conflicts
Running multiple AI CLI tools simultaneously? Tools like OpenCode, Claude Code, or Cursor may be competing for the same local port.
Diagnostic command:
lsof -i :PORT_NUMBER
If you see conflicting processes, kill them before restarting Anti-Gravity.
Tier 3: Reset the .gemini_cache Directory
Anti-Gravity stores critical state in a hidden .gemini_cache directory. If this becomes corrupted, no amount of token regeneration will help.
The fix:
rm -rf .gemini_cache
antigravity --init
This forces a clean project state re-initialization.
Prevent Future Crashes with RAPS Architecture
Once you're back online, architect your system to avoid repeat failures using the RAPS framework:
| Component | Purpose |
|---|---|
| Rules | Define connection requirements and fallback behavior |
| Armory | Isolate your local tool dependencies |
| Parallel Agents | Assign dedicated QC agents for health monitoring |
| Serverless | Deploy triggers to cloud infrastructure |
Key insight: Assign a dedicated "QC Agent" to monitor connection health. This agent can alert you before your primary development agent hits a timeout—saving hours of debugging.
The Ultimate Fix: Deploy via Modal
For zero-downtime development workflows, migrate your Anti-Gravity triggers to Modal or another serverless platform.
Benefits:
- ✅ Eliminates local network dependency
- ✅ No more port conflicts
- ✅ 99.9% uptime for autonomous coding loops
- ✅ Your SvelteKit backlog clears even during local maintenance
Quick Reference Resources
Connection Health Check Script
Run this script to diagnose issues instantly:
#!/bin/bash
# Anti-Gravity Health Check v2026.1
echo "=== Anti-Gravity Diagnostic ==="
# Check auth token
grep -q 'auth_token' config.json && echo "✓ Auth Token Found" || echo "✗ Missing Auth Token"
# Check port availability
lsof -i :7860 && echo "⚠ Port 7860 in use" || echo "✓ MCP Port Clear"
# Clear cache if needed
if [ -d ".gemini_cache" ]; then
echo "→ Cache directory exists. Clear with: rm -rf .gemini_cache"
else
echo "✓ No cached state"
fi
echo "=== Run 'antigravity --init' to reinitialize ==="
Model Loading Recovery Checklist
- Verify auth token validity with provider (GitHub/Google)
- Check for local port conflicts using
lsof -i :PORT - Clear
.gemini_cachedirectory - Ensure MCP gateway has firewall permissions
- Validate
Gemini.MDstructure for protocol compliance - Consider Modal deployment for persistent uptime
Frequently Asked Questions
Q: Why does Anti-Gravity freeze on "Loading Models" after a system update? A: System updates often reset firewall rules. Re-enable MCP port permissions in your firewall settings.
Q: Can I run Anti-Gravity alongside Claude Code? A: Yes, but they may conflict on default ports. Configure each tool to use distinct port ranges.
Q: How long should model loading take normally? A: Under 5 seconds on a stable connection. Anything over 30 seconds indicates a handshake failure.
Need hands-on help debugging your AI development stack? Contact the ikziriv team for expert consultation.