Repository navigation
feat(ui): show leaked agent runtimes on Services, reclaim on confirm - #15764
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Post-reclaim numbers are stale for up to a tick: the card's refetch rereads a Watch
Suggestions
[DESIGN-REVIEWED] 860ff2b Description read[DESCRIPTION-READ] 3818860154c5fcf74a7629eb13f425a273c2f2fc33ab7ac8567b2a606b477e32 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 (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The description ties this UI's shape to RFC #15748, still open — a maintainer should confirm shipping ahead of it is intended. What this change shipsInventory (10 items) — 10 justifiedIntent: let an operator see leaked agent runtimes (count, memory) and end them with a two-step confirm — an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 860ff2b Description read[DESCRIPTION-READ] 8d483f4e999c7d2a139545c9da24d922bff966d9403eebd0d65716c1d330fbcb That sha256 names the PR description this verdict read. Recompute it with |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- website/src/pages/system/LeakedRuntimesCard.tsx:64 -- after a successful read, a later 404 retains cached False positive or not applicable? A repository writer can comment: |
a2718c6 to
c51a48d
Compare
|
[operator: iamwhatever] New frame for head c51a48d: a failed read (500) now renders through ErrorNotice instead of hiding the card. Only a 404 (route absent) hides it. |
|
[operator: iamwhatever] GPT findings on a2718c6:
|
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS "Kept 1" gives no reason the card already holds, directly under copy promising "loses no work" — the blind reader could not tell whether to worry. Watch
Suggestions
[UX-REVIEWED] 860ff2b Description read[DESCRIPTION-READ] fe313a1e334da7f0c7ed5e73134c2d2f7424abb5f0ec292d332ace381078aa3f 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 |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsA failed background refetch replaces the live card, so a reading that is sitting right there — and a just-confirmed reclaim's result — disappears for up to 30s. FINDING — website/src/pages/system/LeakedRuntimesCard.tsx:51 — FINDING — website/src/pages/system/LeakedRuntimesCard.tsx:94 — a reclaim that ended nothing renders only as the muted [OPUS-REVIEWED] 860ff2b Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
c51a48d to
95e386e
Compare
|
[operator: iamwhatever] Frames for head 95e386e (built SPA, |
|
[operator: iamwhatever] Dispositions for c51a48d (head now 95e386e):
|
|
[operator: iamwhatever] Opus blocker on 95e386e (UI without routes) and GPT F1 are the same sequencing fact: the routes land in #15755, which was split out to keep each PR reviewable. This PR stays open and unmerged until #15755 merges, then it is rebased onto main, at which point both routes exist on the head and both findings are moot. No change here until then. |
System > Services gains a "Leaked agent runtimes" card: how many managed runtimes no session tracks, and the memory they hold, read from GET /api/system/leaked-runtimes. A line under the numbers says no session uses them and reclaiming loses no work. The card hides when the route is absent (404), on a non-Linux host, or when nothing leaks; any other read failure shows through ErrorNotice. Reclaim is the shared useArmedDelete machine: the first click only arms and relabels the button "Reclaim now? No work is lost", the second sends the one owner-only POST /api/system/leaked-runtimes/reclaim with confirm: true. The result line says how many ended and how many were kept; an owner_only refusal names who can reclaim, and every failure renders through ErrorNotice with the agent hand-off (no draft here). Ten catalog keys under pages.servicesTab in every locale, en-XA regenerated. capture-leaked-runtimes.mjs photographs rest, the open tip, armed, reclaimed (with the post-reclaim reading), refused, a failed read, 390px and armed at 320px from the built SPA.
95e386e to
860ff2b
Compare
|
[operator: iamwhatever] Dispositions for 860ff2b (Design and UX are CONCERNS, not blocking; no push for these, so the lanes are not re-run):
|
buluoray: name reap_abandoned_agent_scopes as a separate arm that keeps its own four-part check; step A (#15755, #15764) refuses a candidate whose KIROCREW_SPAWN_HOME is not this data home, with a same-uid other-home security row; the reading GET is authenticated, only the reclaim POST is owner-gated; Decision 4 lists the two spawn-instance refusals that stop a detached setsid child; only AcpRuntime stamps the spawn instance and home, so step B stamps AcpClient._spawn and step C covers stamped paths; Windows has no reading and #11991 stays unresolved; the leader refusals read "still that session's / group's leader". chenmingwei23: the spawn record is one row per runtime root (root pid, start id, spawn instance), written at spawn before session/new and removed only once the root is gone, never on session release or lease drop; the lease veto comes before the spawn record, and step B's exit criteria cover a root a new gateway re-leases after a restart. Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com>
* docs(rfc): decide how leaked agent runtimes are reclaimed Records the decision before the code: one reclaim arm (the runtime reconciler), default-on with its per-pass budget and the reconcile_max_kills=0 observe switch, ownership proved by a persisted install-scoped spawn record that can only veto, four refusals that always win, Linux first, and a user-confirmed Reclaim on the dashboard. Step A (report + confirmed reclaim) adds no default authority. Steps B and C extend it, and the First Principles lane reads that decision from the base branch, so this document lands on its own. Refs #11899 * docs(rfc): answer the leaked-runtime reclaim review rounds buluoray: name reap_abandoned_agent_scopes as a separate arm that keeps its own four-part check; step A (#15755, #15764) refuses a candidate whose KIROCREW_SPAWN_HOME is not this data home, with a same-uid other-home security row; the reading GET is authenticated, only the reclaim POST is owner-gated; Decision 4 lists the two spawn-instance refusals that stop a detached setsid child; only AcpRuntime stamps the spawn instance and home, so step B stamps AcpClient._spawn and step C covers stamped paths; Windows has no reading and #11991 stays unresolved; the leader refusals read "still that session's / group's leader". chenmingwei23: the spawn record is one row per runtime root (root pid, start id, spawn instance), written at spawn before session/new and removed only once the root is gone, never on session release or lease drop; the lease veto comes before the spawn record, and step B's exit criteria cover a root a new gateway re-leases after a restart. Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com> --------- Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com>















Problem / Motivation
Goal: an operator sees how many agent runtimes have leaked and how much memory they hold, and can end them with an explicit two-step confirm.
Leaked runtimes (#11899, #11789) hold memory until the host OOMs, and the dashboard shows nothing about them. #15755 (merged) added the reading and an owner-only reclaim route; this PR is the surface for both.
Why it matters
Without a number on screen, a leak is found only after the gateway restarts on OOM. About 23 users hit this.
Not a goal
What changed (motivation → approach → change)
The RFC proposing how leaked runtimes are reclaimed is #15748 (open). This is the UI for its first step. The routes it calls landed in #15755 (merged); this PR is rebased onto main, so both exist on this head.
System > Services gains a Leaked agent runtimes card (
website/src/pages/system/LeakedRuntimesCard.tsx):GET /api/system/leaked-runtimes, refetched every 30s. Hidden only when the route is absent (404, a gateway older than feat(runtime): read leaked untracked runtimes, reclaim on confirm #15755), the gateway reportssupported: false(non-Linux), or nothing leaks. Any other read failure renders throughErrorNoticewith the hand-off, so a broken reading never looks healthy.useArmedDeletearm → confirm → decay machine rather than a new one. A muted line under the numbers says no session uses these runtimes and reclaiming loses no work. The button is neutral at rest. First click only arms, turns it red and relabels it "Reclaim now? No work is lost" (visible label is the accessible name, noaria-label). Second click sends onePOST /api/system/leaked-runtimes/reclaimwith{"confirm": true}. The arm decays after 3s.ErrorNoticewith the agent hand-off on (the card has no unsaved input, so nothing is lost); a 403owner_onlysays only the dashboard owner can reclaim, and a failed read uses a catalog sentence rather than raw backend text.dl, so it renders at 390px and 320px.leakedRuntimes()andreclaimLeakedRuntimes()inwebsite/src/api/client/system.ts.pages.servicesTabin every locale,en-XAregenerated. Feature-map row updated.Backwards compatibility
Compatible: a new card that self-hides when the route is absent; no existing component changes behaviour.
Tests
website/src/test/LeakedRuntimesCard.test.tsx: count and memory render; hidden at zero; hidden on 404 but a 500 shows through ErrorNotice; the first click only arms and the second sends exactly one reclaim and shows the result; a rejected reclaim shows through ErrorNotice.Manual verification
Local: vitest (card,
src/pages/system,src/i18n— 733 tests),tsc -p tsconfig.app.json, eslint,i18n:checkwithI18N_BASE_REF, feature-map, comment-history and brand gates. Frames below from the built SPA viawebsite/scripts/capture-leaked-runtimes.mjs(gateway-free,/api/**stubbed, light theme).Screenshots / video
Rest
Tip open
Armed
Reclaimed
Refused, read failed, 390px, armed at 320px
Refused (owner only)
Read failed (500)
390px
Armed at 320px
Related Issues
Refs #11899, #11789. RFC: #15748. Backend: #15755.
Checklist
Contribution License Agreement