Skip to content

Conversation

@Claude
Copy link
Contributor

@Claude Claude AI commented Feb 13, 2026

This PR enables the API proxy sidecar by default for OpenAI/Codex API calls, while keeping Anthropic/Claude authentication in the agent container (like GitHub Copilot). The proxy isolates OpenAI credentials from the agent container and routes traffic through Squid for domain whitelisting.

Changes Made

API Proxy Configuration

  • Default --enable-api-proxy to true and update type/docs to reflect default-on behavior
  • API proxy now only deploys when OPENAI_API_KEY is present
  • Removed all Anthropic/Claude support from api-proxy (Anthropic keys are passed directly to agent container)

Networking and Routing

  • Use IP-based OPENAI_BASE_URL (http://172.30.0.30:10000) to avoid DNS issues
  • Bypass Squid for agent→api-proxy traffic via NO_PROXY + iptables allowances
  • Add host/container iptables exemptions for api-proxy connectivity
  • Keep api-proxy container running even when no API keys present (for healthchecks)

Implementation Details

  • Always build api-proxy image locally (not yet published to GHCR)
  • OpenAI proxy uses explicit HttpsProxyAgent to route through Squid
  • API proxy injects Authorization: Bearer ${OPENAI_API_KEY} headers
  • Anthropic/Claude uses ANTHROPIC_API_KEY directly in agent (like GitHub Copilot tokens)

Testing

  • ✅ Updated tests for OpenAI-only api-proxy deployment
  • ✅ Added coverage for NO_PROXY and AWF_API_PROXY_IP environment variables
  • ✅ Verified iptables rules for api-proxy bypass
  • ✅ All docker-manager tests passing (175/175)

Claude AI and others added 2 commits February 13, 2026 04:00
Changed --enable-api-proxy flag default from false to true.
Updated types.ts @default documentation to reflect new default.
All existing tests pass.

Co-authored-by: lpcox <[email protected]>
Updated documentation to clarify that API proxy is now enabled by default.
Added examples showing that the flag is optional and how to disable it.

Co-authored-by: lpcox <[email protected]>
@Claude Claude AI changed the title [WIP] Enable API proxy by default instead of CLI flag feat(cli): enable API proxy by default Feb 13, 2026
@Claude Claude AI requested a review from lpcox February 13, 2026 04:02
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Chroot tests failed Smoke Chroot failed - See logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 82.92% 82.98% 📈 +0.06%
Statements 82.91% 82.97% 📈 +0.06%
Functions 82.74% 82.74% ➡️ +0.00%
Branches 74.92% 74.87% 📉 -0.05%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/docker-manager.ts 84.8% → 85.0% (+0.22%) 84.3% → 84.5% (+0.21%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

…#798)

* Initial plan

* fix: add --build-local flag to example scripts

Co-authored-by: lpcox <[email protected]>

* fix: add --build-local to github-copilot.sh for consistency

Co-authored-by: lpcox <[email protected]>

* fix: build only api-proxy locally, pull squid and agent from GHCR

Co-authored-by: lpcox <[email protected]>

---------

Co-authored-by: anthropic-code-agent[bot] <[email protected]>
Co-authored-by: lpcox <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Chroot tests failed Smoke Chroot failed - See logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

* Initial plan

* fix: add missing package-lock.json for api-proxy container

Co-authored-by: lpcox <[email protected]>

---------

Co-authored-by: anthropic-code-agent[bot] <[email protected]>
Co-authored-by: lpcox <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Chroot tests failed Smoke Chroot failed - See logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

* Initial plan

* fix(api-proxy): keep containers running when no API keys present

The api-proxy container was exiting immediately when no API keys were
configured because the HTTP servers were only started conditionally.
This caused docker-compose health checks to fail and prevented
containers from starting.

Changed server.js to always start both HTTP servers (ports 10000 and
10001), with conditional middleware setup based on API key presence.
This keeps the container running and health checks passing even when
API keys are not configured.

Fixes issue where test-examples workflow failed with "dependency
failed to start: container awf-api-proxy exited (0)"

Co-authored-by: lpcox <[email protected]>

---------

Co-authored-by: anthropic-code-agent[bot] <[email protected]>
Co-authored-by: lpcox <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

Deno Build Test Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

All Deno tests completed successfully.

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

Node.js Build Test Results

Project Install Tests Status
clsx PASS PASS
execa PASS PASS
p-limit PASS PASS

Overall: PASS

All Node.js projects successfully installed dependencies and passed their test suites.

AI generated by Build Test Node.js

@github-actions
Copy link
Contributor

Smoke Test Results (Run 21981890332)

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved last 2 merged PRs
  • ✅ Playwright: Verified GitHub page title contains "GitHub"
  • ✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-copilot-21981890332.txt
  • ✅ Bash Tool: Verified file content successfully

Overall Status: PASS

cc: @Claude @lpcox

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Go Build Test Results

Project Download Tests Status
color 1/1 PASS
env 1/1 PASS
uuid 1/1 PASS

Overall: PASS

All Go projects built and tested successfully.

AI generated by Build Test Go

@github-actions
Copy link
Contributor

C++ Build Test Results

Project CMake Build Status
fmt PASS
json PASS

Overall: PASS

All C++ projects built successfully.

AI generated by Build Test C++

@github-actions
Copy link
Contributor

Deno Build Test Results

Project Tests Status
oak 1/1 ✅ PASS
std 1/1 ✅ PASS

Overall: ✅ PASS

All Deno tests completed successfully.

AI generated by Build Test Deno

@github-actions
Copy link
Contributor

🦀 Rust Build Test Results

Project Build Tests Status
fd 1/1 PASS
zoxide 1/1 PASS

Overall: ✅ PASS

All Rust projects built and tested successfully.

AI generated by Build Test Rust

@github-actions
Copy link
Contributor

.NET Build Test Results

Project Restore Build Run Status
hello-world PASS
json-parse PASS

Overall: PASS

All .NET projects built and ran successfully:

  • hello-world: Restored, built, and printed "Hello, World!"
  • json-parse: Restored, built, and successfully parsed JSON output

AI generated by Build Test .NET

@github-actions
Copy link
Contributor

☕ Java Build Test Results

Project Compile Tests Status
gson 1/1 PASS
caffeine 1/1 PASS

Overall: ✅ PASS

All Java projects compiled and tested successfully through the AWF firewall.

AI generated by Build Test Java

@github-actions
Copy link
Contributor

Chroot Test Results

The chroot version comparison tests have been executed. Here are the results:

Runtime Host Version Chroot Version Match?
Python 3.12.12 3.12.3 ❌ NO
Node.js v24.13.0 v20.20.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall Status: ❌ Tests did not pass

The chroot environment is not using the same runtime versions as the host. This may indicate that the transparent host binary access is not working as expected for Python and Node.js.

AI generated by Smoke Chroot

@lpcox lpcox changed the title Addressing PR comments feat: use api-proxy for codex Feb 13, 2026
* Initial plan

* fix(ci): add missing ANTHROPIC_API_KEY to detection job

The detection job was failing with "Not logged in · Please run /login" because
ANTHROPIC_API_KEY was not being passed to the Claude Code CLI execution step.

The job validates that ANTHROPIC_API_KEY exists (line 1091) but was not
passing it to the claude CLI command execution (line 1124+). This fix adds
ANTHROPIC_API_KEY to the env block of the "Execute Claude Code CLI" step
in the detection job, matching the configuration in the agent job.

Co-authored-by: lpcox <[email protected]>

---------

Co-authored-by: anthropic-code-agent[bot] <[email protected]>
Co-authored-by: lpcox <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 82.88% 83.22% 📈 +0.34%
Statements 82.88% 83.25% 📈 +0.37%
Functions 82.74% 82.74% ➡️ +0.00%
Branches 74.87% 75.75% 📈 +0.88%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/squid-config.ts 99.4% → 99.5% (+0.07%) 99.4% → 99.5% (+0.07%)
src/docker-manager.ts 84.7% → 85.2% (+0.54%) 84.2% → 84.9% (+0.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link
Contributor

Smoke Test Results ✅ PASS

Recent PRs:

Tests:

  • ✅ GitHub MCP: Retrieved 2 merged PRs
  • ✅ Playwright: Page title contains "GitHub"
  • ✅ File Write: Created /tmp/gh-aw/agent/smoke-test-copilot-21982222400.txt
  • ✅ Bash: Verified file content

cc @lpcox

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Node.js Build Test Results

Project Install Tests Status
clsx PASS PASS
execa PASS PASS
p-limit PASS PASS

Overall: PASS

All three Node.js projects successfully installed dependencies and passed their test suites.

AI generated by Build Test Node.js

@github-actions
Copy link
Contributor

C++ Build Test Results

Project CMake Build Status
fmt PASS
json PASS

Overall: PASS

All C++ projects built successfully.

AI generated by Build Test C++

@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved PRs successfully
  • ✅ Playwright: Verified GitHub homepage (title: "GitHub · Change is constant...")
  • ✅ File Writing: Created test file at /tmp/gh-aw/agent/smoke-test-claude-21982222413.txt
  • ✅ Bash: Verified file contents

Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

Go Build Test Results

Project Download Tests Status
color PASS ✅ PASS
env PASS ✅ PASS
uuid PASS ✅ PASS

Overall: ✅ PASS

All Go projects built and tested successfully.

AI generated by Build Test Go

@github-actions
Copy link
Contributor

Build Test: Bun ✅

Project Install Tests Status
elysia 1/1 PASS
hono 1/1 PASS

Overall: PASS

  • Bun version: 1.3.9
  • All tests completed successfully

AI generated by Build Test Bun

@github-actions
Copy link
Contributor

.NET Build Test Results

Project Restore Build Run Status
hello-world PASS
json-parse PASS

Overall: PASS

All .NET projects successfully restored, built, and executed:

  • hello-world: Output "Hello, World!"
  • json-parse: Successfully parsed JSON and displayed structured output

AI generated by Build Test .NET

@github-actions
Copy link
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.12 Python 3.12.3 ❌ NO
Node.js v24.13.0 v20.20.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall Status: ❌ Tests did not pass - version mismatches detected

The chroot environment is not using the exact same runtime versions as the host. This is expected behavior since the chroot mode mounts host binaries but may have different system libraries or configurations.

AI generated by Smoke Chroot

@github-actions
Copy link
Contributor

Java Build Test Results ✅

All Java projects compiled and tested successfully through the AWF firewall.

Project Compile Tests Status
gson 1/1 PASS
caffeine 1/1 PASS

Overall: PASS

Maven proxy configuration required IP address 172.30.0.10:3128 instead of hostname to work correctly with the firewall setup.

AI generated by Build Test Java

@lpcox
Copy link
Collaborator

lpcox commented Feb 13, 2026

@claude[agent] could we replace the hand-built api-proxy that is used for codex with nginx?

@Claude
Copy link
Contributor Author

Claude AI commented Feb 13, 2026

@claude[agent] could we replace the hand-built api-proxy that is used for codex with nginx?

Yes, nginx could replace the Node.js api-proxy. It has the necessary features:

nginx capabilities:

  • Reverse proxy with proxy_pass https://api.openai.com
  • Header injection via proxy_set_header Authorization "Bearer $OPENAI_API_KEY"
  • Health check endpoint (simple location returning 200)
  • Route through Squid via upstream proxy configuration

Implementation considerations:

  • Config templating needed (envsubst) to inject OPENAI_API_KEY at container startup
  • More complex setup for HTTPS-through-Squid tunneling compared to current HttpsProxyAgent
  • Would eliminate Node.js runtime and npm dependencies (~50MB smaller image)

The current implementation works well, but nginx would be a viable alternative if you prefer a more traditional reverse proxy. Would you like me to implement the nginx version?

@Claude Claude AI changed the title feat: use api-proxy for codex feat: use api-proxy for OpenAI/Codex only Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants