Repository navigation
refactor: introduce runtime-neutral enclave runner lifecycle - #8686
Conversation
Co-authored-by: Copilot App <[email protected]>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Cancellation races, duplicate cleanup, and the incorrect issue-closing reference remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 4
Open (5)
What changed in this PR
Introduces a shared runtime-neutral lifecycle for Docker/gVisor enclave runners.
Changes:
- Adds launch, collection, cancellation, cleanup, and reconciliation lifecycle APIs.
- Propagates absolute deadlines and cancellation signals.
- Updates executor wiring and tests to use
runInvocation.
| File | Description |
|---|---|
src/enclave/runner-lifecycle.test.ts |
Tests lifecycle behavior. |
src/enclave/mcp-server.test.ts |
Updates script-runner mocks. |
src/enclave/dynamic-executor.test.ts |
Updates dynamic binding tests. |
src/enclave/agent-runner-spec.test.ts |
Tests deadlines and network preflight. |
src/enclave/agent-mcp-server.test.ts |
Updates agent-runner mocks. |
containers/enclave/script-executor/script-runner.js |
Wraps Docker/gVisor adapters. |
containers/enclave/script-executor/runner-lifecycle.js |
Implements the shared lifecycle. |
containers/enclave/script-executor/executor-handler.js |
Adds deadlines and shutdown cancellation. |
containers/enclave/script-executor/docker-script-runner.js |
Splits script launch and collection. |
containers/enclave/script-executor/docker-client.js |
Adds abort-signal support. |
containers/enclave/mcp-server/server.js |
Shares a monotonic clock. |
containers/enclave/mcp-server/agent-executor.js |
Removes the legacy runner wrapper. |
containers/enclave/agent-executor/enclave-runner.js |
Wraps agent runtime adapters. |
containers/enclave/agent-executor/docker-enclave-runner.js |
Splits agent launch and collection. |
containers/enclave/agent-executor/docker-client.js |
Adds abort-signal support. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cancelInvocation(handle) { | ||
| handle.cancellation.abort(); | ||
| return this.cleanupInvocation(handle); | ||
| } |
| cancelInvocation(handle) { | ||
| handle.cancellation.abort(); | ||
| return this.cleanupInvocation(handle); | ||
| } |
| async runInvocation(request) { | ||
| const handle = await lifecycle.launchInvocation(request); | ||
| const signal = request.signal; |
| } | ||
| if (cancellationError) throw cancellationError; | ||
| if (operationError) throw operationError; | ||
| return boundedResult(result, signal?.aborted === true); |
| /** | ||
| * Wraps one trusted runtime adapter in the lifecycle contract used by both | ||
| * enclave executor kinds. Runtime handles stay in a WeakMap and never enter an | ||
| * MCP request, response, audit record, or workspace. |
|
@copilot address review feedback |
Addressed in d4eb123:
|
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
|
✅ Build Test Suite completed successfully!
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident...
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
❌ Security Guard failed. Please review the logs for details.
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
Smoke Test: Copilot Engine — @lpcox
Overall: PASS
|
✅ Copilot BYOK Smoke Test: PASSTest Results:
Running in direct BYOK mode (
|
📡 OTel Tracing Smoke Test Results
Overall: ✅ All scenarios pass (scenario 5 is an expected no-op, not a failure — no proxied API traffic occurred in this run to generate spans).
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environment.
|
|
Smoke Test: Services Connectivity — PASS
Overall: PASS
|
|
Merged: Use stable AWF sandbox for Auth Doctor Updater Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS All repositories cloned successfully. All builds/installs and tests succeeded across every ecosystem and project. Note: Java builds required overriding Maven's local repository path (
|


Summary
Validation
npm test -- --runInBand src/enclavenpm run lint -- --quietnpm run type-checknpm run buildFixes #8679