Repository navigation
feat(skills/bounding-heavy-commands): give commands a default CPU quota and show processors in use in the check - #73
Merged
sourcehawk merged 2 commits intoSep 30, 2026
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The mandatory subagent dispatch rule does not include the new CPU-aware row-selection behavior.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds default CPU quotas and CPU usage visibility to bounded commands.
Changes:
- Defaults runs to half the machine’s processors.
- Reports CPU capacity and usage in
--check. - Adds CPU-aware row-selection guidance and tests.
| File | Description |
|---|---|
skills/bounding-heavy-commands/SKILL.md |
Documents CPU defaults, reporting, and row selection. |
skills/bounding-heavy-commands/scripts/bounded_run.py |
Implements quotas and CPU usage reporting. |
skills/bounding-heavy-commands/scripts/tests/test_bounded_run.py |
Tests CPU defaults, quotas, and check output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Owner
Author
…ta and show processors in the check A bounded command without --cpus ran with no CPU quota and with BOUNDED_RUN_CPUS at every processor of the machine, so the commands of the queue together could ask for more processors than the machine has, and nothing showed how many were taken. A run without --cpus now gets half the machine's processors, rounded down and at least 1: in BOUNDED_RUN_CPUS, and as its CPUQuota where the hard cap is available. This matches the --cpus of a command's first measurement. --measure-rows gives each row its own --cpus, so it is unchanged. --check now prints cpus=<machine processors> and cpus-used=<sum of the quotas of the running bounded scopes, from cpu.max> on its state line, and cpus=<n> on each held line, so that an agent can choose a row that fits the free processors. The skill says to prefer such a row when two rows would start. The admission of a command by processors stays open. Towards #72 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it chooses a row The skill now prefers the largest row that would start and fits in the free processors, but the rule that each dispatch prompt carries still said to use the largest row with starts=yes. A subagent knows only the rule in its prompt, so it kept choosing a row that slows every running command. The dispatch rule now has the same fit check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sourcehawk
force-pushed
the
feat/default-cpu-quota
branch
from
September 30, 2026 10:22
c22540a to
4131ec2
Compare
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Towards #72
A bounded command run without
--cpushad no CPU quota, and nothing showed how many processors the running bounded commands had asked for together. On a 16-processor laptop,--checkfrom this PR readcpus=16 cpus-used=20while a dozen agent sessions ran tests. A command without--cpusnow runs under a default quota of half the machine's processors, and--checkreports the processors in use, so an agent can prefer a row that fits. The queue still does not make a command wait for processors. That part of #72 stays open until batches of real builds show that it saves time.Changes
--cpusgets half the machine's processors (at least 1) as itsCPUQuotaunder the cap, and asBOUNDED_RUN_CPUSeverywhere. Before,BOUNDED_RUN_CPUSwas all processors and there was no quota.--checkstate line gainscpus=<machine> cpus-used=<n|->: the sum of the quotas of the running bounded scopes, read fromcpu.max, wheremaxcounts as all processors. Each held line gainscpus=<n|->.--cpusrow states the default. The check format describes the new fields. The row-choice paragraph says to prefer the largest row that fits withincpus - cpus-usedwhen two rows would both start.cpus.Related
Testing
TDD. New tests with fake
cpu.maxtrees cover the rounded-up sum,max, skipped probe and other scopes, a scope that ends while it is read, and an unreadable quota. The check tests cover the new state and held fields. The run tests cover the default on 16, 7, and 1 processors and an explicit--cpus, the cap prefix withCPUQuota=800%by default, and a real wrapper process that gives the command half the processors. The full suite (332 tests) passes through the queue.🤖 Generated with Claude Code