feat(proxy): add --openai-api-target and --anthropic-api-target flags#1249
feat(proxy): add --openai-api-target and --anthropic-api-target flags#1249
Conversation
|
@copilot fix the pr title and summary |
Updated the PR description with a proper summary. The PR title should be updated to |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 82.42% | 82.50% | 📈 +0.08% |
| Statements | 82.42% | 82.49% | 📈 +0.07% |
| Functions | 82.77% | 82.77% | ➡️ +0.00% |
| Branches | 74.82% | 74.48% | 📉 -0.34% |
📁 Per-file Coverage Changes (1 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/docker-manager.ts |
84.0% → 84.3% (+0.29%) | 83.3% → 83.6% (+0.29%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
PR titles:
|
Smoke Test ResultsRecent merged PRs:
Overall: PASS
|
Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environment.
|
This comment has been minimized.
This comment has been minimized.
|
Smoke test results for run ✅ GitHub MCP — last 2 merged PRs: Overall: PASS
|
There was a problem hiding this comment.
Pull request overview
This PR adds two new CLI flags (--openai-api-target and --anthropic-api-target) to configure custom upstream API endpoints for the api-proxy sidecar, enabling AWF to work with internal LLM routers, Azure OpenAI, and other OpenAI/Anthropic-compatible endpoints instead of the hardcoded defaults.
Changes:
- Added
--openai-api-targetand--anthropic-api-targetCLI flags and correspondingWrapperConfigfields, following the existing--copilot-api-targetpattern. - Passes the new target values as
OPENAI_API_TARGET/ANTHROPIC_API_TARGETenvironment variables to the api-proxy container. - Updated
server.jsto read these env vars (with defaults toapi.openai.com/api.anthropic.com) and use them in allproxyRequestcalls.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/types.ts |
Added openaiApiTarget and anthropicApiTarget optional fields to WrapperConfig with documentation |
src/cli.ts |
Added CLI flag definitions and wiring of options/env vars into config |
src/docker-manager.ts |
Passes new target env vars to api-proxy container and adds debug logging |
containers/api-proxy/server.js |
Reads configurable targets from env vars and uses them in proxy routing and startup logging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 82.42% | 82.50% | 📈 +0.08% |
| Statements | 82.42% | 82.49% | 📈 +0.07% |
| Functions | 82.77% | 82.77% | ➡️ +0.00% |
| Branches | 74.82% | 74.48% | 📉 -0.34% |
📁 Per-file Coverage Changes (1 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/docker-manager.ts |
84.0% → 84.3% (+0.29%) | 83.3% → 83.6% (+0.29%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
Smoke test results for run 22982054129 ✅ GitHub MCP: Last 2 merged PRs — #1243: Overall: PASS
|
|
PR titles: feat(cli): add --memory-limit flag for configurable container memory | test: expand credential hiding tests to all 14 protected paths
|
Smoke Test Results✅ GitHub MCP: #1243 feat(cli): add --memory-limit flag, #1163 test: expand credential hiding tests Overall: PASS
|
Chroot Version Comparison Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environment.
|
This comment has been minimized.
This comment has been minimized.
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 82.42% | 82.00% | 📉 -0.42% |
| Statements | 82.42% | 81.96% | 📉 -0.46% |
| Functions | 82.77% | 81.99% | 📉 -0.78% |
| Branches | 74.82% | 73.36% | 📉 -1.46% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/cli.ts |
47.8% → 46.5% (-1.23%) | 48.1% → 46.8% (-1.33%) |
src/docker-manager.ts |
84.0% → 84.3% (+0.29%) | 83.3% → 83.6% (+0.29%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
…ests (#1250) * Initial plan * fix(ci): skip agentic workflow activation for bot-triggered pull requests Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 82.42% | 82.00% | 📉 -0.42% |
| Statements | 82.42% | 81.96% | 📉 -0.46% |
| Functions | 82.77% | 81.99% | 📉 -0.78% |
| Branches | 74.82% | 73.36% | 📉 -1.46% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/cli.ts |
47.8% → 46.5% (-1.23%) | 48.1% → 46.8% (-1.33%) |
src/docker-manager.ts |
84.0% → 84.3% (+0.29%) | 83.3% → 83.6% (+0.29%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
Smoke test results:
|
Smoke Test Results
Overall: PASS
|
🤖 Smoke Test Results
Last 2 merged PRs:
Overall: PASS ✅
|
Chroot Version Comparison Results
Result: FAILED — Python and Node.js versions differ between host and chroot environments.
|
…t coverage for API target validation (#1251) * Initial plan * fix: resolve failing Build and Lint (Node 22) CI workflow Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 82.42% | 82.32% | 📉 -0.10% |
| Statements | 82.42% | 82.32% | 📉 -0.10% |
| Functions | 82.77% | 82.93% | 📈 +0.16% |
| Branches | 74.82% | 74.03% | 📉 -0.79% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/docker-manager.ts |
84.0% → 84.3% (+0.29%) | 83.3% → 83.6% (+0.29%) |
src/cli.ts |
47.8% → 48.2% (+0.45%) | 48.1% → 48.7% (+0.55%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Smoke Test Results
Overall: PASS
|
Smoke Test Results✅ GitHub MCP — Last 2 merged PRs:
✅ Playwright — Overall: PASS Author:
|
|
Smoke test summary
|
…bs (#1252) * Initial plan * fix(ci): remove unused Setup Scripts step from update_cache_memory jobs Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@copilot fix the pr title and summary |
…in api-proxy-sidecar.md Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Add
--openai-api-targetand--anthropic-api-targetCLI flags to configure custom upstream API endpoints in the api-proxy, enabling AWF to work with internal LLM routers, Azure OpenAI, and other custom OpenAI-compatible endpoints instead of the hardcodedapi.openai.com/api.anthropic.comdefaults.Changes Made
src/cli.ts: Added--openai-api-targetand--anthropic-api-targetCLI flags withOPENAI_API_TARGET/ANTHROPIC_API_TARGETenv var fallback; addedvalidateApiTargetInAllowedDomains()that warns at startup when a custom target is not covered by--allow-domains; extractedDEFAULT_OPENAI_API_TARGETandDEFAULT_ANTHROPIC_API_TARGETconstantssrc/types.ts: AddedopenaiApiTargetandanthropicApiTargetoptional fields toWrapperConfigsrc/docker-manager.ts: PassesOPENAI_API_TARGETandANTHROPIC_API_TARGETenvironment variables to the api-proxy container with debug loggingcontainers/api-proxy/server.js: Reads configurable upstream targets from environment variables, falling back to the default public endpoints when not set; startup log now includes the active target hostnamesrc/cli.test.ts: Added unit tests forvalidateApiTargetInAllowedDomainsand the default target constantsdocs/api-proxy-sidecar.md: Documented--openai-api-target,--anthropic-api-target, and--copilot-api-targetin the Configuration reference section, including the requirement to add custom targets to--allow-domains💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.