Repository navigation
Conversation
crag-v2 refuses to start with 'session_slots exceeds physical capacity' when kernel.json carries the panel default (20) on a Pro (5) or Max 5x (12) slot, so every CRAG slot failed its next restart after 1.4.112.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78209e44b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| config.session_slots = Math.min( | ||
| resolveSessionSlots(followGlobal ? {} : target, kernelRouting), | ||
| config.slots_per_worker, | ||
| ) |
There was a problem hiding this comment.
Recompute session limits when physical slot capacity grows
If the capacity reconciler raises a VM after this config is written—for example, a Pro VM from 1g/256 pids to 2g/448 pids—the new clamp persists session_slots: 2. The watchdog/startup convergence path uses syncKernelSlotCount(), which only updates slots_per_worker, so the subsequent restart reads five physical slots but still enforces the old two-session limit. Meanwhile, the pool's seatCapOf() uses the increased effectiveSlotCount() and budgets five seats. This leaves the newly available capacity unusable until a full configuration rewrite occurs. Recompute the capped session policy during slot-count convergence as well, while preserving explicit lower overrides.
Useful? React with 👍 / 👎.
The watchdog / ensureRustKernel slot-count convergence only rewrote slots_per_worker. A capacity raise (Pro 1g -> 2g) left session_slots at the old cap, and a shrink left it above the new count so crag-v2 refused to start. syncKernelSlotCount now re-caps crag-v2 session_slots at the new count from the uncapped request (VM pin, else panel default), keeping lower pins; without a request it only lowers.
Problem
On a CRAG v2 slot,
writeKernelConfigsetskernel.jsonsession_slotsfrom the panel / routing default (inference.session_slots, 20). The plan-based slot capacity (#1081–#1083) sizes the kernel'sslots_per_workerlower: Pro 5 (2g), Max 5x 12 (4g). crag-v2 checks the two at startup and refuses to start:So every Pro / Max 5x CRAG slot fails its next start or restart (kernel install, restart, capacity reload,
wrap→cragswitch) and is left stopped withkernel_start_failed.In production (v1.4.112), switching a Pro slot from
wraptocraghit this. The 9 CRAG slots already running survived only because they had started under an older config. Theirkernel.jsonhad been rewritten withsession_slots: 20, so each would have failed on its next restart.Change
In the crag-v2 branch of
writeKernelConfig, capsession_slotsatslots_per_worker:slots_per_workeris the kernel maximum (20), so behaviour is unchanged.slots_per_workeralready matches,sessionPolicyChangedstays false, so no extra idle reload is queued.Tests
CRAG session_slots never exceeds the plan-sized kernel slotsintest/unit/kernel-router.test.mjs. It fails without the change (actual: 20, expected: 5).kernel-router,slot-capacity*,seat-planner,routing-runtime*,slot-engineandcrag-runtime*unit suites: 181/181 pass on currentmain.biome format: clean.Production
Deployed on v1.4.112 as a mounted patch. All 12 CRAG slots keep
session_slotsequal toslots_per_worker(Pro 5, Max 5x 12), and a converted Pro slot starts normally.