Description
Disabled agent pools can retain stale runtime occupancy after being disabled, and re-enabling the pool does not recompute occupancy from currently running sessions.
We observed two related issues:
- After disabling a pool, the Pools UI can still show active agents / occupied capacity from stale runtime status.
- Re-enabling the pool can preserve that stale status instead of reconciling against live sessions.
Steps to reproduce
- Create an agent pool for workers or stewards.
- Let a matching agent session run so the pool has active occupancy.
- Disable the pool.
- Observe the pool in the Pools UI or via
GET /api/pools.
- Re-enable the pool while matching sessions may or may not still be running.
- Observe the pool status again.
Expected behavior
Disabling a pool should not leave stale runtime occupancy visible or operational.
When disabled:
- the pool should not show stale active agents as occupying capacity
- the pool should not block operations because of stale runtime occupancy
When re-enabled:
- the pool should recompute occupancy from currently running matching worker/steward sessions
- if live matching sessions exceed
maxSize, the pool should come back full / over capacity and block new matching spawns
- existing sessions should not be terminated automatically
Actual behavior
A disabled pool can still show active agents / occupied capacity.
In local testing, a disabled pool showed a worker in activeAgentIds even though no matching worker session was running. Calling POST /api/pools/refresh cleared the stale occupancy, and deletion then worked.
Code inspection also suggests re-enable follows the same update path and preserves the existing cached status instead of recomputing from live sessions.
Operating system
macOS
Node version
20
Package version
1.25.0
Additional context
This is separate from #121, which covers enabled pool slots remaining occupied after sessions terminate. This issue is specifically about disabled pool lifecycle behavior: stale occupancy can remain visible after disable, and re-enable does not appear to reconcile status from live sessions.
Description
Disabled agent pools can retain stale runtime occupancy after being disabled, and re-enabling the pool does not recompute occupancy from currently running sessions.
We observed two related issues:
Steps to reproduce
GET /api/pools.Expected behavior
Disabling a pool should not leave stale runtime occupancy visible or operational.
When disabled:
When re-enabled:
maxSize, the pool should come back full / over capacity and block new matching spawnsActual behavior
A disabled pool can still show active agents / occupied capacity.
In local testing, a disabled pool showed a worker in
activeAgentIdseven though no matching worker session was running. CallingPOST /api/pools/refreshcleared the stale occupancy, and deletion then worked.Code inspection also suggests re-enable follows the same update path and preserves the existing cached status instead of recomputing from live sessions.
Operating system
macOS
Node version
20
Package version
1.25.0
Additional context
This is separate from #121, which covers enabled pool slots remaining occupied after sessions terminate. This issue is specifically about disabled pool lifecycle behavior: stale occupancy can remain visible after disable, and re-enable does not appear to reconcile status from live sessions.