Skip to content

[Feature] Add ControlLoop primitive for convergence-style agent orchestration #90

Description

@RagavRida

Summary

I've implemented a ControlLoop primitive that ports the control-loop paradigm (thermostats, Kubernetes controllers, HumanLayer's agentic control-loop methodology) into HyperAgent as an opt-in, purely additive primitive.

Branch

👉 Ready for review: RagavRida:feat/control-loop (commit 0c0fb0f)
📊 Diff: Compare view — 1,542 additions, 3 deletions across 12 files

⚠️ I wasn't able to open a PR directly because this repo restricts PR creation to collaborators. Could a maintainer either add me as a collaborator or open the PR from my branch?

What's Included

  • src/control-loop: ControlLoop class — a sensor measures the gap to a declared set point, a controller picks ONE item per iteration (FIFO default, customizable), an actuator applies the change via agent tasks
  • Golden patterns + reviewer feedback (file re-read every iteration) rendered into actuator prompts via buildLoopGuidance
  • Flow control: gates with bounded hold-polling (refuse new work while output awaits review), maxIterations, consecutive-failure caps
  • Structural ControlLoopAgent contract keeps loops testable without a browser or LLM: scripts/test-control-loop.ts covers 13 deterministic scenarios
  • Worked example: examples/control-loop/hn-worklist (HN digest worklist with pending-review gate and live-editable feedback file)
  • Docs: README section, currentState.md, AGENTS.md updates

Merge-readiness

  • ✅ Branches can be automatically merged (no conflicts)
  • ✅ Purely additive — no breaking changes to existing code
  • ✅ 13 deterministic test scenarios passing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions