Skip to content

Parallel FORGE worker execution — only forge-1 runs, forge-2+ never spawned #19

Description

@Christiantyemele

Problem

The current ForgePairNode processes workers sequentially within its batch. Even though the registry defines multiple worker slots (e.g. forge-1, forge-2), only one worker runs at a time. The batch loop in ForgePairNode::post_batch iterates workers but awaits each pair lifecycle to completion before starting the next.

Expected Behaviour

When NEXUS assigns multiple tickets, all available FORGE workers should run in parallel — each in its own worktree with its own SENTINEL — so that the total throughput scales with the number of workers.

Suggested Approach

  • Use tokio::join! or futures::join_all to run multiple ForgeSentinelPair::run() calls concurrently inside the batch handler.
  • Ensure each pair's WorkspaceManager and ProcessManager are independent (they already are per the current design).
  • Consider a configurable max-concurrency limit to avoid resource exhaustion.

Related Code

  • crates/agent-forge/src/lib.rsForgePairNode::post_batch (the sequential loop)
  • crates/pair-harness/src/pair.rsForgeSentinelPair::run (the per-worker lifecycle)
  • .agent/registry.json — worker slot definitions

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

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