Skip to content

Improve architecture and state coupling between web-ag-ui and agents #428

@0xTomDaniel

Description

@0xTomDaniel

Summary

Improve architecture and reduce state/coupling inconsistencies between web-ag-ui and agents.

Problems observed

  • Frontend appeared to manage 6 runs at once while only 3 agents were present.
  • Sidebar status polling should run about every 15 seconds, but behavior looked duplicated/unbounded.
  • agent-long-graph-agent.connect appeared to keep a persisted streaming connection even when the agent details page was not in focus.
  • Streaming connection should only remain open while the specific agent details page is open; it should close on navigation away.
  • Agent-side state transitions feel inconsistent/chaotic across agents.

Goals

  • Define and enforce clear state lifecycle rules on both frontend and agent sides.
  • Reduce duplicated polling and run-management fan-out in the UI.
  • Ensure streaming connections are opened/closed strictly by page focus and lifecycle.
  • Identify shared agent state-management patterns and factor common constraints into reusable architecture.
  • Refactor UI architecture where needed to reduce coupling and improve maintainability.

Acceptance criteria

  • Polling cadence and ownership are centralized and deterministic.
  • Number of managed runs aligns with actual active agents/runs.
  • Streaming connections reliably tear down when the details page is not active.
  • Agent state transitions follow a documented/common pattern with reduced divergence.
  • Architecture/documentation updates include concrete boundaries between UI orchestration and agent orchestration.

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