Skip to content

feat: route unified enclaves exclusively through mcpg - #6992

Merged
lpcox merged 4 commits into
mainfrom
lpcox-enclave-mcpg-integration
Aug 7, 2026
Merged

feat: route unified enclaves exclusively through mcpg#6992
lpcox merged 4 commits into
mainfrom
lpcox-enclave-mcpg-integration

Conversation

@lpcox

@lpcox lpcox commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Stack

Layer 4 of the greenfield enclave migration.

Depends on:

Base branch: lpcox-enclave-agent-executor

Summary

  • puts the AWF-owned enclave MCP server on a dedicated internal awf-enclave-mcp-control network with no published port, Squid path, awf-net membership, agent mount, direct URL, wrapper, or skill fallback
  • validates the externally owned awmg-mcpg container by run-scoped label, attaches only it to the control network, and rejects unexpected members
  • uses a run-scoped bearer capability shared only between AWF and mcpg and excluded from all primary-agent environment passthrough
  • starts infrastructure without the primary agent, then proves initialize and the complete enabled tools/list contracts through mcpg before starting either a Compose agent or sbx sandbox
  • retries the complete initialize handshake when mcpg returns retryable HTTP 503 backend_unavailable, with bounded 500 ms backoff until AWF_ENCLAVE_MCP_READINESS_TIMEOUT_MS expires; the first 503 is not terminal and response bodies/headers/capabilities are not logged
  • stops admissions and drains the AWF server within a bound, disconnects but never stops/removes mcpg, then removes AWF-owned state/network
  • keeps legacy boundedQueries and boundedAgents functional for the final layer-5 cutover
  • documents and exports a machine-readable compiler handoff contract

Compiler handoff required

The gh-aw compiler must add an awf-enclave HTTP upstream at http://awf-enclave-mcp:8080/mcp, substitute the run-scoped capability into its bearer authorization header, allowlist only enabled enclave tools, set per-server connectTimeout: 120 and the derived tool timeout, label awmg-mcpg with com.github.gh-aw.mcpg.run=<identity>, and pass the gateway identity/container/readiness endpoint handoff variables to AWF but never the primary agent.

connectTimeout governs each HTTP upstream attempt. gateway.startupTimeout is stdio-only and must not be used as the HTTP recovery bound. The compiler must pin the first mcpg release after v0.4.8 containing #10784/spec 1.15.0. The current compiler does not yet emit this contract, so a gh-aw follow-up is required.

Validation

  • mcpg recovery contract: first HTTP 503 backend_unavailable followed by successful initialize and exact tools/list discovery
  • focused recovery/startup suite: 3 suites and 75 tests passed
  • full unit suite: 324 suites passed; 5,571 tests passed; 1 skipped
  • focused enclave/mcpg suite: 10 suites and 197 tests passed
  • TypeScript type-check passed
  • TypeScript build passed
  • all changed TypeScript files passed focused ESLint
  • changed JavaScript passed node --check
  • both generated config schemas parsed successfully
  • direct MCP HTTP exercise proved bearer rejection, initialize identity, and static tool discovery
  • two focused code-review passes completed with findings resolved

The exact locked typescript-eslint package remains unavailable from the configured feed, so repository-wide lint could not use the lockfile toolchain. An isolated compatible lint toolchain found one pre-existing error outside this change; every changed TypeScript file passes lint.

