Skip to content

Break the agent-lifecycle circular-dependency cluster (extract shared registry module) #2837

Description

@atomantic

Problem

Verified circular-dependency cluster among agentLifecycle.jscosAgents.jscosAgentLifecycle.jssubAgentSpawner.jsagentCliSpawning.jsagentManagement.js. agentLifecycle.js already uses a dynamic await import('./agentManagement.js') specifically to dodge the cycle at load time.

Approach (decided)

Extract a shared "agent registry/state" module with no dependents in this set; have lifecycle/spawner/management modules depend on it one-directionally instead of on each other. Remove the dynamic-import workaround once the cycle is gone.

Acceptance

  • No runtime import cycle in this cluster; agent spawn/lifecycle tests pass.

Found by the /do:better audit (2026-07-21). Deferred from automated remediation because it is a large/high-churn structural change best landed deliberately rather than auto-merged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions