How `quota.compute=0` Enforces a Goal-Level Hard Pause in LoopX
When quota.compute is set to 0, the LoopX scheduler immediately halts all automatic agent turns for the Goal, overriding lane-level limits, manual stop commands, and agent requests until the quota is explicitly raised above zero.
In the huangruiteng/loopx repository, the quota.compute field governs automatic compute allocation within a Goal's quota window. Setting this value to zero triggers a hard pause at the control-plane level, ensuring comprehensive work stoppage across all lanes and agents regardless of other operational signals.
Scheduler Evaluation at the Control Plane
The enforcement mechanism originates in loopx/control_plane/scheduler/scheduler_hint.py, where the scheduling logic evaluates the effective compute quota during every scheduling tick.
According to lines 1095–1109 of the source code, the scheduler_hint function inspects the Goal's quota.compute value. When this field equals 0, the function returns a "must stop" directive that instructs the scheduler to skip all automatic agent turns for that specific Goal. This evaluation occurs before any lane-specific or agent-specific logic executes, establishing the zero-quota condition as a top-level gate that prevents dispatch regardless of downstream capacity signals.
Status Propagation and System Observability
The hard pause state is not merely internal to the scheduler. In loopx/status_server.py at line 61, the GoalStatus structure exposes a quota_compute field to external consumers.
When quota.compute equals zero, the status server marks the Goal as paused in its reported state. This guarantees that dashboards, UIs, and API consumers receive a consistent view of the Goal's operational status, clearly distinguishing between active Goals and those under compute quota restriction without requiring direct access to scheduler internals.
Override Behavior Across System Components
Because the scheduler evaluates the compute quota before processing other signals, a quota.compute=0 setting overrides three categories of operational triggers that would otherwise permit execution.
Lane-Level Slot Limits
Even when individual lanes report available capacity or free slots, the scheduler ignores these capacity signals while the Goal maintains a zero compute quota. The hard pause takes precedence over resource availability checks, ensuring that no new turns are dispatched to lanes regardless of their current load state.
Explicit Stop Commands
While both manual stop commands and zero-quota pauses halt Goal execution, they differ in their resume semantics. A manual stop requires an explicit Goal-level resume command to restart operations. In contrast, the zero-quota pause automatically resumes once the quota.compute value is raised above zero, making the quota-based mechanism suitable for temporary resource throttling rather than administrative shutdowns.
Agent-Initiated Requests
Agents cannot force execution turns while the Goal is hard-paused. The scheduler drops or queues agent requests until the compute quota returns to a positive value, preventing any agent-level operations from bypassing the quota restriction. This ensures that individual agents cannot consume resources even if they possess ready work items.
Resuming from a Hard Pause
The zero-quota pause persists until explicitly cleared through configuration changes. As implemented in loopx/control_plane/scheduler/scheduler_hint.py at line 1109, the "must stop" condition remains active until quota.compute is explicitly raised above 0.
This design prevents accidental resumption. No other component—whether lane managers, agent schedulers, or UI commands—can lift the pause without direct modification of the quota field. The requirement for an explicit quota increase ensures deterministic control over Goal reactivation and prevents transient signals from interrupting the intended pause state.
Practical Implementation Examples
Configure a hard pause using the LoopX CLI or Python SDK to immediately halt Goal execution.
Using the command-line interface:
# Hard-pause a Goal (all automatic agents stop)
loopx configure-goal --goal-id my-goal --quota-compute 0
# Verify the pause in the status UI
# The dashboard will show "paused" and the compute quota as 0
# Resume the Goal by raising the compute quota above 0
loopx configure-goal --goal-id my-goal --quota-compute 0.5
Using the Python SDK:
from loopx.client import LoopxClient
client = LoopxClient()
# Enforce a hard pause
client.configure_goal(
goal_id="my-goal",
quota_compute=0.0 # Hard-pause
)
# Later, lift the pause by setting a positive value
client.configure_goal(
goal_id="my-goal",
quota_compute=1.0 # Resume normal operation
)
Summary
quota.compute=0triggers a hard pause enforced at the scheduler level inloopx/control_plane/scheduler/scheduler_hint.py(lines 1095–1109).- The pause overrides lane-level slot availability, explicit stop commands, and agent execution requests due to its position as the first evaluation in the scheduling loop.
- The
GoalStatusinloopx/status_server.py(line 61) propagates the paused state to external observers and dashboards via thequota_computefield. - Resumption requires explicitly setting
quota.computeabove zero; no other component can bypass this requirement or accidentally lift the pause. - Both CLI and SDK provide direct interfaces to configure the compute quota and trigger the hard pause state atomically.
Frequently Asked Questions
What happens when quota.compute is set to 0?
When quota.compute is set to 0, the LoopX scheduler immediately enters a hard-pause state for the affected Goal. The scheduler_hint function returns a "must stop" directive that prevents all automatic agent turns, effectively freezing Goal execution regardless of available resources or other command signals.
How does a compute quota pause differ from a manual stop command?
Both states halt Goal execution, but their resume paths differ significantly. A manual stop requires an explicit Goal-level resume command to restart operations. In contrast, a compute quota pause is lifted automatically once quota.compute is raised above zero, making the quota-based mechanism suitable for temporary resource throttling rather than administrative shutdowns.
Can agents override a hard pause triggered by quota.compute=0?
No. Agents cannot force execution turns or bypass the hard pause state. The scheduler evaluates the zero-quota condition before processing agent requests, effectively dropping or holding agent operations until the compute quota returns to a positive value. This ensures strict adherence to resource constraints defined at the Goal level.
Which source files control the hard pause logic?
The primary logic resides in loopx/control_plane/scheduler/scheduler_hint.py, specifically lines 1095–1109, where the scheduler_hint function evaluates the quota and issues stop directives. State propagation is handled by loopx/status_server.py at line 61, which exposes the quota status to external systems via the GoalStatus structure.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →