chore: code cleanup and documentation overhaul

- Remove debug header dump from MITM proxy (was temp debugging code)
- Suppress dead_code warnings for intentional OpenAI compat fields
- Rewrite README with styled mermaid architecture diagrams, full
  feature listing, usage examples, and CLI reference
- Update endpoint-gap-analysis: images implemented, audio only stretch
- Update mitm-interception-status: add request modification and error
  capture components
- Update standalone-ls-todo: add new endpoints to test results
- Zero compiler warnings
This commit is contained in:
Nikketryhard
2026-02-15 18:27:53 -06:00
parent 2882f7cce2
commit 4e4d8e9474
7 changed files with 354 additions and 152 deletions

View File

@@ -45,6 +45,21 @@ Client → Proxy (8741) → Standalone LS (as antigravity-ls user)
- Forwards HTTP/1.1 requests upstream with real DNS resolution (`dig @8.8.8.8`)
- Chunked response detection for fast completion
6. **Request modification** (`src/mitm/modify.rs`)
- Strips LS system instructions down to `<identity>` block only
- Removes stale conversation history (keeps only last user message)
- Injects client tools, tool configs, generation params
- Injects images as `inlineData` (base64) into user message parts
- Injects tool results as `functionResponse` parts
- Enables Google Search grounding when requested
- Updates `Content-Length` header after body modification
7. **Upstream error capture** (`src/mitm/store.rs`)
- Captures Google API error responses (HTTP 400, 429, 500, etc.)
- Parses error JSON for message and status fields
- Stores in `MitmStore` for immediate forwarding to client
- Prevents request hangs on upstream failures
## What We Tried (Historical)
### 1. Extension Patch — `detectAndUseProxy` ✅ Still Active
@@ -129,8 +144,8 @@ Last event includes `"finishReason": "STOP"` in the candidate.
# One-time setup (creates user + iptables rule)
sudo ./scripts/mitm-redirect.sh install
# Run proxy with standalone LS + MITM
RUST_LOG=info ./target/release/antigravity-proxy --standalone
# Run proxy (standalone + MITM are default)
RUST_LOG=info ./target/release/antigravity-proxy
# Check usage
curl -s http://localhost:8741/v1/usage | jq .