Remove test-only container lifecycle helper from production API surface#4050
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
✨ New Files (1 files)
Coverage comparison generated by |
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.
There was a problem hiding this comment.
Pull request overview
This PR removes a test-only lifecycle state mutator bundle (containerLifecycleTestHelpers) from the production src/container-lifecycle.ts module by extracting the externally-killed flag into a dedicated internal state module, while preserving the existing test helper access pattern via src/container-lifecycle.test-utils.ts.
Changes:
- Removed
containerLifecycleTestHelpers(and its underlying test-only functions) fromsrc/container-lifecycle.ts. - Added
src/container-lifecycle-state.tsto own the externally-killed lifecycle flag and its accessors/mutators. - Updated
src/container-lifecycle.test-utils.tsto buildcontainerLifecycleTestHelpersfrom the new state module instead of re-exporting from production code.
Show a summary per file
| File | Description |
|---|---|
| src/container-lifecycle.ts | Removes test-only export and switches externally-killed checks/updates to the new state module. |
| src/container-lifecycle.test-utils.ts | Keeps tests’ helper import shape by constructing containerLifecycleTestHelpers from the extracted state module. |
| src/container-lifecycle-state.ts | Introduces the extracted module-scoped externally-killed flag and helper functions used by runtime + tests. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
|
|
||
| export function resetAgentExternallyKilled(): void { | ||
| agentExternallyKilled = false; | ||
| } |
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.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback |
Addressed in |
Smoke Test: Claude Engine
Result: PASS
|
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Author: Overall: PARTIAL — BYOK inference and MCP confirmed ✅; pre-step outputs not injected (template vars unexpanded).
|
🔍 Smoke Test Results
Overall: PARTIAL — MCP connectivity confirmed; pre-step outputs were not injected into the workflow template. PR: "Remove test-only container lifecycle helper from production API surface" — author
|
🧪 Chroot Version Comparison Results
Result: ❌ Not all versions match — Python and Node.js differ between host and chroot environments.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
|
Remove 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.
|
Smoke Test Results
Overall: FAIL —
|
|
Smoke test complete. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
src/container-lifecycle.tswas exportingcontainerLifecycleTestHelpers, a test-only state mutator bundle, from a security-critical production module. This change removes that dead/public export while preserving existing test access patterns.API surface cleanup
containerLifecycleTestHelpersexport fromsrc/container-lifecycle.ts.Internal state extraction
src/container-lifecycle-state.tsto own the externally-killed lifecycle flag and related functions:markAgentExternallyKilledisAgentExternallyKilledresetAgentExternallyKilledcontainer-lifecycle.tsto consume this internal state module.Test-only access path retained
src/container-lifecycle.test-utils.tsto construct/exportcontainerLifecycleTestHelpersfromcontainer-lifecycle-state.ts, so tests keep the same call shape without relying on production exports.