Copilot AI balanced review requested due to automatic review settings August 6, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit d993a7e

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 98.40% 98.15% 📉 -0.25%
Statements 98.18% 97.92% 📉 -0.26%
Functions 98.36% 97.99% 📉 -0.37%
Branches 94.22% 93.65% 📉 -0.57%
📁 Per-file Coverage Changes (7 files)
File Lines (Before → After) Statements (Before → After)
src/container-lifecycle.ts 98.7% → 96.6% (-2.08%) 98.8% → 96.2% (-2.54%)
src/cli-workflow.ts 100.0% → 98.6% (-1.37%) 100.0% → 98.6% (-1.37%)
src/commands/main-action.ts 97.4% → 97.0% (-0.44%) 97.0% → 96.5% (-0.43%)
src/services/enclave-mcp-service.ts 97.6% → 97.6% (-0.02%) 95.5% → 95.5% (-0.05%)
src/compose-generator.ts 98.6% → 98.6% (+0.04%) 98.6% → 98.6% (+0.04%)
src/enclave/manager.ts 80.2% → 80.5% (+0.30%) 79.2% → 79.5% (+0.34%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (1 files)
  • src/enclave/gateway.ts: 86.8% lines

Coverage comparison generated by scripts/ci/compare-coverage.ts

1 similar comment
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 98.40% 98.15% 📉 -0.25%
Statements 98.18% 97.92% 📉 -0.26%
Functions 98.36% 97.99% 📉 -0.37%
Branches 94.22% 93.65% 📉 -0.57%
📁 Per-file Coverage Changes (7 files)
File Lines (Before → After) Statements (Before → After)
src/container-lifecycle.ts 98.7% → 96.6% (-2.08%) 98.8% → 96.2% (-2.54%)
src/cli-workflow.ts 100.0% → 98.6% (-1.37%) 100.0% → 98.6% (-1.37%)
src/commands/main-action.ts 97.4% → 97.0% (-0.44%) 97.0% → 96.5% (-0.43%)
src/services/enclave-mcp-service.ts 97.6% → 97.6% (-0.02%) 95.5% → 95.5% (-0.05%)
src/compose-generator.ts 98.6% → 98.6% (+0.04%) 98.6% → 98.6% (+0.04%)
src/enclave/manager.ts 80.2% → 80.5% (+0.30%) 79.2% → 79.5% (+0.34%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (1 files)
  • src/enclave/gateway.ts: 86.8% lines

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox
lpcox force-pushed the lpcox-enclave-mcpg-integration branch from 54a92b4 to 8082499 Compare August 7, 2026 01:42
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 98.40% 98.15% 📉 -0.25%
Statements 98.18% 97.92% 📉 -0.26%
Functions 98.36% 97.99% 📉 -0.37%
Branches 94.22% 93.65% 📉 -0.57%
📁 Per-file Coverage Changes (7 files)
File Lines (Before → After) Statements (Before → After)
src/container-lifecycle.ts 98.7% → 96.6% (-2.08%) 98.8% → 96.2% (-2.54%)
src/cli-workflow.ts 100.0% → 98.6% (-1.37%) 100.0% → 98.6% (-1.37%)
src/commands/main-action.ts 97.4% → 97.0% (-0.44%) 97.0% → 96.5% (-0.43%)
src/services/enclave-mcp-service.ts 97.6% → 97.6% (-0.02%) 95.5% → 95.5% (-0.05%)
src/compose-generator.ts 98.6% → 98.6% (+0.04%) 98.6% → 98.6% (+0.04%)
src/enclave/manager.ts 80.2% → 80.5% (+0.30%) 79.2% → 79.5% (+0.34%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (1 files)
  • src/enclave/gateway.ts: 86.8% lines

Coverage comparison generated by scripts/ci/compare-coverage.ts

Base automatically changed from lpcox-enclave-agent-executor to main August 7, 2026 17:02
@lpcox
lpcox requested a balanced review from Copilot August 7, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (4)

docs/awf-config-spec.md:2527

  • The table lists five handoff variables, not four. Update this sentence to avoid suggesting that one variable is not covered by the primary-agent exclusion guarantee.
All four names are unconditionally excluded from primary-agent environment
passthrough. The mcpg upstream is named `awf-enclave`, uses

src/enclave/gateway.ts:418

  • Only retry the documented mcpg recovery response (503 with retryable backend_unavailable). This catch currently retries every permanent failure—including authentication errors, malformed responses, and exact tool-contract mismatches—for the full 120-second default window. Preserve enough status/error classification to fail those cases immediately while continuing to avoid logging response bodies or credentials.
    src/enclave/gateway.ts:297
  • The configured readiness deadline is not a hard bound because each request always gets 5 seconds. With a 1-second readiness window, one request can already run about 5 seconds, and a handshake that begins before the deadline can continue through three such requests. Pass the remaining readiness budget into each request and cap its timeout accordingly.
    src/commands/main-action.ts:157
  • Drain the enclave server before copying its audit artifacts. The server emits cleanup telemetry only while handling the stop signal, so copying first deterministically omits that final record and can also miss in-flight invocation/session records during shutdown. Stopping this server does not prevent docker cp, so preserve the artifacts after the bounded shutdown and before Compose removes the container.
  • Files reviewed: 73/73 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

lpcox and others added 4 commits August 7, 2026 11:06
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 46fcf12f-bd83-47cf-a042-83f797b7fdeb
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 46fcf12f-bd83-47cf-a042-83f797b7fdeb
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 46fcf12f-bd83-47cf-a042-83f797b7fdeb
@lpcox lpcox changed the title Layer 4: route unified enclaves exclusively through mcpg feat: route unified enclaves exclusively through mcpg Aug 7, 2026
@lpcox
lpcox force-pushed the lpcox-enclave-mcpg-integration branch from 8082499 to aae75f4 Compare August 7, 2026 18:31
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 98.59% 98.62% 📈 +0.03%
Statements 98.42% 98.44% 📈 +0.02%
Functions 98.36% 98.58% 📈 +0.22%
Branches 94.43% 94.32% 📉 -0.11%
📁 Per-file Coverage Changes (7 files)
File Lines (Before → After) Statements (Before → After)
src/container-lifecycle.ts 98.7% → 96.6% (-2.08%) 98.8% → 96.2% (-2.54%)
src/cli-workflow.ts 100.0% → 98.7% (-1.30%) 100.0% → 98.7% (-1.30%)
src/services/enclave-mcp-service.ts 97.6% → 97.6% (-0.02%) 95.5% → 95.5% (-0.05%)
src/compose-generator.ts 98.6% → 98.6% (+0.04%) 98.6% → 98.6% (+0.04%)
src/commands/main-action.ts 97.4% → 97.5% (+0.06%) 97.0% → 97.0% (+0.06%)
src/enclave/manager.ts 80.2% → 83.6% (+3.43%) 79.2% → 82.6% (+3.37%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)
✨ New Files (1 files)
  • src/enclave/gateway.ts: 100.0% lines

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports failed to deliver outputs. Our correspondents are investigating the incident...

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

Contribution check complete: the PR includes substantial new tests and documentation updates, and the description references related work and validation. No CONTRIBUTING.md issues requiring a review comment were found.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Docker Sbx reports failed to deliver outputs. Our correspondents are investigating the incident...

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) reports failed to deliver outputs. AOAI BYOK (api-key) mode investigation needed...

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable: allowed=200
✅ Non-allowed domain (example.com) blocked: denied=000 (CONNECT tunnel failed, 403)

Overall status: PASS

cc @lpcox

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 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) ✅ PASS

Tests:

  1. GitHub MCP: ✅ Connected
  2. GitHub.com: ✅ HTTP 200
  3. File I/O: ✅ Write/Read OK
  4. BYOK Inference: ✅ Running in direct mode (COPILOT_PROVIDER_API_KEY → api-proxy → api.githubcopilot.com)

Overall Status: PASS | Mode: Direct BYOK via api-proxy sidecar

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot Engine

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

Overall: PASS

cc @lpcox

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

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

Overall: FAILhost.docker.internal could not be resolved from the AWF sandbox (Temporary failure in name resolution).

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

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

Overall result: PASS

Generated by Smoke Claude for #6992 · haiku45 · 60.8 AIC · ⊞ 3.6K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🔐 Security Review: Network Architecture Change

Finding: Unix Socket → Network Binding

The enclave MCP server has been changed from a networkless Unix socket to TCP network binding:

Changes:

  • config.js line 124-125: listenHost defaults to '0.0.0.0'; listenPort hardcoded to 8080
  • server.js: Removed Unix socket setup with explicit file permissions (fs.chmodSync(..., 0o660))
  • Dockerfile comments: Notes shift to "authenticated streamable HTTP through mcpg"

Security Impact:
The server now listens on all interfaces (0.0.0.0) on TCP port 8080, exposing it beyond the previous Unix socket boundary. This requires strong upstream authentication (presumably via mcpg gateway).

Recommendation:
✓ Verify mcpg properly authenticates and validates all requests before forwarding to this server.
✓ Confirm 0.0.0.0 binding is intentional and scoped to mcpg's internal network only.
✓ Review network policies isolating this port from untrusted networks.

The architectural shift appears intentional per PR title, but upstream auth mechanisms should be reviewed separately.

Generated by Security Guard for #6992 · haiku45 · 6.2 AIC · ⊞ 5.8K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

OTel Tracing Smoke Test Results

  • Scenario 1 (Module Loading): otel.js loaded successfully; isEnabled() returns true; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled + internals.
  • Scenario 2 (Test Suite): 3 suites, 68/68 tests passed (otel.test.js, otel-fanout.test.js, otel split modules) covering span creation, gen_ai token attributes, budget attributes, OTLP/JSON serialization, ProxyAwareOtlpExporter, FileSpanExporter, fan-out init.
  • Scenario 3 (Env Var Forwarding): env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID/GITHUB_AW_OTEL_PARENT_SPAN_ID to the agent; api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, and trace context to api-proxy.
  • Scenario 4 (Token Tracker Integration): onUsage callback present in token-tracker-http.js (OTEL hook point).
  • i️ Scenario 5 (OTEL Diagnostics): No span file found in this run — expected since no live LLM traffic was generated during this smoke session.

Overall: All checks passed. No regressions detected.

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13 ✅ YES
Node.js v24.18.0 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version mismatch between host and chroot environments. smoke-chroot label not applied since not all tests passed.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🏗️ 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 (run OK) ✅ PASS
.NET json-parse N/A (run OK) ✅ 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 passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

No errors encountered in any project across all ecosystems.

Generated by Build Test Suite for #6992 · auto · 80.6 AIC · ⊞ 11.6K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Test

PR titles:

  • chore: upgrade gh-aw to v0.86.0 pre-release and recompile workflows

  • fix(api-proxy): stop alias fallback picking arbitrary models

  • GitHub review: ✅

  • safeinputs-gh query: ❌

  • Playwright: ✅

  • File write/read: ✅

  • Discussion comment: ✅

  • Build: ✅

Overall: FAIL

Warning

Firewall blocked 1 domain

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

  • registry.npmjs.org

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

network:
  allowed:
    - defaults
    - "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

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@lpcox

  • Pre-fetched PR data validated ✅
  • MCP connectivity: ✅
  • GitHub.com connectivity: ✅
  • File write/read: ✅
  • BYOK inference: ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

Overall: PASS

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

chore: upgrade gh-aw to v0.86.0 pre-release and recompile workflows: ✅
fix(api-proxy): stop alias fallback picking arbitrary models: ✅
GitHub.com connectivity: ✅
File write/read test: ✅
BYOK inference test: ✅
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 status: PASS
@lpcox

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Docker Sbx@lpcox

Overall: PASS

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Gemini Smoke Test Results

  • GitHub MCP Testing: ❌ (Tools missing)
  • GitHub.com Connectivity: ❌ (Connection failed)
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall status: FAIL

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@lpcox
lpcox merged commit d6a893e into main Aug 7, 2026
135 of 141 checks passed
@lpcox
lpcox deleted the lpcox-enclave-mcpg-integration branch August 7, 2026 19:47
lpcox added a commit to github/gh-aw-mcpg that referenced this pull request Aug 7, 2026
## Summary

- keep routed mcpg healthy when an HTTP MCP upstream is configured
before it starts
- retry and serialize backend initialize/tool discovery before creating
a routed MCP session, returning retryable HTTP 503 responses while
unavailable
- re-register only allowlisted tools once the upstream appears and
preserve auth/HMAC/shutdown middleware ordering
- apply `connectTimeout` to the plain JSON fallback as well as
SDK-managed transports
- document the exact `awf-enclave` JSON stdin contract and version
requirement

## Dependency

Prerequisite for github/gh-aw-firewall#6992 (enclave stack layer 4).
That PR starts `awf-enclave-mcp` after the compiler-owned mcpg
container, then proves `initialize` + `notifications/initialized` +
allowlisted `tools/list` through `/mcp/awf-enclave` before starting the
primary agent.

A follow-up in github/gh-aw must emit the documented `awf-enclave` HTTP
server entry, capability header substitution, enabled-tool allowlist,
`connectTimeout`, and `toolTimeout`, and pin the first mcpg release
containing this PR.

Important contract clarification: `gateway.startupTimeout` governs stdio
process startup; HTTP recovery is governed by per-server
`connectTimeout` plus the caller's bounded readiness retry window.
Firewall/compiler assumptions should use `connectTimeout: 120` and retry
`initialize` on `backend_unavailable`, not rely on
`gateway.startupTimeout` to keep an HTTP attempt alive.

## Validation

- `GODEBUG=netdns=go make agent-finished`
- `GODEBUG=netdns=go make test-integration`
- focused delayed-start regression covers unavailable startup, retryable
route, upstream bearer auth, initialize/initialized/tools-list
discovery, routed allowlist filtering/rejection, and 150-second
per-server tool timeout configuration
- focused transport regression covers a silent plain-JSON upstream
respecting `connectTimeout`
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.

2 participants