Skip to content

Add consensus-driven phase advancement for concurrent execution #1035

Closed

Description

@james-in-a-box

Summary

PR #1031 added the infrastructure for concurrent agent execution (message bus, consensus protocol, ConcurrentPhaseExecutor), but phase advancement still relies on container exit codes rather than the consensus protocol.

Agents can signal readiness via egg-orch signal readiness --state READY, and the ConsensusEvaluator tracks this state, but the orchestrator never polls or reacts to consensus completion to advance the phase.

Current behavior

When concurrent_execution: true:

  1. Agents are spawned simultaneously (✓)
  2. Agents can exchange messages via the message bus (✓)
  3. Agents can signal readiness states (✓)
  4. Consensus is evaluated and tracked in pipeline status (✓)
  5. Phase advances when containers exit — same as sequential mode (✗)

Expected behavior

When all agents signal READY, the orchestrator should detect consensus and advance the phase automatically, without waiting for containers to exit.

Code pointers

  • orchestrator/routes/pipelines.py:4552-4560 — explicit comment: "Consensus-driven advancement will be integrated in a follow-up once the polling loop is added."
  • orchestrator/concurrent_executor.py — check_consensus() method exists but is never called from the execution path
  • orchestrator/consensus.py — ConsensusEvaluator.evaluate() returns is_complete but nothing acts on it

Implementation notes

Needs a polling loop during concurrent phase execution that:

  1. Periodically calls executor.check_consensus()
  2. On consensus reached (is_complete=True), triggers phase advancement
  3. Handles BLOCKED/OBJECTING states (HITL escalation)
  4. Respects consensus_timeout_minutes from PipelineConfig

Relates to #1027

Activity

  1. added
    enhancement
    on Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions