- Spawn standalone LS as dedicated 'antigravity-ls' user via sudo - UID-scoped iptables redirect (port 443 → MITM proxy) via mitm-redirect.sh - Combined CA bundle (system CAs + MITM CA) for Go TLS trust - Transparent TLS interception with chunked response detection - Google SSE parser for streamGenerateContent usage extraction - Timeouts on all MITM operations (TLS handshake, upstream, idle) - Forward response data immediately (no buffering) - Per-model token usage capture (input, output, thinking) - Update docs and known issues to reflect resolved TLS blocker
3.2 KiB
Known Issues & Future Work
All critical blockers have been resolved. MITM interception is fully working in standalone mode with UID-scoped iptables redirection.
✅ Resolved
LS Go LLM Client Ignores System TLS Trust Store
Status: SOLVED (2026-02-14)
Previously the #1 blocker. The standalone LS (--standalone flag) now routes
all LLM API traffic through the MITM proxy with full decryption.
Solution:
- UID-scoped iptables —
scripts/mitm-redirect.shcreates anantigravity-lssystem user. iptables redirects only that UID's port-443 traffic → MITM port. - Combined CA bundle — The Go client honors
SSL_CERT_FILEwhen set on the standalone process. A combined bundle (system CAs + MITM CA) is written to/tmp/antigravity-mitm-combined-ca.pem. sudo -uspawning — The proxy spawns the LS as theantigravity-lsuser, so only the standalone LS traffic is intercepted. No impact on other software.- Google SSE parsing — MITM parses
streamGenerateContent?alt=sseresponses and extractspromptTokenCount,candidatesTokenCount,thoughtsTokenCount.
Verified: /v1/usage returns per-model token usage from intercepted traffic.
🟡 Medium (Architecture / Future Work)
1. Cascade Correlation Is Heuristic
File: src/mitm/intercept.rs — extract_cascade_hint()
The MITM proxy matches intercepted API traffic to cascade IDs heuristically.
Currently all intercepted usage is stored under _latest because the Google
SSE request body is empty (content_length=0 — the LS sends the request body
via chunked encoding that isn't captured in the hint extractor).
Impact: Usage shows up in /v1/usage aggregate stats but isn't correlated
to specific cascades. Not blocking — aggregate usage is the primary use case.
2. Request Modification Not Implemented
File: src/mitm/proxy.rs — modify_requests: bool
The MitmConfig.modify_requests flag is plumbed through but hardcoded to false.
Reserved for future request mutation features (e.g., injecting custom system
prompts, modifying model selection).
3. Polling-Based Cascade Updates vs Streaming RPC
File: src/api/polling.rs
We poll GetCascadeTrajectorySteps on a timer. The LS has a
StreamCascadeReactiveUpdates streaming gRPC method that pushes updates
in real-time. Polling works but adds latency.
Status: Functional but suboptimal.
🟢 Low
4. MITM Integration Tests
Unit tests cover protobuf decoding and intercept parsing (18 tests pass). Integration tests for the full MITM pipeline (TLS interception, response parsing, usage recording) would be valuable now that interception works.
5. MITM for Main Antigravity Session
The current MITM only works for the standalone LS (--standalone mode).
Intercepting the main Antigravity session's LS is harder because:
- The main LS is managed by the Antigravity app, not by us
- UID-scoped iptables can't target it without affecting all user traffic
- The
mitm-wrapper.shapproach sets env vars but the LLM client ignoresHTTPS_PROXYunlessdetect_and_use_proxyis ENABLED via init metadata
Workaround: Use --standalone mode for all proxy traffic.