ruvnet/ruflo · error

Maximum concurrent agents reached

Error message

Maximum concurrent agents reached

What it means

LifecycleManager.spawn checked the agent pool's capacity against config.maxConcurrentAgents and the pool is full. A capacity guard: the new agent config itself is fine, but admitting it would exceed the orchestrator's concurrent-agent budget.

Solutions

  1. Increase maxAgents in the orchestrator configuration if more concurrency is required.
  2. Terminate or wait for existing agents before spawning new ones.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/shared/src/core/orchestrator/lifecycle-manager.ts:95 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/9c90808ccaa4a550. Report an issue: GitHub.

Appendix: source

Thrown at v3/@claude-flow/shared/src/core/orchestrator/lifecycle-manager.ts:95

/**
 * Lifecycle manager implementation
 */
export class LifecycleManager implements IAgentLifecycleManager {
  private pool: IAgentPool;

  constructor(
    private eventBus: IEventBus,
    private config: LifecycleManagerConfig,
    pool?: IAgentPool,
  ) {
    this.pool = pool ?? new AgentPool();
  }

  async spawn(config: IAgentConfig): Promise<IAgent> {
    // Validate capacity
    if (!this.pool.hasCapacity(this.config.maxConcurrentAgents)) {
      throw new Error('Maximum concurrent agents reached');
    }

    // Validate agent doesn't already exist
    if (this.pool.get(config.id)) {
      throw new Error(`Agent with ID ${config.id} already exists`);
    }

    const agent: IAgent = {
      id: config.id,
      name: config.name,
      type: config.type,
      config,
      createdAt: new Date(),
      status: 'spawning',
      currentTaskCount: 0,
      lastActivity: new Date(),
      metrics: {
        tasksCompleted: 0,

View on GitHub (pinned to fa13ee4ad6)