Conversation
- Add //go:build !integration tags to enable_api_proxy_test.go and docker_api_proxy_test.go - Add Pi engine test case to TestEngineAWFEnableApiProxy (verifies apiProxy.enabled in AWF config JSON) - Add Pi engine test case to TestCollectDockerImages_APIProxyForEnginesWithLLMGateway (verifies api-proxy container is included) - Add three firewall routing tests in pi_engine_test.go verifying that copilot/, anthropic/, and codex/ model prefixes route through the correct LLM gateway port via models.json Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c959eaa6-7688-4814-b0cc-63d92185eaef Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c959eaa6-7688-4814-b0cc-63d92185eaef Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Dev completed successfully! |
|
@copilot fix the code that generate base64 encoded conflig, using printf humans readable config |
|
@copilot /reflect is failing, investigate github/gh-aw-firewall what this could be. [gh-aw/pi-provider] 2026-05-04T00:25:47.135Z awf-reflect: fetching http://api-proxy:10000/reflect (timeout=5000ms) |
…able approach Replace `echo <base64> | base64 -d > models.json` with `printf '%s\n' '<json>' > models.json` matching the AWF config file pattern. Remove now-unused encodeBase64 helper and encoding/base64 import. Update tests to assert against the raw JSON content directly. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/eb525114-2fdb-4e62-95ca-8a0a1975eb0e Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 598e060. Replaced |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e62cbd13-97d7-401d-9e51-9b8fe8a05414 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Root cause of /reflect failure: Pi's models.json was using `http://host.docker.internal:{port}` as the baseUrl, but host.docker.internal points to the Docker host (runner machine), NOT the api-proxy sidecar container. The api-proxy is accessible within the AWF Docker network via `http://api-proxy:{port}`. Also fixes resolveGatewayUrl() in pi_provider.cjs to use the correct hostname and gh-aw-firewall port assignments: anthropic=10001, openai/codex=10000, copilot=10002, google=10003 Tests updated to assert api-proxy: appears in models.json JSON and host.docker.internal is absent from the generated payload. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e62cbd13-97d7-401d-9e51-9b8fe8a05414 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Root cause found by investigating From // api-proxy URLs from inside the agent container:
// http://api-proxy:10000 (OpenAI / management port — also hosts /reflect)
// http://api-proxy:10001 (Anthropic)
// http://api-proxy:10002 (Copilot)
// http://api-proxy:10003 (Gemini)Fixed in bc15a8b:
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:
|
|
@copilot merge main and recompile |
There was a problem hiding this comment.
Pull request overview
Adds Pi engine coverage and updates Pi’s AWF api-proxy routing configuration so LLM traffic is routed via the api-proxy sidecar using a readable models.json setup step.
Changes:
- Add Pi-focused tests to validate AWF api-proxy enablement and inclusion of the
api-proxysidecar image. - Update Pi engine to generate
models.jsonviaprintfand fixbaseUrlhostname toapi-proxy. - Update Pi provider extension diagnostics and regenerate workflow lockfiles (env + rendered command updates).
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/pi_engine.go | Switch models.json generation to printf and use api-proxy hostname in baseUrl. |
| pkg/workflow/pi_engine_test.go | Add firewall routing tests validating models.json + AWF api-proxy enablement. |
| pkg/workflow/enable_api_proxy_test.go | Add Pi case asserting apiProxy.enabled=true appears in AWF config JSON. |
| pkg/workflow/docker_api_proxy_test.go | Add Pi case asserting api-proxy image is collected for firewall runs. |
| actions/setup/js/pi_provider.cjs | Update diagnostic gateway URL resolution to api-proxy hostname and new port mapping. |
| .github/workflows/weekly-issue-summary.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/typist.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/terminal-stylist.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/stale-repo-identifier.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-workflow-call.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-update-cross-repo-pr.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-test-tools.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-temporary-id.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-service-ports.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-project.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-pi.lock.yml | Add GH_AW_OTLP_ENDPOINTS env and update rendered Pi models.json command to printf + api-proxy hostname. |
| .github/workflows/smoke-opencode.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-multi-pr.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-gemini.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-create-cross-repo-pr.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-copilot-arm.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-codex.lock.yml | Add GH_AW_OTLP_ENDPOINTS env (plus regenerated heredoc IDs). |
| .github/workflows/smoke-call-workflow.lock.yml | Add GH_AW_OTLP_ENDPOINTS env (plus regenerated heredoc IDs). |
| .github/workflows/smoke-agent-scoped-approved.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-agent-public-none.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-agent-public-approved.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-agent-all-none.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/smoke-agent-all-merged.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/sergo.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/schema-consistency-checker.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/safe-output-health.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/repository-quality-improver.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/repo-audit-analyzer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/prompt-clustering-analysis.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/mcp-inspector.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/lockfile-stats.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/go-fan.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/github-remote-mcp-auth-test.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/github-mcp-tools-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/github-mcp-structural-analysis.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/example-workflow-analyzer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/docs-noob-tester.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/developer-docs-consolidator.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/dev.lock.yml | Update rendered Pi models.json command to printf + api-proxy hostname. |
| .github/workflows/delight.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-workflow-updater.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-token-consumption-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-testify-uber-super-expert.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-team-status.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-team-evolution-insights.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-syntax-error-quality.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-skill-optimizer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-sentrux-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-semgrep-scan.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-security-red-team.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-security-observability.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-secrets-analysis.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-safe-outputs-conformance.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-safe-output-optimizer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-safe-output-integrator.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-repo-chronicle.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-rendering-scripts-verifier.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-regulatory.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-performance-summary.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-otel-instrumentation-advisor.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-observability-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env (plus regenerated heredoc IDs). |
| .github/workflows/daily-news.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-multi-device-docs-tester.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-model-inventory.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-mcp-concurrency-analysis.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-malicious-code-scan.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-issues-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-hippo-learn.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-function-namer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-firewall-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-file-diet.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-fact.lock.yml | Add GH_AW_OTLP_ENDPOINTS env (plus regenerated heredoc IDs). |
| .github/workflows/daily-experiment-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-doc-updater.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-doc-healer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-compiler-quality.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-community-attribution.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-code-metrics.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-cli-tools-tester.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-cli-performance.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-choice-test.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-caveman-optimizer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-cache-strategy-analyzer.lock.yml | Add GH_AW_OTLP_ENDPOINTS env (plus regenerated heredoc IDs). |
| .github/workflows/daily-aw-cross-repo-compile-check.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-assign-issue-to-user.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/daily-architecture-diagram.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/copilot-token-audit.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/copilot-session-insights.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/copilot-pr-prompt-analysis.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/copilot-pr-nlp-analysis.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/copilot-pr-merged-report.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/copilot-agent-analysis.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/claude-code-user-docs-review.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/blog-auditor.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
| .github/workflows/audit-workflows.lock.yml | Add GH_AW_OTLP_ENDPOINTS env. |
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)
pkg/workflow/pi_engine_test.go:339
- This test expects Codex/OpenAI routing to use constants.CodexLLMGatewayPort (currently 10001), but the api-proxy /reflect contract used by other setup JS tests indicates OpenAI traffic uses port 10000 (actions/setup/js/awf_reflect_summary.test.cjs SAMPLE_REFLECT endpoints["openai"].port=10000), and the updated resolveGatewayUrl() maps codex→10000. If Codex should share the OpenAI gateway port, this test should assert 10000 (or whatever the shared source of truth is) so it actually validates the intended routing.
- Files reviewed: 101/101 changed files
- Comments generated: 3
| // printf '%s\n' '<json>' is safe here because JSON uses only double quotes | ||
| // (never single quotes), so single-quoting via shellEscapeArg requires no | ||
| // further escaping in practice. |
| function resolveGatewayUrl(provider) { | ||
| const GATEWAY_PORTS = /** @type {Record<string, number>} */ { | ||
| copilot: 10002, | ||
| anthropic: 10000, | ||
| openai: 10001, | ||
| codex: 10001, | ||
| anthropic: 10001, | ||
| openai: 10000, | ||
| codex: 10000, | ||
| google: 10003, | ||
| }; | ||
| const port = GATEWAY_PORTS[provider]; | ||
| if (!port) return null; | ||
| return `http://host.docker.internal:${port}`; | ||
| return `http://api-proxy:${port}`; |
| // Anthropic provider routes through the Claude LLM gateway port. | ||
| // models.json must use the "api-proxy" Docker service hostname, not host.docker.internal. | ||
| expectedModelsJSON := buildPiModelsJSON(constants.ClaudeLLMGatewayPort, "ANTHROPIC_API_KEY", "claude-opus-4-20251101") | ||
| assert.Contains(t, expectedModelsJSON, "api-proxy:", "models.json baseUrl must use the api-proxy Docker hostname within the AWF network") | ||
| assert.NotContains(t, expectedModelsJSON, "host.docker.internal", "models.json baseUrl must not use host.docker.internal (not the api-proxy)") | ||
| assert.Contains(t, stepText, expectedModelsJSON, "Anthropic provider should route through ClaudeLLMGatewayPort via models.json") |
…oxy-provider-extension # Conflicts: # .github/workflows/audit-workflows.lock.yml # .github/workflows/blog-auditor.lock.yml # .github/workflows/claude-code-user-docs-review.lock.yml # .github/workflows/copilot-agent-analysis.lock.yml # .github/workflows/copilot-pr-merged-report.lock.yml # .github/workflows/copilot-pr-nlp-analysis.lock.yml # .github/workflows/copilot-pr-prompt-analysis.lock.yml # .github/workflows/copilot-session-insights.lock.yml # .github/workflows/copilot-token-audit.lock.yml # .github/workflows/daily-architecture-diagram.lock.yml # .github/workflows/daily-assign-issue-to-user.lock.yml # .github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml # .github/workflows/daily-aw-cross-repo-compile-check.lock.yml # .github/workflows/daily-cache-strategy-analyzer.lock.yml # .github/workflows/daily-caveman-optimizer.lock.yml # .github/workflows/daily-choice-test.lock.yml # .github/workflows/daily-cli-performance.lock.yml # .github/workflows/daily-cli-tools-tester.lock.yml # .github/workflows/daily-code-metrics.lock.yml # .github/workflows/daily-community-attribution.lock.yml # .github/workflows/daily-compiler-quality.lock.yml # .github/workflows/daily-doc-healer.lock.yml # .github/workflows/daily-doc-updater.lock.yml # .github/workflows/daily-experiment-report.lock.yml # .github/workflows/daily-fact.lock.yml # .github/workflows/daily-file-diet.lock.yml # .github/workflows/daily-firewall-report.lock.yml # .github/workflows/daily-function-namer.lock.yml # .github/workflows/daily-hippo-learn.lock.yml # .github/workflows/daily-issues-report.lock.yml # .github/workflows/daily-malicious-code-scan.lock.yml # .github/workflows/daily-mcp-concurrency-analysis.lock.yml # .github/workflows/daily-model-inventory.lock.yml # .github/workflows/daily-multi-device-docs-tester.lock.yml # .github/workflows/daily-news.lock.yml # .github/workflows/daily-observability-report.lock.yml # .github/workflows/daily-otel-instrumentation-advisor.lock.yml # .github/workflows/daily-performance-summary.lock.yml # .github/workflows/daily-regulatory.lock.yml # .github/workflows/daily-rendering-scripts-verifier.lock.yml # .github/workflows/daily-repo-chronicle.lock.yml # .github/workflows/daily-safe-output-integrator.lock.yml # .github/workflows/daily-safe-output-optimizer.lock.yml # .github/workflows/daily-safe-outputs-conformance.lock.yml # .github/workflows/daily-secrets-analysis.lock.yml # .github/workflows/daily-security-observability.lock.yml # .github/workflows/daily-security-red-team.lock.yml # .github/workflows/daily-semgrep-scan.lock.yml # .github/workflows/daily-sentrux-report.lock.yml # .github/workflows/daily-skill-optimizer.lock.yml # .github/workflows/daily-syntax-error-quality.lock.yml # .github/workflows/daily-team-evolution-insights.lock.yml # .github/workflows/daily-team-status.lock.yml # .github/workflows/daily-testify-uber-super-expert.lock.yml # .github/workflows/daily-token-consumption-report.lock.yml # .github/workflows/daily-workflow-updater.lock.yml # .github/workflows/delight.lock.yml # .github/workflows/developer-docs-consolidator.lock.yml # .github/workflows/docs-noob-tester.lock.yml # .github/workflows/example-workflow-analyzer.lock.yml # .github/workflows/github-mcp-structural-analysis.lock.yml # .github/workflows/github-mcp-tools-report.lock.yml # .github/workflows/github-remote-mcp-auth-test.lock.yml # .github/workflows/go-fan.lock.yml # .github/workflows/lockfile-stats.lock.yml # .github/workflows/mcp-inspector.lock.yml # .github/workflows/prompt-clustering-analysis.lock.yml # .github/workflows/repo-audit-analyzer.lock.yml # .github/workflows/repository-quality-improver.lock.yml # .github/workflows/safe-output-health.lock.yml # .github/workflows/schema-consistency-checker.lock.yml # .github/workflows/sergo.lock.yml # .github/workflows/smoke-agent-all-merged.lock.yml # .github/workflows/smoke-agent-all-none.lock.yml # .github/workflows/smoke-agent-public-approved.lock.yml # .github/workflows/smoke-agent-public-none.lock.yml # .github/workflows/smoke-agent-scoped-approved.lock.yml # .github/workflows/smoke-call-workflow.lock.yml # .github/workflows/smoke-codex.lock.yml # .github/workflows/smoke-copilot-arm.lock.yml # .github/workflows/smoke-create-cross-repo-pr.lock.yml # .github/workflows/smoke-gemini.lock.yml # .github/workflows/smoke-multi-pr.lock.yml # .github/workflows/smoke-opencode.lock.yml # .github/workflows/smoke-pi.lock.yml # .github/workflows/smoke-project.lock.yml # .github/workflows/smoke-service-ports.lock.yml # .github/workflows/smoke-temporary-id.lock.yml # .github/workflows/smoke-test-tools.lock.yml # .github/workflows/smoke-update-cross-repo-pr.lock.yml # .github/workflows/smoke-workflow-call.lock.yml # .github/workflows/stale-repo-identifier.lock.yml # .github/workflows/terminal-stylist.lock.yml # .github/workflows/typist.lock.yml # .github/workflows/weekly-issue-summary.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 7a008bc. Merged 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:
|
|
✅ Dev completed successfully! |
|
@copilot merge main and recompile |
…oxy-provider-extension # Conflicts: # .github/workflows/daily-cache-strategy-analyzer.lock.yml # .github/workflows/daily-fact.lock.yml # .github/workflows/daily-observability-report.lock.yml # .github/workflows/smoke-call-workflow.lock.yml # .github/workflows/smoke-codex.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in c3269c5. Merged 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:
|
Summary
This PR adds test coverage confirming that the Pi engine correctly uses the AWF api-proxy sidecar to route LLM traffic through provider-specific gateway ports (Copilot, Anthropic, OpenAI/Codex). It also replaces the opaque base64-encoded
models.jsongeneration with a human-readableprintfapproach, and fixes a routing bug where the wrong hostname was used inmodels.json.Changes
Build tag fixes
//go:build !integrationtags toenable_api_proxy_test.goanddocker_api_proxy_test.go(mandatory per project conventions)Production code changes (
pi_engine.go)echo <base64> | base64 -d > models.jsonwithprintf '%s\n' '<json>' > models.json, making the generated step content human-readable and auditableencodeBase64helper function andencoding/base64importmodels.jsonbaseUrl: changed fromhttp://host.docker.internal:{port}tohttp://api-proxy:{port}—host.docker.internalresolves to the Docker host (runner machine), not the api-proxy sidecar container. Within the AWF Docker Compose network (awf-net), the api-proxy is only reachable via its service hostnameapi-proxyProduction code change (
actions/setup/js/pi_provider.cjs)resolveGatewayUrl()diagnostic function to useapi-proxyhostname and the correct per-provider ports matchinggh-aw-firewall(anthropic=10001,openai/codex=10000,copilot=10002,google=10003)New test coverage
enable_api_proxy_test.go– Pi test case added toTestEngineAWFEnableApiProxy:"apiProxy":{"enabled":true}when the Pi engine runs with firewall enableddocker_api_proxy_test.go– Pi test case added toTestCollectDockerImages_APIProxyForEnginesWithLLMGateway:api-proxyDocker sidecar image is included in the collected images when Pi runs with the firewallpi_engine_test.go– Three new firewall gateway routing tests:TestPiEngine_GetExecutionSteps_FirewallCopilotProvider:copilot/prefix →CopilotLLMGatewayPort(10002) viamodels.jsonTestPiEngine_GetExecutionSteps_FirewallAnthropicProvider:anthropic/prefix →ClaudeLLMGatewayPortviamodels.jsonTestPiEngine_GetExecutionSteps_FirewallCodexProvider:codex/prefix →CodexLLMGatewayPortviamodels.jsonEach test validates:
PI_CODING_AGENT_DIRis set to/tmp/gh-aw/pi-agent-dir(wheremodels.jsonis written)aw-gatewaycustom provider is registered inmodels.jsonmodels.jsonJSON content uses theapi-proxyDocker hostname (nothost.docker.internal) and routes to the correct gateway port for the provider"enabled":true)How Pi uses the api-proxy
Pi's api-proxy integration differs from other engines (Claude, Copilot, Codex, Gemini):
ANTHROPIC_BASE_URL) which AWF overrides at runtime withhttp://{api-proxy-ip}:{port}models.jsonfile written at container startup viaprintf '%s\n' '<json>'that registers a customaw-gatewayprovider pointing athttp://api-proxy:{gatewayPort}engine.model(e.g.anthropic/,copilot/,codex/) determines which gateway port is usedgh-aw-firewall:openai/management=10000,anthropic=10001,copilot=10002,gemini=10003