Skip to content

[Export Audit] Dead exports in container-lifecycle.ts: isAgentExternallyKilled and resetAgentExternallyKilled #3223

@github-actions

Description

@github-actions

API Surface Issue

Category

Unused export

Summary

  • File: src/container-lifecycle.ts
  • Symbols: isAgentExternallyKilled (line 462), resetAgentExternallyKilled (line 470)
  • Issue: Both functions are exported from container-lifecycle.ts but are only consumed by the test file src/docker-manager-lifecycle.test.ts. Neither symbol is re-exported from the barrel src/docker-manager.ts, meaning they are not part of the intended public API surface yet are still export-ed.

Evidence

$ npx ts-prune
src/container-lifecycle.ts:462 - isAgentExternallyKilled
src/container-lifecycle.ts:470 - resetAgentExternallyKilled
$ grep -rn "isAgentExternallyKilled\|resetAgentExternallyKilled" src/ --include="*.ts" | grep -v ".test.ts"
src/container-lifecycle.ts:462:export function isAgentExternallyKilled(): boolean {
src/container-lifecycle.ts:470:export function resetAgentExternallyKilled(): void {

Only import site:

src/docker-manager-lifecycle.test.ts:
  import { isAgentExternallyKilled, resetAgentExternallyKilled } from './container-lifecycle';

Recommended Fix

  1. If these functions are only needed for testing, remove the export keyword and expose them via a _testing named export (consistent with the pattern used elsewhere in this codebase, e.g. host-iptables-shared.ts).
  2. If they are genuinely needed as part of the public API, add them to the src/docker-manager.ts barrel re-export and document their intended usage.

Impact

  • Dead code risk: Medium
  • Maintenance burden: Low — test-only exports pollute the public module interface and can mislead consumers about the intended API surface.

Detected by Export Audit workflow. Triggered by push to main on 2026-05-15

Generated by API Surface & Export Audit · ● 6.2M ·

  • expires on Jun 14, 2026, 3:02 PM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions