FN-7082: add live running-agent count seam
Add a side-effect-safe core seam so global concurrency reads can report live running-agent counts. - Add core helpers to register a running-agent count source and derive active project totals. - Wire CentralCore and dashboard server setup to read live counts from already-open stores without starting runtimes. - Update the global concurrency route to preserve slot bookkeeping while sourcing currentlyActive/projectsActive from the live seam. - Cover the seam, dashboard store resolver, server wiring, and route behavior with focused tests and document the multi-project behavior. Files changed: .changeset/fn-7082-live-running-agent-count-seam.md | 7 ++ docs/multi-project.md | 2 +- packages/core/src/__tests__/central-core.test.ts | 106 +++++++++++++++++++++ packages/core/src/central-core.ts | 28 ++++++ packages/core/src/index.ts | 7 ++ packages/core/src/live-agent-count.ts | 38 ++++++++ .../dashboard/src/__tests__/project-routes.test.ts | 20 +++- .../src/__tests__/project-store-resolver.test.ts | 71 ++++++++++++++ packages/dashboard/src/__tests__/server.test.ts | 45 ++++++++- packages/dashboard/src/project-store-resolver.ts | 24 +++++ packages/dashboard/src/routes.ts | 25 +---- packages/dashboard/src/server.ts | 42 +++++++- 12 files changed, 387 insertions(+), 28 deletions(-) Fusion-Task-Id: FN-7082 Fusion-Task-Lineage: 4dbca204-8bea-4de5-b56b-7468b61575ce Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
This commit is contained in:
@@ -110,7 +110,7 @@ Central health tracking keeps mutable project metrics, including:
|
||||
|
||||
## Global Concurrency Management
|
||||
|
||||
A singleton central record enforces system-wide limits so one project cannot monopolize all execution slots.
|
||||
A singleton central record enforces system-wide limits so one project cannot monopolize all execution slots. Slot acquire/release bookkeeping remains separate from read-only running-agent displays: live read surfaces derive `currentlyActive` and per-project active counts from `in-progress` tasks in already-open project stores, while the persisted `globalMaxConcurrent` cap and `queuedCount` continue to come from central concurrency state.
|
||||
|
||||
## Plugin Scope in Multi-Project Mode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user