fix: fix API proxy sidecar bugs preventing Anthropic-only usage#843
fix: fix API proxy sidecar bugs preventing Anthropic-only usage#843
Conversation
The API proxy sidecar (PR #751) had several bugs that prevented it from working when only an Anthropic API key was provided: 1. Health endpoint only listened on port 10000 when OpenAI key was set, causing Docker healthcheck failures with Anthropic-only configs 2. http-proxy-middleware didn't route through Squid (no HTTP_PROXY support), replaced with https-proxy-agent for explicit Squid routing 3. Missing package-lock.json caused npm ci to fail during container build 4. Host-level iptables (DOCKER-USER) blocked agent→sidecar traffic 5. Agent iptables OUTPUT filter dropped TCP to sidecar IP 6. NO_PROXY not set, causing curl to route sidecar requests through Squid 7. Docker DNS couldn't resolve 'api-proxy' hostname in chroot mode, switched BASE_URLs to use IP addresses directly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... No actions taken; awaiting a concrete task request. |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
Build Test: Bun - Results
Overall: PASS ✅ All tests completed successfully!
|
Smoke Test Results: Copilot ✅Last 2 Merged PRs:
Test Results:
Overall Status: PASS cc @Mossaka
|
Deno Build Test Results
Overall: ✅ PASS All Deno tests completed successfully.
|
Build Test Results: Node.js
Overall: ✅ PASS All Node.js projects successfully installed dependencies and passed their test suites.
|
.NET Build Test ResultsAll .NET projects were successfully tested:
Overall: PASS Test Detailshello-world:
json-parse:
|
Smoke Test Results: Claude EngineLast 2 Merged PRs:
Test Results:
Status: PASS
|
Go Build Test Results ✅All Go projects successfully built and tested.
Overall: PASS ✅
|
Java Build Test Results
Overall: PASS ✅ All Java projects built and tested successfully through AWF with Maven proxy configuration.
|
C++ Build Test Results
Overall: PASS ✅ All C++ projects built successfully.
|
Rust Build Test Results
Overall: PASS ✅ All Rust projects built and tested successfully.
|
Smoke Test Results (Copilot)✅ GitHub MCP - Last 2 merged PRs:
✅ Playwright - Page title contains "GitHub" Status: PASS 🎉 cc @Mossaka
|
Build Test: Bun ✅
Overall: PASS ✅ All Bun projects successfully installed dependencies and passed their test suites.
|
Build Test: Node.js - PASS ✅
Overall: PASS ✅ All Node.js projects successfully installed and passed their test suites.
|
Smoke Test Results (Claude)Last 2 Merged PRs:
Tests:
Status: PASS
|
.NET Build Test Results ✅All .NET projects successfully built and ran through the firewall.
Overall: PASS Test Details
|
Security Review: Critical API Key Leakage Vulnerability FoundI've identified a critical security vulnerability in this PR that allows API keys to leak to the agent container when using 🔴 Critical: API Key Leakage with
|
Rust Build Test Results
Overall: PASS All Rust projects built and tested successfully.
|
Chroot Version Comparison Test ResultsThe chroot mode test compared runtime versions between the host and chroot container:
Overall Status: ❌ Tests did not pass completely The version mismatches for Python and Node.js are expected - chroot mode provides transparent access to host binaries, so minor version differences between the container and host environments are acceptable. The Go version matches exactly.
|
Java Build Test Results ✅All Java projects compiled and tested successfully through the AWF firewall.
Overall: PASS All Maven dependencies were successfully downloaded through the proxy, and all tests passed.
|
|
Merged PRs: fix: add roles: all to smoke-codex workflow | fix(ci): add missing ANTHROPIC_API_KEY to detection job
|
Add --enable-api-proxy to the awf command in the smoke-claude CI workflow so the API proxy sidecar is exercised during smoke tests. This validates that Claude Code works correctly when routed through the sidecar (ANTHROPIC_BASE_URL pointing to the proxy). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
Build Test: Node.js Results
Overall: ✅ PASS All Node.js projects successfully installed dependencies and passed their test suites.
|
Build Test: Deno
Overall: ✅ PASS All Deno tests completed successfully.
|
Go Build Test Results ✅All Go projects successfully built and tested!
Overall: PASS ✅ All modules downloaded successfully and all tests passed.
|
C++ Build Test Results
Overall: PASS ✅ All C++ projects built successfully.
|
Bun Build Test Results ✅
Overall: PASS ✅ All tests completed successfully with Bun v1.3.9.
|
Smoke Test Results - Copilot✅ GitHub MCP: Last 2 merged PRs retrieved
✅ Playwright: GitHub homepage verified (title contains "GitHub") Status: PASS 🎉 cc @Mossaka
|
|
Smoke Codex Test Report
|
|
Smoke Test Results: Claude Engine Last 2 merged PRs:
✅ GitHub MCP - Retrieved PRs Status: PASS
|
.NET Build Test Results
Overall: PASS ✅ All .NET projects successfully restored, built, and ran with expected output.
|
Build Test: Java - Results
Overall: PASS ✅ All Java projects compiled successfully and all tests passed.
|
Chroot Version Comparison Test Results
Overall Status: FAILED - Not all runtime versions match between host and chroot environments. The chroot mode successfully used the host's Go installation, but Python and Node.js versions differ between the host system and the chroot environment.
|
Rust Build Test Results ✅
Overall: PASS All Rust projects built and tested successfully.
|
Summary
Fixes several bugs in the API proxy sidecar (introduced in #751) that prevented it from working, especially with Anthropic-only configurations:
http-proxy-middlewaredoesn't respectHTTP_PROXYenv var. Replaced withhttps-proxy-agentfor explicit Squid CONNECT tunneling.containers/api-proxy/package-lock.jsonwas missing, causingnpm cito fail during Docker build.FW_WRAPPERchain (DOCKER-USER) didn't allow agent→sidecar traffic. Added ACCEPT rule for api-proxy IP.api-proxyhostname in chroot mode. SwitchedOPENAI_BASE_URL/ANTHROPIC_BASE_URLto use IP addresses directly.Test plan
tests/integration/api-proxy.test.ts) with 6 tests:ANTHROPIC_BASE_URLset correctly in agentOPENAI_BASE_URLset correctly in agentTCP_TUNNEL:HIER_DIRECTforapi.anthropic.com:443🤖 Generated with Claude Code