Skip to main content

Overview

This guide covers advanced debugging techniques for diagnosing issues with Antigravity Manager, including log analysis, debug console usage, and diagnostic commands.

Log System

Log File Locations

Logs are stored in the data directory and rotated daily: macOS and Linux:
Windows:
Docker:

Log Rotation and Cleanup

From the source code (modules/logger.rs:88-186), logs are automatically managed:
  • Daily rotation: New log file created each day
  • Age-based cleanup: Logs older than 7 days are deleted
  • Size-based cleanup: If logs exceed 1GB, oldest files are deleted until below 512MB
Automatic cleanup settings:
  • Max total size: 1GB
  • Target size after cleanup: 512MB
  • Retention period: 7 days
  • Cleanup runs: On application startup
Manual cleanup:

Log Levels

Logs use different levels to categorize messages:
  • ERROR: Critical errors that need immediate attention
  • WARN: Warning messages about potential issues
  • INFO: General informational messages (default level)
  • DEBUG: Detailed debugging information
  • TRACE: Very detailed trace information
Change log level:

Reading and Analyzing Logs

Real-time Log Monitoring

Monitor logs as they’re written:
Filter for specific events:

Common Log Patterns

Log pattern:
What it means:
  • The refresh token has been revoked or expired
  • Account needs re-authorization
Action:
Log pattern:
What it means:
  • Account has been blocked or lacks permissions
  • Automatically removed from active pool
Action:
Log pattern:
What it means:
  • Google requires additional verification
  • Account automatically blocked for 10 minutes
  • System will retry after the block expires
Action:
  • Wait for automatic retry, or
  • Complete verification if link is provided
Success pattern:
Failure pattern:
What it means:
  • Background token refresh occurred
  • Indicates token health
Action:
  • Success: No action needed
  • Failure: Check for invalid_grant errors
Log pattern:
What it means:
  • Periodic quota refresh from Google API
  • Shows current quota percentages
Action:
  • Monitor for quota depletion
  • Enable quota protection if needed
Log pattern:
What it means:
  • Proxy connection failed
  • System falling back to direct connection or next proxy
Action:
  • Verify proxy credentials and connectivity
  • Check proxy pool health check results

Log Analysis Commands

Count errors by type:
Extract error messages:
Find account-specific issues:

Debug Console

Accessing Debug Console

Desktop Application:
  1. Navigate to Settings → About
  2. Click “Debug Console” button
  3. Console opens in a new section
Web/Docker Mode:
  • Debug console is automatically available in the interface
  • Logs refresh every 2 seconds via polling

Using Debug Console

The Debug Console provides real-time visibility into:
  • HTTP requests and responses
  • Account selection and rotation
  • Token refresh operations
  • Error details and stack traces
What you can see:
  • Request method, URL, and headers
  • Response status codes and timing
  • Account used for each request
  • Model mapping and routing decisions
  • Thinking mode activation
  • Tool call parameters
Debug Console features:
  • Real-time log streaming
  • Filter by log level (ERROR, WARN, INFO, DEBUG)
  • Search within logs
  • Auto-scroll toggle
  • Copy logs to clipboard
  • Clear console

Debugging Mode Toggle

Enable detailed logging:
  1. Settings → About → Debug Console
  2. Toggle “Enable Debug Mode”
  3. Logs will include:
    • Full request/response bodies
    • Detailed error stack traces
    • Internal state changes
Debug mode generates significantly more log data. Disable when not actively debugging to prevent large log files.

Diagnostic Commands

System Information

Check application version:
Verify data directory:

Network Diagnostics

Test proxy service:
Check port availability:
Test external connectivity:

Database Diagnostics

Account database:
Configuration:
Security logs:

Advanced Debugging Techniques

Request Tracing

Enable request tracing:
What you’ll see:
  • Full request body (including messages, parameters)
  • Model mapping decisions
  • Account selection logic
  • Token refresh attempts
  • Response transformation
  • Streaming chunk details

Memory and Performance

Monitor resource usage:
Check for memory leaks:
  • Monitor over extended period
  • Look for continuously increasing memory usage
  • Normal: Memory stabilizes after initial requests
  • Issue: Memory grows unbounded over hours

Network Traffic Analysis

Capture HTTP traffic:
Analyze upstream requests:

Troubleshooting Scenarios

Diagnostic steps:
  1. Check logs for retry patterns:
  2. Monitor network latency:
  3. Check account rotation:
    • Slow rotation may indicate all accounts are rate-limited
    • Look for “Too Many Requests (429)” in logs
  4. Verify quota protection settings:
    • Settings → Quota Protection
    • If enabled, requests may be blocked when quota is low
Diagnostic steps:
  1. Check disable reasons:
  2. Look for common patterns:
  3. Verify OAuth tokens are valid:
  4. Test manual token refresh:
    • Use UI to refresh specific account
    • Check logs for refresh errors
Diagnostic steps:
  1. Check proxy pool configuration:
  2. Test proxy connectivity:
  3. Check proxy health status:
    • Settings → Proxy Pool
    • Look for unhealthy proxies
    • Review health check logs
  4. Monitor proxy usage in logs:
Diagnostic steps:
  1. Verify model override configuration:
  2. Check debug console for mapping decisions:
    • Enable Debug Console
    • Look for “Model mapped from X to Y” messages
  3. Test with specific model:
  4. Review model config:
    • Settings → Model Router
    • Ensure mappings are saved
    • Check for conflicting rules

Reporting Issues

When reporting issues on GitHub, include:

Essential Information

  1. Application version:
    • Settings → About → Version number
  2. Operating system:
    • macOS version / Linux distribution / Windows version
  3. Deployment method:
    • Desktop app / Docker / Headless
  4. Relevant logs:
  5. Configuration (sanitized):
  6. Steps to reproduce:
    • What you did
    • What you expected
    • What actually happened

Creating a Debug Log Bundle

Performance Optimization

Reduce Log Size

Optimize Database

Reduce Memory Usage

  1. Disable background refresh:
    • Settings → Background Tasks
    • Turn off auto-refresh
  2. Reduce token cache:
    • Fewer active accounts = less memory for quota cache
  3. Disable smart warmup:
    • Settings → Smart Warmup
    • Toggle off if not needed