Repository navigation
fix(spawn): resource_status reports the spawn memory floor - #24588
Conversation
fbe1c7a to
97a6f1d
Compare
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The tool only adds one line and changes its guidance when the floor is unmet. It reads the gate's own figure and prices, and it leaves the remote-child exemption alone. Notes
[DESIGN-REVIEWED] b53d4d6 Description read[DESCRIPTION-READ] 5ae480947b1cd83a76e95a9e566cab97fd441f3602ae8b7c02dd2210118d2db1 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/resource_status.py:1104 -- Fresh log prices can falsely report all starts blocked
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 — LOW. The failure needs three things at once: a learned bucket aging out of the cost log at seven days ( False positive or not applicable? A repository writer can comment: |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Every item reuses the gate's own pricing helpers ( What this change shipsInventory (7 items) — 7 justifiedIntent: when an agent checks
[FIRST-PRINCIPLES-REVIEWED] b53d4d6 Description read[DESCRIPTION-READ] fc7eab1f10d13c38c7e2aa27e1dffd80fe5fe2a1eb2769acbadf5f88429bb6b1 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
97a6f1d to
ee220ed
Compare
ee220ed to
214778e
Compare
214778e to
9e9c665
Compare
|
GPT F1 and Opus BLOCKING (214778e): fixed in 9e9c665. A caller bound to a remote workspace (session_attached_remotely) takes no floor reading and is never reported blocked, matching the gate's remote_child pricing. The nested-start clause is gone; the blocked text is scoped to local top-level starts only. Tests: test_a_remote_caller_takes_no_reading_and_is_never_blocked, test_the_caller_placement_reaches_the_floor_reading. |
9e9c665 to
3b314c7
Compare
3b314c7 to
a4bc6a8
Compare
|
Opus BLOCKING (3b314c7): fixed in a4bc6a8. The bar now prices the cheapest start the way the gate does: |
a4bc6a8 to
30a4a92
Compare
30a4a92 to
2f61314
Compare
2f61314 to
186bc4e
Compare
|
Maintainer call needed on the GPT 6.1 block (186bc4e). Every other check and lane is green. The finding is real. The tool reads memory in its own process, which sits inside the caller runtime's cgroup. The gateway reads its own figure. The tool's figure is never higher than the gateway's, so it can only err toward a false BLOCKED, never a false OK. Options:
Which one do you want? This PR is on hold until then: no more pushes, no reruns, no override. |
186bc4e to
b53d4d6
Compare
|
HOLD (decision) at b53d4d6. On the earlier head 186bc4e the author asked the maintainers for a ruling and put the PR on hold. The question is whether The rest is sound, CI is green, and all lanes pass. AI findings judged non-blocking:
— crew-pr-reviewer (r135) |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head (or skipped / author override), UX skipped or pass, no conflict, no open change request.
Problem / Motivation
Goal:
resource_statussays when no subagent can start, instead of reading AMPLE while the spawn gate holds every start.The tool's posture reads the reclaimable memory sum against
resource_pressure_gb. The spawn gate reads its own, stricter figure againstagent.spawn_min_memory_gbplus the start's price. Nothing inresource_status.pyor the tool reads the floor, so the tool can printPosture: AMPLEand "ample headroom" while everyspawn_runwaits in the queue.Why it matters
Agents call
resource_statusbefore a sub-agent wave. In the reported case the agent read AMPLE and told the user subagents were fine to launch, while every spawn sat queued.Intended?
No. The tool's description is "check headroom and the cap actually in force before heavy work / a wide subagent wave", and #23884 (merged) left "the spawn floor" to this issue on purpose. On main,
src/kiro_crew/mcp_tools/spawn.py:742(resource_status) prints onlyResourceStatus.summary_lines()and the adaptive cap;src/kiro_crew/resource_status.py:796(probe) reads onlyresource_pressure_gb/resource_critical_gb. The gate prices the start atsrc/kiro_crew/subagent_manager/admission/gate.py:866-898.Repro
Read on current main (
a3ee04f57), no local test run:agent.spawn_min_memory_gbto 4.0 (the pre-0.8 default the report hit), or use a loaded Mac at the 2.0 default:docs/system-specs/modules/subagent.mdrecords that the gate's macOS figure runs about 3.5 GiB below the posture's figure on a loaded host.spawn_rundefers (Subagent spawn deferred: only 3.30 GB available, need ...) and stays queued.resource_statusprintsPosture: AMPLEandGuidance: ample headroom right now ..., with no word about the floor.Not a goal
[RESOURCES]context-line change; the floor is read only by the pull tool.What changed (motivation → approach → change)
Approach: read the floor with the gate's own helpers and figure, and let it override AMPLE guidance when unmet.
src/kiro_crew/resource_status.py: newSpawnFloorReadingandspawn_floor_reading(). They use_spawn_memory_floor_and_cost,_shared_start_price_gband_dedicated_start_price_gb, and readcheck_memory_available(the gate's figure). One bar: the floor plus the cheapest top-level start (a shared start atsubagent_cost_gb). It is a lower bound, because the warming reserve and learned prices live in the gateway's manager.0floor takes no reading; an unmeasurable figure fails open as the gate does; an unreadable cgroup usage reads as blocked with its cause. A session bound to a remote workspace takes no reading and is never reported blocked, because the gate prices its children without the floor (remote_child).src/kiro_crew/mcp_tools/spawn.py: the tool adds aSubagent spawn floor:line. When the bar is unmet, the guidance says new top-level subagents cannot start and wait in the queue. The tool reads the caller's placement withsession_attached_remotely(in place of AMPLE or the kernel-pressure guidance; after critical/tight guidance as aSpawning:line).docs/system-specs/modules/subagent.md: one paragraph on the new reading.Example (floor 4.0, gate figure 3.3):
Backwards compatibility
Compatible: the tool prints one more line, and its guidance changes only when the floor is unmet. Posture, thresholds and every gate stay the same.
Removes nothing.
Tests
test/test_resource_status.py: pricing matches the gate helpers; blocked, disabled, unmeasurable and unreadable-cgroup cases; an end-to-end tool case where AMPLE plus an unmet floor must not say "ample headroom". The autouse fixture pins the gate figure so no case reads the CI host's memory.test/test_mcp_core_more_coverage.py::TestResourceStatusTool: the helper pins the reading; new cases for blocked over AMPLE, critical/tight plus blocked, blocked over kernel pressure, and a met floor keeping the AMPLE text.Proof: not provable -- other: tests run only in CI on this host by its owner's rule
Static gates run locally: black, isort, flake8 on the changed files. Tests run in CI.
Manual verification
Called
spawn_floor_reading()with floor 4.0 and a pinned gate figure of 3.3 GB; output is the example above.Related Issues
Fixes #14592
Sibling sweep
Swept: git grep -n "ample headroom" -- src/ docs/ test/
Siblings: none -- the tool in
mcp_tools/spawn.pyis the only place that prints the AMPLE guidance.Pattern harvest
Not generalizable: one advisory tool read a looser figure than the gate it advises about; the fix reads the gate's own figure.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)