You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unify ExecutionQueue and SlotService (mutual blindness) #98
Approach: Option A — SlotService becomes the single source of truth.
Changes
src/backend/routers/chat.py:
chat_with_agent(): Acquires a capacity slot via SlotService when the chat execution starts, releases it in the finally block alongside the queue completion
terminate_agent_execution(): Releases the capacity slot when terminating a chat execution
src/backend/services/agent_service/queue.py:
force_release_agent_logic(): Now also clears all capacity slots when force-releasing an agent
How it works
The ExecutionQueue still enforces serial chat (one at a time per agent)
The SlotService slot makes the chat resource usage visible to the capacity meter
Total capacity = max_parallel_tasks (shared between chat and tasks)
A chat execution now counts as 1 slot, so an agent with max_parallel_tasks=3 running a chat can still accept 2 parallel tasks
Slot is acquired non-blocking (failure to acquire doesn't prevent chat — the queue already controls serialization)
What this fixes
✅ Capacity meter now shows ALL execution types (chat, task, schedule, public, paid)
✅ A /chat execution occupies both the queue AND a slot
✅ Force-release clears both queue state and capacity slots
✅ Execution termination releases both queue and slot
Activity
vybe commentedon Mar 21, 2026
Implementation Complete
Approach: Option A — SlotService becomes the single source of truth.
Changes
src/backend/routers/chat.py:chat_with_agent(): Acquires a capacity slot viaSlotServicewhen the chat execution starts, releases it in thefinallyblock alongside the queue completionterminate_agent_execution(): Releases the capacity slot when terminating a chat executionsrc/backend/services/agent_service/queue.py:force_release_agent_logic(): Now also clears all capacity slots when force-releasing an agentHow it works
ExecutionQueuestill enforces serial chat (one at a time per agent)SlotServiceslot makes the chat resource usage visible to the capacity metermax_parallel_tasks(shared between chat and tasks)max_parallel_tasks=3running a chat can still accept 2 parallel tasksWhat this fixes
/chatexecution occupies both the queue AND a slotfix: Unify ExecutionQueue and SlotService — chat acquires capacity sl…
vybe commentedon Mar 21, 2026
Fixed in 4c8de95 — chat executions now acquire capacity slots, making SlotService the single source of truth for agent load.
feat(executions): GET /api/executions/timeline — bucketed fleet rollu…
feat(executions): GET /api/executions/timeline — bucketed fleet rollu…