Conversation
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/f4644feb-041a-4451-8134-d0ef07fc3425 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR updates the api-proxy to add a default X-Initiator: agent header on Copilot HTTP requests and adds unit tests around that behavior. In the broader api-proxy architecture, it changes request forwarding behavior in the shared proxy layer and extends the main server test suite.
Changes:
- Add default
x-initiatorinjection inproxyRequest()for requests identified as Copilot. - Preserve an existing client-supplied
x-initiatorvalue instead of overwriting it. - Add tests covering direct Copilot injection, preservation, and non-Copilot no-op behavior.
Show a summary per file
| File | Description |
|---|---|
containers/api-proxy/server.js |
Adds the new x-initiator defaulting logic in the shared HTTP proxy path. |
containers/api-proxy/server.test.js |
Imports proxyRequest and adds unit tests for the new header-injection behavior. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
| // Default X-Initiator to "agent" for billing purposes on Copilot requests. | ||
| // In agentic workflows, the vast majority of requests are agent-initiated. | ||
| // If the client already set it (e.g. standard Copilot CLI), respect that value. | ||
| if (provider === 'copilot' && !headers['x-initiator']) { |
| it('does not inject x-initiator for non-copilot providers', () => { | ||
| const { getCaptured } = mockHttpsRequest(); | ||
| const req = makeReq(); | ||
| proxyRequest(req, makeRes(), 'api.anthropic.com', { 'x-api-key': 'sk-ant-test' }, 'anthropic'); | ||
| req.emit('end'); | ||
| expect(getCaptured().headers['x-initiator']).toBeUndefined(); |
This comment has been minimized.
This comment has been minimized.
|
@copilot address the review feedback |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…is covered Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/c8b370e1-41d3-46d9-a57a-761e068cd1f3 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Done in cdccf31. Changed the check from 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.
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
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.
…aw post-run The gh-aw post-run audit step runs as the 'runner' user but AWF creates audit files as root with mode 0600. When AWF cleanup is interrupted (SIGKILL from timeout), the chmod a+rX never runs, leaving files unreadable and causing: EACCES: permission denied, stat 'docker-compose.redacted.yml' Fix: Create audit files with mode 0644 (dir 0755) from the start. These files contain no secrets — squid.conf has only domain ACLs, compose is redacted, and policy-manifest is just firewall rules. Co-authored-by: Copilot <223556219+Copilot@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.
With --build-local, Docker image builds take 7+ minutes on cold cache (no layer cache on CI runners). The 5-minute step timeout causes the Copilot CLI execution step to be killed before the agent even starts. Increase timeout-minutes from 5 to 15 in: - smoke-copilot-byok (md + lock) - smoke-copilot (md + lock) - smoke-gemini (md only, lock was already 15) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Pin gh-aw extension to v0.71.4 - Add sandbox.agent.id: awf to all workflows (new strict mode requirement) - Remove empty mcp: field from update-release-notes.md (codemod artifact) - Run post-processing on all lock files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( PR author: Overall: PARTIAL — BYOK inference and MCP ✅; pre-step smoke data unexpanded in template.
|
🔬 Smoke Test Results
PR: api-proxy: inject X-Initiator: agent default on all Copilot-bound requests to prevent billing inflation Overall: PARTIAL — MCP ✅, pre-computed test data unavailable (workflow template vars not substituted).
|
|
Smoke Test Results: Overall: PASS
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
This comment has been minimized.
This comment has been minimized.
🧪 Chroot Version Comparison Results
Overall: ❌ Not all tests passed. Python and Node.js versions differ between host and chroot.
|
Codex Smoke Testapi-proxy: inject X-Initiator: agent default on all Copilot-bound requests to prevent billing inflation 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.
|
In BYOK/api-proxy mode, absent
X-Initiatorheaders cause the Copilot API to bill every request as a user-initiated premium turn (~14x cost vs. the expected ~7% user / ~93% agent split in agentic workflows).Changes
containers/api-proxy/server.js— InproxyRequest(), after assembling outgoing headers, injectX-Initiator: agentfor all Copilot-bound requests when the client hasn't supplied the header. The check usestargetHost.endsWith('githubcopilot.com')rather than the provider name so that OpenCode requests delegated to the Copilot backend are also covered (bothapi.githubcopilot.comandapi.enterprise.githubcopilot.com). Client-supplied values are passed through unchanged, preserving correct behaviour for standard Copilot CLI flows.containers/api-proxy/server.test.js— Seven new tests covering: header injected when absent on direct Copilot requests, header injected on enterprise Copilot host, header injected when OpenCode routes to the Copilot backend (provider='opencode', Copilot target host), client-set value preserved on direct Copilot and OpenCode→Copilot requests, no injection for non-Copilot providers, and no injection when OpenCode routes to a non-Copilot backend.