Skip to content

[docs] auth: docs: document GITHUB_RUN_ID/GITHUB_RUN_ATTEMPT forwarding to api-proxy sidecar - #7570

Merged
lpcox merged 1 commit into
mainfrom
docs/auth-copilot-run-id-forwarding-20260820-2b23a2ff16f5cf70
Aug 20, 2026
Merged

[docs] auth: docs: document GITHUB_RUN_ID/GITHUB_RUN_ATTEMPT forwarding to api-proxy sidecar#7570
lpcox merged 1 commit into
mainfrom
docs/auth-copilot-run-id-forwarding-20260820-2b23a2ff16f5cf70

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

  • Scan window: since 2026-08-18 (UTC). Reviewed README.md, docs/auth-matrix.md, docs/authentication-architecture.md, docs/api-proxy-sidecar.md, docs/environment.md, docs/awf-config-spec.md, docs/github_actions.md against src/services/api-proxy-env-config.ts, src/services/api-proxy-credential-env.ts, src/services/agent-environment/excluded-vars.ts, src/services/agent-environment/env-passthrough.ts, containers/api-proxy/management.js, containers/api-proxy/startup.js, containers/agent/api-proxy-health-check.sh, and containers/api-proxy/request-headers.js.
  • fix: isolate Actions OIDC from agent container #6894 (isolate Actions OIDC from agent container) and Ensure HTTP MCP GitHub OIDC bypasses the AWF agent credential boundary gh-aw#50053 (runner→gateway OIDC boundary) are both merged and already documented accurately in docs/environment.md, docs/auth-matrix.md, and docs/authentication-architecture.md — no changes needed there.
  • Found a cross-document inconsistency: merged PR Inject stable X-Interaction-Id and Copilot-Integration-Id on Copilot upstream requests #7545 ("Inject stable X-Interaction-Id and Copilot-Integration-Id on Copilot upstream requests") already updated docs/auth-matrix.md with the X-Interaction-Id/Copilot-Integration-Id header behavior, including that the sidecar derives X-Interaction-Id from ${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}. However, docs/api-proxy-sidecar.md's "API proxy container" environment-variable table (the canonical per-container env reference) never listed GITHUB_RUN_ID/GITHUB_RUN_ATTEMPT as variables forwarded to that container, even though src/services/api-proxy-env-config.ts forwards both from the host when present (confirmed in code, lines ~134–139).
  • Reviewed PRs Support Copilot Auto API endpoints #7554 (Copilot Auto API endpoints) and [docs] docs: Update for Copilot Auto API versions and Cloud Hypervisor network readiness #7566 (prior doc-maintainer sync) — both already merged and their auth-matrix.md content (Auto API Version Injection section) is present and accurate; no further changes needed.

Documentation Changes

  • docs/api-proxy-sidecar.md (§Environment variables → API proxy container table): Added two rows for GITHUB_RUN_ID and GITHUB_RUN_ATTEMPT, describing their conditional forwarding from the host and their role deriving the stable per-run X-Interaction-Id Copilot prompt-cache key, cross-linking to the existing auth-matrix.md section that documents the resulting header behavior.

Validation

  • Verified src/services/api-proxy-env-config.ts (lines 134–139) forwards GITHUB_RUN_ID/GITHUB_RUN_ATTEMPT conditionally when non-blank.
  • Verified containers/api-proxy/request-headers.js (resolveCopilotInteractionId) consumes exactly these two variables to derive X-Interaction-Id, matching the already-documented behavior in docs/auth-matrix.md.
  • Ran npx markdownlint-cli2 docs/api-proxy-sidecar.md — 0 issues.
  • Confirmed no open PR with [docs] auth: in the title covers this finding (checked via GitHub search; no open PRs at scan time).
  • Reviewed the diff for token/key/JWT values and credential-bearing URLs — none present; only variable names and a relative doc link.

Sources

Generated by Auth Doctor Updater · auto · 77.3 AIC · ⊞ 12K ·

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added ai-generated documentation Improvements or additions to documentation labels Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit 8ebec9c

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Claude passed

Generated by Smoke Claude for #7570

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Build Test Suite completed successfully!

Generated by Build Test Suite for #7570

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

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

Warning

Firewall blocked 3 domains

The following domains were blocked by the firewall during workflow execution:

  • msfeed2.pkgs.visualstudio.com
  • msfeed25.pkgs.visualstudio.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "msfeed2.pkgs.visualstudio.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Chroot tests failed Smoke Chroot failed - See logs for details.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Contribution Check completed successfully!

Reviewed PR #7570 against CONTRIBUTING.md using the provided context. The change is documentation-only, is placed correctly under docs/, and the PR description clearly explains the update and references the related behavior; no missing contribution-guideline items found.

Generated by Contribution Check for #7570

@lpcox
lpcox deployed to aoai-model August 20, 2026 21:25 — with GitHub Actions Active
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

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

