Repository navigation
fix: show unknown memory headroom on an unreadable cgroup wait - #21126
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the new [DESIGN-REVIEWED] df6ba85 Description read[DESCRIPTION-READ] 88dd6223b8c17f14f58f0288e7d5aa4be7d3bc7d0c3eabb813fa0aa1df603ff2 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check one thing: the SEL audit row still records What this change shipsInventory (6 items) — 6 justifiedIntent: when a subagent is waiting because its cgroup memory usage file can't be read, the person should see that free memory is unknown and that read access needs restoring, not "0 GB free now". This is a FIX, closes #15956.
[FIRST-PRINCIPLES-REVIEWED] df6ba85 Description read[DESCRIPTION-READ] 737a5f5fe165d68d06c3fb8441534e69b962328238c413128ccd4285312e5815 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The new chip sentence gives an instruction nobody can follow: the blind reader called it "sure it's a warning, no idea what it means" and couldn't tell "which file, where it is, or how". Watch
Suggestions
[UX-REVIEWED] df6ba85 Description read[DESCRIPTION-READ] 241d8173958b23f48544292702aef1ed21a94d77063a70ab118d1564de9f9067 That sha256 names everything this verdict read: the PR description, plus the 6 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 |
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: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
A spawn deferred because a finite cgroup memory limit has no readable usage file waits with unknown headroom, but the queued chip read the 0 the probe contributes as a measurement and said "0 GB free now". The gate's low-memory wait label now carries cause cgroup_usage_unreadable and drops available_gb in that case. The chip parses the cause and renders a new "free memory is unknown" sentence (three wait-bound tails, all locales). Admission is unchanged. Closes #15956
|
Pushed df6ba85 (rebased on main). It answers the UX Review concern on f419627: the unknown-headroom sentence now names the unreadable file and who needs access. It reads "the gateway can't read its cgroup memory usage (memory.current / memory.usage_in_bytes); give the gateway read access to that file to continue", updated in all 12 catalogs. On the Design Review check: the start resumes by itself once the file is readable. The fit pass and the admit-wait re-check re-read the host, and a reading without the cause clears the wait (docs/system-specs/modules/subagent.md, the fit-pass paragraph). Screenshots in the description were re-captured on this head. |
f419627 to
df6ba85
Compare
|
Reply to UX Review on df6ba85. The verdict is advisory, and I'm leaving the wording to the maintainer instead of starting another edit round:
|
chenmingwei23
left a comment
There was a problem hiding this comment.
Approved: readiness: passed, no conflicts, checks green.
Problem / Motivation
Goal: When a subagent waits because its cgroup memory usage can't be read, the dashboard's queued chip says free memory is unknown instead of "0 GB free now".
A spawn deferred on a finite cgroup memory limit whose usage file (
memory.current/memory.usage_in_bytes) is unreadable has unknown headroom. PR #15929 named that in the deferral reason, refusal text, gateway warning and audit row, but the chip rebuilds its line from the structuredsubagent_queuedfields. The probe contributes0.0for that level, so the chip read "needs 4.5 GB of free memory, 0 GB free now".Why it matters
The chip tells the person to "free up memory" and reports a figure that was never measured. On a host with plenty of memory but a locked-down cgroup, that sends them after the wrong fix. The real remedy, restoring read access, only showed in the gateway log.
Not a goal
host_read_unanswered,lane_share). Those already arrive withoutavailable_gband keep their current figure-less sentence.What changed (motivation → approach → change)
Symptom: "0 GB free now" on an unknown-headroom wait. Root cause: the gate's
wait=label forlow_memoryincludedavailable_gbwhenever the reading was>= 0, and an unreadable cgroup usage reads as0.0. The cause frompop_memory_check_cause()never reached the label.src/kiro_crew/subagent_manager/admission/gate.py: when the memory cause iscgroup_usage_unreadable, thelow_memorywait carriescause: "cgroup_usage_unreadable"and noavailable_gb.required_gbstays.website/src/pages/chat/subagentQueuedReason.ts: parsescause(kept only forlow_memoryand only that value).queuedWaitTextrenders the unknown-headroom sentence ahead of any figures, with the same three wait-bound tails as the other memory sentences. The sentence says which file can't be read and who needs access: "the gateway can't read its cgroup memory usage (memory.current / memory.usage_in_bytes); give the gateway read access to that file to continue". The deferred start resumes by itself once the file is readable, because the admit-wait re-check and the fit pass re-read the host on their own.pages.chat.subagentQueued.low_memory_unknown{,_limit,_no_limit}inen.jsonand all 11 translated catalogs, plus a regenerateden-XA.json.docs/system-specs/modules/subagent.mdand the_emit_queue_depth_impldocstring now describe the new field.website/scripts/capture-15956-memory-headroom-unknown.mjs: an asserting screenshot harness, like the existingcapture-parked-subagent-chip.mjs.Backwards compatibility
Compatible:
causeis an additive optional field. An older frontend ignores it and shows the figure-lesslow_memory_no_figuressentence, becauseavailable_gbis now absent. That is still more accurate than "0 GB free". A newer frontend on an older gateway gets nocauseand behaves as before.Removes nothing: the
low_memorylabel only stops carrying anavailable_gbthat was never measured. Readers of_queue_waitwere checked on origin/main:gate_pressure.pyreads onlyreason,run.pyspreads the dict into thesubagent_queuedframe, and the frontend'sparseSubagentQueuedReasontreatsavailable_gbas optional.Tests
test/test_spawn_memory_cause.py::test_unreadable_usage_wait_label_names_the_cause_not_zero_available: real cgroup fixture with the usage file unreadable. The wait label carries the cause andrequired_gb, and has noavailable_gb.test/test_spawn_memory_cause.py::test_spawn_deferral_for_measured_low_memory_is_unchanged: now also checks that a measured wait keepsavailable_gb == 1.0and gets nocause.website/src/test/subagentQueuedReason.unknownHeadroom.test.ts: covers parsing (cause kept, unknown causes and non-low_memorykinds dropped), the unknown sentence for each wait-bound tail with no "free now" or "0 GB", and an unchanged measured sentence.website/src/test/SubagentProgressBar.test.tsx: the rendered chip line says "free memory is unknown" for the unreadable-usage frame.Run locally:
pytest test/test_spawn_memory_cause.py test/test_spawn_floor_defaults.py::test_only_a_read_that_answered_unmeasurable_proceeds_unchecked: 14 passed.viteston the two files above plussubagentActivity,ActivityViewer,SubagentRunCard,chatSlice.publicSurface,UseWebSocketCoverage.activityandChatSidebar.boardStateLanes: all passed.I18N_BASE_REF=origin/main vitest run src/i18n: 50 files, 1022 passed.npm run i18n:check,tsc -b, eslint: clean.scripts/local-gate.py: backend batch 1 shows 20 failures intest_acp_spawn_offload.py::TestRuntimeProjectedLaunchDocuments,test_agent_backend_recheck_e2e.py::TestRecheckOverHttpandcode_review_sage/.../test_store_ancestor_chain.py. The same 20 fail with this diff reverted, on clean origin/main, on this host, so they come from the host environment. The rest of the oversized related set (3,346 backend and 1,275 frontend files, mostly because the locale catalogs are referenced everywhere) is left to CI.Manual verification
npm run build, thennode scripts/capture-15956-memory-headroom-unknown.mjs(scripted Playwright against the built SPA). It pushes realsubagent_queuedframes and asserts the chip text. All 4 scenes passed: dark and light, unknown headroom and measured low memory.Screenshots / video
Unreadable cgroup usage (after):
Measured low memory (unchanged):
Related Issues
Closes #15956
Follow-up from #15929.
Pattern harvest
Not generalizable: the wait label leaked one specific sentinel (0.0 for unknown cgroup usage), and a cause field on the label now carries it. Other sentinel paths already pass a cause (
host_read_unanswered) or use -1.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.