Skip to content

feat(subagent): name the live memory-wait bound on the queued chip - #20503

Merged
bolichen97 merged 1 commit into
mainfrom
fix/queued-chip-wait-bound-16845
Oct 15, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/queued-chip-wait-bound-16845

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A subagent that waits for memory says how long it will wait before it gives up, using the live setting.

The queued chip said "starts give up once the pressure outlasts the wait limit" without naming the limit. The low-memory chips gave no give-up time at all. A card for a run that never started still offered "Load output from disk", and the expiry terminal gave no next step. Deferred from the #16347 UX review.

Why it matters

A user watching a stuck wave could not tell if it would wait 30 minutes, a day, or forever. They also got a button that could never load anything, and an expiry message with no next step.

Not a goal

  • Changing how long a spawn waits, or how the bound is counted (feat: bound how long a subagent spawn waits for memory #16347 owns that).
  • New settings, or a change to agent.subagent_queue_max_wait_secs itself.
  • The posture_critical chip key the issue names: spawns no longer wait on posture, and that key is gone from the catalogs.

What changed (motivation → approach → change)

The chip had no number to show, because the subagent_queued frame did not carry the bound. Now the frame for a memory wait (low_memory, memory_pressure) carries max_wait_secs. It is read when the frame is sent, through taskq_memory_wait_bound_secs, the same reader the sweep and the pressure hold use. So a config reload shows on the next frame. The chip turns it into a plural-aware duration ("30 minutes", "1 hour") and ends all three memory sentences with "they end without starting if memory stays short for {{limit}}". It is a total, not a countdown: the gate counts parked time, and the pressure hold restarts it when the lane starts something. At 0 the chip says "they wait with no time limit". With no field (an older gateway) it says neither. The memory_pressure sentence now opens with something the user can do ("close other apps to ease it") and says "other agents finish", since the hold waits on agents in any chat.

A card whose run never started for memory now shows "(no output: it never started)" instead of the disk-load button. The expiry terminal now gives a next step: "never started: waiting for memory (not enough memory freed up in time); retry once memory frees up". This rewrites owner wording on purpose: #16845 (filed by the owner) asks for exactly this next step, and the constant's comment now cites it. Both memory terminals open with one shared prefix, NEVER_STARTED_MEMORY_PREFIX. The wave digest's never-started count and the card's backendPhrases.json match that prefix.

All 12 translated catalogs, plus the regenerated pseudo-locale, carry the new keys. User docs and specs quote the new terminal text.

Where:

  • src/kiro_crew/subagent_manager/run.py: the frame gets max_wait_secs.
  • src/kiro_crew/subagent_wait_reasons.py: the shared prefix and the new expiry text.
  • src/kiro_crew/slack/gateway.py: the digest's count matches the prefix.
  • src/kiro_crew/constants.py: comment only.
  • src/kiro_crew/docs/ (configuration.md, subagents.md, dynamic-subagent-sizing.md): the new terminal text, and the chip naming the limit.
  • website/src/pages/chat/subagentQueuedReason.ts: parses the bound and picks the _limit / _no_limit / plain sentence.
  • website/src/pages/chat/ActivityViewer.tsx: no disk-load button on a never-started card.
  • website/src/i18n/locales/*.json: the *_limit, *_no_limit keys and no_output_never_started.

Backwards compatibility

Compatible: max_wait_secs is a new optional frame field, and a client without it renders today's sentence. The terminal text gets longer but keeps its opening words, and every reader matches on those words.

Removes nothing: no field, key or path is taken away. The old memory_pressure copy is reworded in place.

Tests

  • test_published_queue_depth.py::test_a_memory_wait_frame_carries_the_live_bound: both memory kinds carry the bound as it stands when the frame is sent, 0 passes through, and a concurrency wait carries none.
  • test_subagent_sizing.py: the re-emitted memory frame carries the default bound.
  • test_admission_gate.py: every catalog has *_limit (with {{limit}}) and *_no_limit forms of each memory sentence, and no number in the pressure copy. Both memory terminals open with the prefix the card matches and end with a next step.
  • ActivityViewer.test.tsx: 30-minute, 1-hour (singular) and 90-second bounds render; a 0 bound says "no time limit"; an absent bound says neither.
  • ActivityViewerCoverage.test.tsx: a never-started card shows no disk-load button and makes no fetch.

Local runs: tsc -p tsconfig.app.json, eslint, i18n-check, check-i18n-keys, check-i18n-strings, flake8, isort, black, mypy, and the flake and wait-discipline ratchets are clean. The related vitest files pass (319 tests, src/i18n/style included). The related backend files pass (357).

Manual verification

I loaded the real built SPA in Playwright, with every API call and the websocket stubbed. I pushed subagent_queued frames for the chip, then subagent_spawn and subagent_done frames with the expiry error for the card, and captured both below.

Screenshots / video

The chip, memory pressure with a 30-minute bound (dark, light):

chip pressure dark

chip pressure light

The never-started card: the Subagents panel shows "(no output: it never started)", in a readable muted tone, and no disk-load button (dark, light):

never started dark

never started light

Low memory with a 1-hour bound, and with the bound set to 0

low memory 1h dark

low memory 1h light

no limit dark

no limit light

Related Issues

Closes #16845

Follow-up to #16347.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 14, 2026 21:30
@bolichen97
bolichen97 requested a review from mbriones98 October 14, 2026 21:30
@bolichen97
bolichen97 enabled auto-merge (squash) October 14, 2026 21:31
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@bolichen97
bolichen97 force-pushed the fix/queued-chip-wait-bound-16845 branch from 887d602 to c64d70a Compare October 14, 2026 21:59
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of fd5a5c703b361e02ab07f87f76cbe15827d7264e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The chip says agents "end without starting", but the same outcome later shows up as "never started", "Error" and "Retry failed". The blind reader couldn't tell these were one outcome.

Watch

  • The chip's wording doesn't match the result's wording.
    • The chip's new tail, "they end without starting if memory stays short for {{limit}}", promises a calm ending. The same outcome then lands as the card's red "Error", "never started: waiting for memory…" and "Retry failed (3)".
    • The reader said: "'End' sounds calm, while 'Error' and 'failed' sound like something broke." They also couldn't tell "if that counts as a failure."
    • Everyone who watches a wait expire hits this, and it erodes trust in the countdown this PR exists to add.
    • Fix: reuse the result's verb, e.g. "they never start if memory stays short for {{limit}}".
  • The card's next step doesn't name the button.
    • The new card text ends "retry once memory frees up", while the chat note in shot-03 says "use 'Retry failed' in the Subagents panel".
    • Fix: end the card text with "then use Retry failed", so the action sits next to its button.
  • Shot-03/04 show the same 3 agents failing for two different reasons.
    • The chat note gives the memory-pressure reason, while the card gives "not enough memory freed up in time".
    • The reader concluded the screens "read like three separate problems". That's a staging artifact, but it hides whether the card copy fits a real run.
    • Fix: re-capture with one reason used end to end.

Suggestions

  • In memory_pressure*, the chip now runs four clauses joined by semicolons and wraps to two lines (shot-01). Shorten "they start once it eases or other agents finish" to "starts when it eases" so the time limit, the new information, comes sooner.

[UX-REVIEWED] fd5a5c7

Description read

[DESCRIPTION-READ] a1b82517f417c9160d67ab58a194a0525eae3934ee9322e187ee8d7e7a2bd8cd

That sha256 names everything this verdict read: the PR description, plus the 11 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of fd5a5c703b361e02ab07f87f76cbe15827d7264e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that the chip's "{{limit}}" reads as a total of time spent parked, not a countdown: the pressure hold resets it whenever the lane starts something, so a stuck wave can outlast it.

[DESIGN-REVIEWED] fd5a5c7

Description read

[DESCRIPTION-READ] b16fff24b94b9c08c93710b0b9b3bec0964370667296de2a9b32d083aaa16fe6

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of fd5a5c703b361e02ab07f87f76cbe15827d7264e — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check that "if memory stays short for {{limit}}" is accurate given that the pressure hold restarts the count whenever the lane starts something.

What this change ships

Inventory (7 items) — 7 justified

Intent: let a person watching a wave stuck on memory see how long it will wait before giving up, and what to do next. This is an ADDITION; the card and terminal fixes ride along.

  1. Memory-wait chips name the live give-up bound ("30 minutes", "1 hour"), carried as max_wait_secs on the frame — justified
  2. At a 0 bound the chips say "they wait with no time limit"; an older gateway's frame shows today's text — justified
  3. The memory-pressure chip now opens with "close other apps to ease it" and says "other agents finish" — justified
  4. A run that never started shows "(no output: it never started)" instead of the disk-load button that could load nothing — justified
  5. The expiry terminal ends with "retry once memory frees up" (Queued chip: show the live memory-wait bound (follow-up to #16347) #16845) — justified
  6. Both memory terminals share one opening constant, NEVER_STARTED_MEMORY_PREFIX, which the digest's count and the card match on — justified
  7. New *_limit / *_no_limit / no_output_never_started keys in all 12 catalogs and the pseudo-locale — justified

[FIRST-PRINCIPLES-REVIEWED] fd5a5c7

Description read

[DESCRIPTION-READ] 3a0c4f2d71df599836139b438735aabdad6023427be1d5838964142dbc4f29d4

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed fd5a5c703b361e02ab07f87f76cbe15827d7264e — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] fd5a5c7

Verdict parsed from the review's SHA-scoped output markers for commit fd5a5c703b361e02ab07f87f76cbe15827d7264e.

False positive or not applicable? A repository writer can comment:
/ai-review override fable fd5a5c703b361e02ab07f87f76cbe15827d7264e: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of fd5a5c703b361e02ab07f87f76cbe15827d7264e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fd5a5c7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt fd5a5c703b361e02ab07f87f76cbe15827d7264e: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@bolichen97
bolichen97 force-pushed the fix/queued-chip-wait-bound-16845 branch from c64d70a to 310f147 Compare October 14, 2026 23:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=91cba784d5e9 fixed

Fixed in 310f147: the clause now says what happens, "they end without starting if memory stays short for {{limit}}", in all 12 catalogs.
"End without starting" matches the card's "never started" and the terminal text, so the outcome is one thing, not cancel-or-error.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=8b6cb12fdc23 fixed

Fixed in 310f147: the pressure sentence now says "a running agent anywhere finishes".
The hold waits on any dedicated child of this gateway, from any chat, so this chat's 0-running count does not contradict it.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=c192968fc957 fixed

Fixed in 310f147: a bound of 0 now renders the *_no_limit sentence, "they wait with no time limit".
An absent field (an older gateway) still says neither, since the chip cannot know the bound. Tests in ActivityViewer.test.tsx pin both cases.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=bc321d4a2fdd fixed

Fixed in 310f147 by the copy route the item offers: the clause states a total the memory must stay short for, not a deadline from now.
A countdown is not sent on purpose: the pressure hold restarts its clock on each lane start, so any time-left figure would jump back up.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=e13b219da7e2 fixed

Fixed in 310f147: run.py reads the bound through manager._admission.taskq_memory_wait_bound_secs(), the reader the sweep and the pressure hold use.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • fixed

Fixed in 310f147: waitLimit is no longer exported. Its only caller is queuedWaitText in the same file, and no test imports it.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=07dab818773f fixed

Fixed in 310f147: the copy no longer promises a deadline. It says they end if memory stays short for {{limit}}, which holds for both the parked-time sweep and the lane-restarted pressure clock.
The spec paragraph in subagent.md now says it is a total, not a countdown, and why.

@bolichen97
bolichen97 force-pushed the fix/queued-chip-wait-bound-16845 branch from 310f147 to b43d4a3 Compare October 15, 2026 00:03
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=0849da961bd8 fixed

Fixed in b43d4a3: the pressure sentence now says "other agents finish", not "a running agent anywhere".
"Other" reads true beside this chat's 0-running count, since the hold waits on agents in any chat.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=d9b03b76d60c fixed

Fixed in b43d4a3: the pressure sentence now opens with an action, "close other apps to ease it", in all 12 catalogs.
It matches the low-memory chips, which already say "free up memory to continue".

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=e2744deaa188 fixed

Fixed in b43d4a3: the never-started line is now text-muted/70. The new light and dark shots show it readable.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=ba00f8039934 rebutted

Not unapproved: the owner filed #16845 and asked for this exact change, "Give the expiry terminal a next step ... retry once memory frees up".
In b43d4a3 the constant's comment cites #16845 as the owner's ask again, and the PR body says the rewrite is deliberate.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • rebutted

PASS punchline (the pressure hold restarts its count): the copy says memory "stays short for {{limit}}", a span with no progress, not a deadline from now.
The hold restarts only when another start in the same lane begins, which is the case where memory was not short for that start. So the sentence stays true.

@bolichen97
bolichen97 force-pushed the fix/queued-chip-wait-bound-16845 branch from b43d4a3 to 5687e4e Compare October 15, 2026 00:08
@bolichen97
bolichen97 force-pushed the fix/queued-chip-wait-bound-16845 branch from 5687e4e to 6ecf45a Compare October 15, 2026 00:31
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=be0383a907f0 rebutted

Kept: each clause is one an earlier UX round asked for on this PR (an action, how it resumes, the bound). Cutting any one reopens that finding.
The bound sits last because it is the exception; the chip still reads in one glance at the dashboard's width.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=0b90441ebf99 rebutted

Kept as a total: a time-left figure would be wrong, because the pressure hold restarts its clock whenever the lane starts something.
The copy says memory "stays short for" the limit, a condition, not a timer already running. A countdown needs a new gate signal, out of this PR's goal.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=653441dfc4eb rebutted

The card headline and the chat notice are existing surfaces this PR does not change; the expiry line is the run's own error, shown verbatim as for every failed run.
Deduping those three surfaces is a card redesign, outside this PR's goal of naming the bound.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • rebutted

PASS ask (old expiry rows): a row an older gateway wrote carries the bare "never started: waiting for memory", which equals NEVER_STARTED_MEMORY_PREFIX.
The digest and the card match with startswith on that prefix, so old rows still count as never started.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • rebutted

PASS ask: #16845 was filed by bolichen97, the issue's owner and assignee, and its body asks to "Give the expiry terminal a next step ... retry once memory frees up".
The rewrite applies that request and nothing beyond it.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 15, 2026
@bolichen97
bolichen97 force-pushed the fix/queued-chip-wait-bound-16845 branch from 6ecf45a to fd5a5c7 Compare October 15, 2026 01:40
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 15, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=80d3e5ca934b accepted-and-deferred

The chip's "end without starting" and the card's "never started"/"Error"/"Retry failed" use different words for one outcome.
Deferred to #20588 (deferred-finding, assignee bolichen97, Due 2026-10-28), which aligns the chip, card, panel and chat note in one pass over all 13 catalogs.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=4cd8d92b194e accepted-and-deferred

The expiry text's next step should name the Retry failed control.
Deferred to #20588 (deferred-finding, assignee bolichen97, Due 2026-10-28), which aligns the chip, card, panel and chat note in one pass over all 13 catalogs.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=8c2027d1f558 accepted-and-deferred

The run card's chat note names the pressure reason for every memory expiry; it is existing card copy this PR does not touch.
Deferred to #20588 (deferred-finding, assignee bolichen97, Due 2026-10-28), which aligns the chip, card, panel and chat note in one pass over all 13 catalogs.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=05bbba36db8a accepted-and-deferred

Shortening the pressure sentence changes all 13 catalogs again.
Deferred to #20588 (deferred-finding, assignee bolichen97, Due 2026-10-28), which aligns the chip, card, panel and chat note in one pass over all 13 catalogs.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • rebutted

PASS ask: it reads as a total, and the PR body and subagent.md say so. The pressure hold restarts only when the lane starts something, i.e. when memory was not short for that start, so a stuck wave with no starts cannot outlast it.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • rebutted

PASS ask: accurate. The count restarts only on a lane start, which is a moment memory was not short; with no start, the wait ends once memory has stayed short for the full limit.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 15, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by a maintainer who read the review lane notes and accepted them as follow-up work.

@bolichen97
bolichen97 merged commit fec3e98 into main Oct 15, 2026
101 of 102 checks passed
@bolichen97
bolichen97 deleted the fix/queued-chip-wait-bound-16845 branch October 15, 2026 04:56
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queued chip: show the live memory-wait bound (follow-up to #16347)

2 participants