Conversation
PR #102463 — demand-displace stalest pool backend instead of queue-timeout on profile switchVerdict: Looks good. Right prioritization (interactive profile switch outranks background pool pressure) with a tightly scoped victim policy; the documented single-displacement limit keeps the blast radius small. What the change does
Non-blocking
Tests: Selector unit test covers the policy core; see point 1 for the integration level. Good. |
jerrygooch
left a comment
There was a problem hiding this comment.
This fixes the slot-cap half of #102163, but the title and body say "Fixes"/"Closes" the whole issue, and the second symptom isn't touched.
#102163 reports two separate regressions:
-
The 3-slot cap (
Local backend start for "X" timed out while waiting for a free slot). This diff handles that:selectSlotDisplacementVictimanddisplaceStalestPoolBackendForSlotstop the stalest running backend when a spawn queues behind full slots. -
The session-ownership lock (
Session X already has a live owner (desktop, pid Y, running 10m). Only one surface at a time may run a session). The issue says this fires "even with 2–3 profiles active", below the cap, so displacement never runs in that case. The lock lives in a separate path,hermes_cli/active_sessions.py(session_already_owned_message, backed byruntime/active_sessions.json), and none of the three changed files (all underapps/desktop/electron/) touch it.
If this merges with "Closes #102163", GitHub closes the P1 while the ownership-lock half is still open. I'd scope the wording to Addresses #102163 and leave the issue open for the ownership-lock symptom.
One more thing worth a second look: displaceStalestPoolBackendForSlot stops the stalest running backend even if that profile is mid-turn. lastActiveAt being oldest only means least-recently-active, which can still be an in-flight agent. A foreground switch can interrupt another profile's active work. If that tradeoff is intended it's worth saying so in the body.
…search#102163 Slot-cap half only: demand-displace stalest running pool backend when a spawn queues behind full slots. Session-ownership lock half (hermes_cli/active_sessions.py) intentionally untouched — issue stays open for that symptom. Displacement may interrupt a background profile mid-turn; foreground switch outranks it, session persists and reopening respawns.
ca67d50 to
f07e858
Compare
|
Thanks for the review — you were right on both points. Scoped this PR to the slot-cap half: title/body now say Addresses #102163, ownership-lock half ( |
What Problem This Solves
Addresses #102163 (slot-cap half only) — [Bug]: Profile switching regression in v0.21.0 — 4th profile timed out waiting for a free local slot. Minimal diff, single shared guard, no new deps.
Scope note
Session X already has a live owner,hermes_cli/active_sessions.py) is intentionally untouched — [Bug]: Profile switching regression in v0.21.0 — slot limit 3 enforced + session ownership lock #102163 stays open for that half.Evidence