📰 BREAKING: Report filed by Smoke Docker Sbx

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

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

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Smoke Test: Copilot BYOK (Direct) Mode PASSED

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY).

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Claude Engine Validation

Check Status
API ✅ PASS
gh CLI ✅ PASS
File ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #7570 · haiku45 · 55.8 AIC · ⊞ 4K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Docker Sbx@lpcox

Overall: PASS

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: API Proxy OTEL Tracing — Results

  • Scenario 1 (Module Loading): otel.js loads cleanly, exporting startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, plus internal exporter helpers (_ProxyAwareOtlpExporter, _FileSpanExporter, _FanOutSpanExporter).
  • Scenario 2 (Test Suite): otel.test.js, otel-fanout.test.js, otel-workload-identity.test.js3 suites / 68 tests, all passed.
  • Scenario 3 (Env Var Forwarding): env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID / GITHUB_AW_OTEL_PARENT_SPAN_ID (and COPILOT_OTEL_FILE_EXPORTER_PATH) into the agent container; api-proxy-env-config.ts forwards OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, the trace/parent-span vars, and sets OTEL_SERVICE_NAME for the api-proxy container.
  • Scenario 4 (Token Tracker Integration): token-tracker-http.js defines and invokes an onUsage(normalizedUsage, model) callback (line 348/406) — confirmed as the intended OTEL hook point for token-usage spans.
  • ⚠️ Scenario 5 (OTEL Diagnostics): One span was exported during this run (gh-aw.agent.setup, from the workflow's own tracing, correctly parented and tagged with gen_ai.system=github_models). No api-proxy request spans were present, since no LLM/API-proxy call was made in this smoke run — expected given the test scope (no live LLM traffic proxied).

Overall: all scenarios pass or are expected-pending (no unexpected failures). OTEL initialization, env propagation, and hook points are correctly wired; end-to-end span export for actual proxied API calls needs a live LLM-call scenario to fully exercise, which is outside this smoke test's scope.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Copilot Engine Smoke Test

  • ✅ GitHub MCP connectivity
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read test

Recent PRs checked: #7568 "Fix Cloud Hypervisor guest loopback networking", #7566 "[docs] Update for Copilot Auto API versions and Cloud Hypervisor network readiness"

Overall: PASS

cc @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke Test: Copilot BYOK (AZOAI)
• GitHub MCP fetch: [WIP] Support secret-backed OpenAI-compatible targets for Codex; Update runner doctor catalog: supersede B17 DNS filtering, add B24 native-root ownership — ✅
• GitHub.com connectivity — ✅
• File I/O — ✅
• Direct BYOK mode via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) — ✅
Overall: PASS
cc @github-actions[bot]

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

@lpcox Network isolation egress smoke test results:

EGRESS_RESULT allow=pass deny=pass
  • ✅ Allowed domain (api.github.com) reachable — allowed=200
  • ✅ Blocked domain (example.com) denied — CONNECT tunnel failed 403

Overall status: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx 1/1 passed ✅ PASS
Node.js execa 1/1 passed ✅ PASS
Node.js p-limit 1/1 passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

Note: Maven's default local repository at ~/.m2/repository was not writable by the runner user in this environment (/home/runner/.m2 is owned by root, so Maven couldn't create the repository subdirectory). Worked around this by overriding -Dmaven.repo.local=/tmp/gh-aw/agent/m2repo for the Java builds; this is unrelated to the firewall/proxy configuration itself, which functioned correctly (Maven successfully reached the proxy at squid-proxy:3128 per the configured ~/.m2/settings.xml).

All other ecosystems ran cleanly with no errors.

Generated by Build Test Suite for #7570 · auto · 32 AIC · ⊞ 12K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Smoke test: FAIL

PR titles:

  • Fix Cloud Hypervisor guest loopback networking
  • [docs] docs: Update for Copilot Auto API versions and Cloud Hypervisor network readiness

✅ Merged PR review
safeinputs-gh PR query
✅ Playwright title
✅ File write/read
❌ Discussion comment
npm ci && npm run build

Warning

Firewall blocked 3 domains

The following domains were blocked by the firewall during workflow execution:

  • msfeed2.pkgs.visualstudio.com
  • msfeed25.pkgs.visualstudio.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "msfeed2.pkgs.visualstudio.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Fix Cloud Hypervisor guest loopback networking ✅
[docs] docs: Update for Copilot Auto API versions and Cloud Hypervisor network readiness ✅
GitHub.com connectivity ✅
File read/write ✅
BYOK inference ✅
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra
Overall: PASS
@lpcox

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

Services Connectivity Smoke Test

  • Redis PING: ❌ (DNS resolution failure)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (DNS resolution failure)

All checks failed: host.docker.internal could not be resolved (Temporary failure in name resolution).

Overall: FAIL

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 9cf8160 into main Aug 20, 2026
150 of 153 checks passed
@lpcox
lpcox deleted the docs/auth-copilot-run-id-forwarding-20260820-2b23a2ff16f5cf70 branch August 20, 2026 22:16
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.

1 participant