Conversation
…rors for missing credentials - Set alwaysBind: true on anthropic (10001), copilot (10002), and opencode (10004) - Add getUnconfiguredResponse() with structured JSON error to anthropic, copilot, opencode - Add getUnconfiguredHealthResponse() to anthropic, copilot, opencode - Add /reflect endpoint to all non-management ports in createProviderServer - Add tests: provider alwaysBind, per-port /reflect, unconfigured responses Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/d4103478-b044-4540-803b-cbf046329111 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR updates the containers/api-proxy sidecar so provider ports bind even when credentials aren’t configured, and unconfigured providers return consistent, machine-readable 503 errors (instead of connection refused). It also makes /reflect available on non-management ports to improve agent-side discovery/debugging.
Changes:
- Add a provider-local
GET /reflecthandler tocreateProviderServer()so reflection data is available from any provider port. - Set
alwaysBind: trueand add structuredgetUnconfiguredResponse()/getUnconfiguredHealthResponse()for Anthropic, Copilot, and OpenCode adapters. - Extend Jest coverage for
/reflecton non-management ports and for adapteralwaysBind/ unconfigured responses.
Show a summary per file
| File | Description |
|---|---|
| containers/api-proxy/server.js | Adds provider-local /reflect handling before disabled-adapter proxy logic. |
| containers/api-proxy/providers/anthropic.js | Forces port binding when unconfigured; adds structured 503 + /health not_configured response. |
| containers/api-proxy/providers/copilot.js | Forces port binding when unconfigured; adds structured 503 + /health not_configured response. |
| containers/api-proxy/providers/opencode.js | Forces port binding when unconfigured; adds structured 503 + /health not_configured response. |
| containers/api-proxy/server.test.js | Adds tests for /reflect on non-management ports and alwaysBind/unconfigured adapter responses. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
containers/api-proxy/providers/opencode.js:205
- Same issue as above: when AWF_ENABLE_OPENCODE=true but no candidate adapters are enabled, the message lists COPILOT_GITHUB_TOKEN but omits COPILOT_API_KEY even though COPILOT_API_KEY can enable the Copilot candidate. Include COPILOT_API_KEY here as well for accuracy.
statusCode: 503,
body: {
error: {
message: 'Credentials for OpenCode (port 10004) are not configured. Set at least one of OPENAI_API_KEY, ANTHROPIC_API_KEY, or COPILOT_GITHUB_TOKEN.',
type: 'provider_not_configured',
provider: 'opencode',
port: 10004,
},
},
- Files reviewed: 5/5 changed files
- Comments generated: 1
| statusCode: 503, | ||
| body: { | ||
| error: { | ||
| message: 'OpenCode proxy (port 10004) is not enabled. Set AWF_ENABLE_OPENCODE=true and configure at least one of OPENAI_API_KEY, ANTHROPIC_API_KEY, or COPILOT_GITHUB_TOKEN.', | ||
| type: 'provider_not_configured', | ||
| provider: 'opencode', | ||
| port: 10004, | ||
| }, | ||
| }, |
This comment has been minimized.
This comment has been minimized.
|
@copilot address the review feedback |
…r messages Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/c897ec94-027b-4ce5-8d61-e9c34d171ed9 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Done in 69f304a — both OpenCode error messages (the "not enabled" path and the "enabled but no credentials" path) now list Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… fallback fix The previous gh aw compile changed too much (--build-local → --image-tag, actions/github-script SHA, sparse-checkout, cron). Restore the original lock.yml and apply only the minimal pre-compute fix: - gh pr list: add || echo "(PR fetch failed)" - curl: add || echo "000" The smoke test now builds AWF from source (--build-local) to test this PR's api-proxy changes, matching the original design. Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/b7580b55-1cca-4fd3-80e3-e64ed70dabd7 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Fixed in The previous commit ( The new commit restores the original lock.yml and applies only the minimal two-line fix to the pre-compute step (adding |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/25352773611/job/74335853394?pr=2520 |
The .md file was updated (pre-compute step fallbacks) but the lock.yml was restored to the old version with the old frontmatter_hash. gh-aw's lock-file check computes SHA-256 of the frontmatter and rejects the workflow if it doesn't match. Update the hash from 930022900b...793f3 → f8f1a5a5...8ee to match the current .md. Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/670a8af0-0617-4ad9-94f8-79aa9d8b2beb Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Fixed in The activation job checks a SHA-256 hash of the |
|
Smoke: Copilot BYOK —
Running in BYOK offline mode ( Overall: PASS
|
|
✅ Smoke Test Results
Status: PASS
|
🔬 Smoke Test Results
PR: "api-proxy: listen on all ports unconditionally, return clear errors for missing credentials" Overall: PARTIAL — MCP ✅, pre-computed test data not injected (raw
|
Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
Smoke Test Results: Gemini Engine
Overall Status: PASS
|
|
PRs: fix(api-proxy): strip accidental "Bearer " prefix in BYOK Copilot auth token; fix: remove unused exports from public API surface Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: Services Connectivity — ❌ FAIL
|
Ports without configured credentials were never started, so agents probing
/healthor/reflectgot TCP connection refused instead of a useful error. This affected ports 10001 (Anthropic), 10002 (Copilot), and 10004 (OpenCode).Changes
Always bind all agent ports
alwaysBind: trueon Anthropic (10001), Copilot (10002), and OpenCode (10004) adaptersparticipatesInValidationstaysfalsewhen unconfigured — startup latch is unaffectedStructured 503 for uncredentialed proxy requests
Each unconfigured adapter now returns a machine-readable error instead of a string or connection refused:
{ "error": { "message": "Credentials for GitHub Copilot (port 10002) are not configured. Set COPILOT_GITHUB_TOKEN or COPILOT_API_KEY to enable this provider.", "type": "provider_not_configured", "provider": "copilot", "port": 10002 } }/reflecton every portAdded a
/reflectGET handler tocreateProviderServer(non-management ports). Returns the same fullreflectEndpoints()payload as port 10000, so agents can discover all provider state from any port./healthon unconfigured portsEach new adapter implements
getUnconfiguredHealthResponse()returning{ status: 'not_configured', service: '...', error: '...' }— consistent with the existing Gemini pattern.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.example.com/opt/hostedtoolcache/node/20.20.2/x64/bin/node node /home/REDACTED/work/gh-aw-firewall/gh-aw-firewall/containers/api-proxy/node_modules/.bin/jest server.test.js --ci s/.bin/napi-postinstall(dns block)/opt/hostedtoolcache/node/20.20.2/x64/bin/node node /home/REDACTED/work/gh-aw-firewall/gh-aw-firewall/containers/api-proxy/node_modules/.bin/jest server.test.js --ci(dns block)/opt/hostedtoolcache/node/20.20.2/x64/bin/node /opt/hostedtoolcache/node/20.20.2/x64/bin/node /home/REDACTED/work/gh-aw-firewall/gh-aw-firewall/containers/api-proxy/node_modules/jest-worker/build/processChild.js(dns block)If you need me to access, download, or install something from one of these locations, you can either: