Repository navigation
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Nobody has checked the fix against the reported wave: if pressure stayed WARN the whole time, the untouched episode bound still ends the same tail at about 30 minutes. Watch
Suggestions
[DESIGN-REVIEWED] d67f294 Description read[DESCRIPTION-READ] cc8c01281e29b69ea1d68d172f3598d89eb5c8528bb9459251b78f69c49337e0 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, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check before merge: claim re-entries ( What this change shipsInventory (5 items) — 5 justifiedIntent: when macOS memory pressure holds a large spawn_run wave whose queue is still draining, let every member run instead of ending the back of the queue as "never started" (#18891). This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] d67f294 Description read[DESCRIPTION-READ] 83f262fd665f05fc95449be14aac8aabe2442ef786de94662783a0fd0c0991fc That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
859d2f8 to
764066a
Compare
|
|
|
|
764066a to
ab5f4a6
Compare
|
|
|
|
ab5f4a6 to
516fe92
Compare
… starts The macOS memory-pressure hold ended a queued root start once agent.subagent_queue_max_wait_secs had passed since the start was first held. Every queued row is first held at about the same moment, so a large wave whose queue was still draining ended its tail as "never started". The manager records when it last registered a root start, and the hold's own wait is measured from that time or the row's first hold, whichever is later. A queue that keeps starting no longer expires the rows behind it, and a queue that stops starting still ends them after one full bound. Closes kirodotdev#18891
516fe92 to
d67f294
Compare
|
|
|
Problem / Motivation
Goal: A large spawn_run wave held by macOS memory pressure runs every member as long as its queue keeps starting, instead of ending the back of the queue as "never started".
I sent one spawn_run batch of 84 short tasks while macOS reported memory pressure WARN. The queue kept draining the whole time, with a new start every 30 to 90 seconds, but 28 of the 84 tasks ended with "never started: waiting for memory" after waiting about 1,800 to 2,000 seconds. The details are in #18891.
Why it matters
Anyone on a Mac under memory pressure who fans out more work than drains in 30 minutes silently loses the tail of the wave. The run looks finished, and the parent has to notice the missing results and resubmit them.
Not a goal
_pressure_episode_spent).What changed (motivation → approach → change)
The hold gave each queued root start a clock from the first time it held that start. The pump checks every queued root on each pass, so the whole queue's clocks start within seconds of each other. Rows near the back ran out while they were only waiting for their turn behind starts that were still going.
The hold's own wait in
subagent_manager/admission/gate.pyis now measured from the later of the row's first hold and the last root start the gateway registered. The manager insubagent.pykeeps that time as_root_started_at, and the gate sets it where a start is registered. While the queue keeps starting, the rows behind it keep waiting. If nothing starts for a full bound, every held row still ends as before. Progress is counted gateway-wide because the queue is shared, and nested starts don't count since the hold never applies to them. The episode bound is untouched, so one pressure episode that outlasts the bound without a break still ends every held start.The spec (
docs/system-specs/modules/subagent.md) and the user guide (src/kiro_crew/docs/subagents.md) say how the wait is measured.Backwards compatibility
Compatible: the change can only make a held start expire later, never sooner, and the bound, its config key and the expiry result are unchanged.
Removes nothing: the change only moves when a held start can expire.
Tests
test_a_root_start_restarts_a_held_rows_wait: a row held past the bound stays held when a root start happened within the bound, and expires once the last root start is a full bound old.test_a_registered_start_stamps_root_progress: registering a root start records progress, and registering a nested start does not.Both fail on main.
Manual verification
N/A. The unit tests cover the clock directly, and reproducing the original wave needs a host held at memory pressure WARN for over 30 minutes.
Related Issues
Closes #18891
Follow-up to #16480, which added the bounded wait.
Pattern harvest
Not generalizable: the defect is specific to how one wait clock was anchored, and the codebase has no other per-row clock that the whole queue starts together.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)