Skip to content

Comments

feat(api-proxy): centralize port configuration in types.ts#955

Merged
lpcox merged 3 commits intomainfrom
claude/centralize-api-proxy-ports
Feb 18, 2026
Merged

feat(api-proxy): centralize port configuration in types.ts#955
lpcox merged 3 commits intomainfrom
claude/centralize-api-proxy-ports

Conversation

@Claude
Copy link
Contributor

@Claude Claude AI commented Feb 18, 2026

  • Explore all api-proxy port references in codebase
  • Create centralized API_PROXY_PORTS constant in types.ts
  • Update docker-manager.ts to use centralized constants
  • Update host-iptables.ts to use centralized constants and include port 10002
  • Update containers/api-proxy/Dockerfile to expose port 10002
  • Update documentation to include all three ports
  • Run tests to verify changes (all 193 tests passing)
  • Store memory for future reference
  • Document environment variables for each container (squid, api-proxy, agent)
  • Document which token variables are redacted with placeholders
  • Add comprehensive environment variable table to docs/api-proxy-sidecar.md

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Document and centralize API proxy ports for agents feat(api-proxy): centralize port configuration in types.ts Feb 18, 2026
@Claude Claude AI requested a review from lpcox February 18, 2026 00:20
Add comprehensive environment variable documentation for squid, api-proxy,
and agent containers. Clearly document which token variables are redacted
with placeholder values ('placeholder-token-for-credential-isolation') in
the agent container for credential isolation.

Key additions:
- Separate tables for each container's environment variables
- Document real credentials in api-proxy vs placeholders in agent
- Explain one-shot-token protection mechanism
- Include all three API proxy endpoints (OpenAI, Anthropic, Copilot)

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 82.35% 82.45% 📈 +0.10%
Statements 82.27% 82.37% 📈 +0.10%
Functions 82.74% 82.74% ➡️ +0.00%
Branches 74.46% 74.55% 📈 +0.09%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/host-iptables.ts 78.6% → 77.9% (-0.69%) 78.8% → 78.1% (-0.68%)
src/docker-manager.ts 83.2% → 83.8% (+0.59%) 82.5% → 83.0% (+0.58%)
✨ New Files (1 files)
  • src/types.ts: 100.0% lines

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

@github-actions
Copy link
Contributor

Bun Build Test Results

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

Overall: PASS

All Bun projects built and tested successfully.

AI generated by Build Test Bun

@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

All Node.js projects successfully installed and passed their tests.

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

Overall: ✅ PASS

All 3 projects completed successfully with no errors.

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++ builds completed successfully.

AI generated by Build Test C++

@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 Merged PRs:

Test Results:
✅ GitHub MCP - Successfully retrieved merged PRs
✅ Playwright - Navigated to github.com, title contains "GitHub"
✅ File Write - Created /tmp/gh-aw/agent/smoke-test-copilot-22121318781.txt
✅ Bash - Successfully read file back

Overall Status: PASS

cc: @Copilot @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 successfully downloaded dependencies and passed their tests.

AI generated by Build Test Go

@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 restored, built, and executed successfully.

AI generated by Build Test .NET

@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 Merged PRs:

  • chore: bump version to 0.19.2
  • feat: add github copilot api proxy support

Test Results:

  • ✅ GitHub MCP (list PRs)
  • ✅ Playwright (github.com navigation, title verified)
  • ✅ File write (/tmp/gh-aw/agent/smoke-test-claude-22121318760.txt)
  • ✅ Bash (file read verification)

Overall Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

✅ Java Build Test Results

All Java projects compiled and tested successfully through the firewall.

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

Overall: PASS


Test Details:

  • Repository: Mossaka/gh-aw-firewall-test-java
  • Maven proxy configured: 172.30.0.10:3128
  • All dependencies downloaded successfully through Squid proxy
  • All tests executed without errors

AI generated by Build Test Java

@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

🔍 Chroot Version Comparison Test 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

Result: Tests FAILED - Not all runtime versions match between host and chroot environment.

The chroot mode allows binaries from the host system to be transparently accessed inside the container, but version mismatches between the agent container's base environment and the host can occur.

AI generated by Smoke Chroot

@github-actions
Copy link
Contributor

Smoke Test Results (2026-02-18)
Merged PRs reviewed: feat: add github copilot api proxy support; docs: convert API proxy docs to Starlight format
safeinputs-gh pr list: ✅
Playwright github.com title contains GitHub: ✅
Tavily search: ❌ (Tavily MCP tool unavailable; web search returned results)
File write: ✅
Bash cat verification: ✅
Discussion comment: ✅ (discussion #454)
Build npm ci && npm run build: ✅
Overall: FAIL

AI generated by Smoke Codex

@lpcox lpcox marked this pull request as ready for review February 18, 2026 17:05
Copilot AI review requested due to automatic review settings February 18, 2026 17:05
@lpcox lpcox merged commit 6b82715 into main Feb 18, 2026
91 of 93 checks passed
@lpcox lpcox deleted the claude/centralize-api-proxy-ports branch February 18, 2026 17:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request centralizes API proxy port configuration by creating a single source of truth for port numbers in types.ts. Previously, port numbers (10000, 10001, 10002) were hardcoded throughout the codebase. This refactoring improves maintainability by establishing the API_PROXY_PORTS constant and updating all references in TypeScript code to use it.

Changes:

  • Created API_PROXY_PORTS constant in types.ts with comprehensive documentation
  • Updated docker-manager.ts and host-iptables.ts to use centralized port constants
  • Enhanced documentation in api-proxy-sidecar.md with detailed environment variable tables for all three containers (squid, api-proxy, agent)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types.ts Added API_PROXY_PORTS constant and API_PROXY_HEALTH_PORT, updated JSDoc comments with links to constants
src/docker-manager.ts Imported and used API_PROXY_PORTS and API_PROXY_HEALTH_PORT constants instead of hardcoded port numbers
src/host-iptables.ts Imported API_PROXY_PORTS constant and uses Math.min/max to calculate port range dynamically
containers/api-proxy/Dockerfile Updated to expose port 10002 for GitHub Copilot with clarifying comments
docs/api-proxy-sidecar.md Added comprehensive environment variable tables for squid, api-proxy, and agent containers with detailed explanations of credential isolation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants