Repository navigation
Replies: 1 comment
|
Follow-up with measured evidence from the same machine, taken today after our earlier reports — it strengthens the case for release-on-completion (#31466, #29868) and for a cap (#33413's proposal):
Why this matters for the open PRs: #31466 (release a finished delegated child's session at once) would have removed roughly two-thirds of delegate residency on this machine today — at the peak it would have cut 37 sessions to about 17 (~8.5 GiB). A configurable timeout (#25624) helps only by shortening the same window; a cap bounds the remainder. Interim measure on our side (no product change): we're building a small Foreman sweeper that settles delegated children a few minutes after their result is delivered, as local behaviour until the upstream fixes land. Happy to adjust the cap proposal in light of any direction maintainers prefer. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
We'd like to propose an optional, opt-in limit on how many provider sessions (for example
claudeprocesses and their MCP servers) can be live at once in one T3 environment. When the limit is reached, the oldest session that has no turn in progress would be released first. If every session is mid-turn, T3 would start the new session anyway rather than block (fail open).This is meant to work alongside the open work on idle timeouts and releasing sessions when a task finishes, which we support (see "Support for related open work" below). It covers a case those changes can't: threads that stay busy enough never to reach an idle timeout.
Per CONTRIBUTING, we're posting this as an Ideas discussion. We're asking for maintainer direction and scope before anyone opens a PR.
Problem: what one operator saw in production
We run T3 nightly on a 16 GB Windows laptop and use
delegate_taskheavily. Our own host memory monitor raised a critical low-RAM alert twice in three days. The monitor only observes, so nothing was killed. These figures come from one machine. They're not a benchmark.9 Nov 2026 (main incident)
Available memory fell to 1.18 GiB of 15.41 GiB (92% memory load). Commit charge was only 41%, so the trigger was physical memory, not commit.
claude.execount and total private bytes, every one a child of one nightlyt3.exe(started 04:12):claude.exeprocessesThat works out to about 0.44–0.46 GiB per
claude.exe, and the figure stayed steady as the count grew.The three oldest
claude.exeprocesses had started between 04:12 and 04:20, so they were about five hours old by the last snapshot. Newclaude.exeprocesses kept appearing from 07:11 to 09:23.Between the first and last snapshots, system-wide processes went 443 → 564, handles 154k → 176k and threads 4,949 → 5,540.
7 Nov 2026 (milder, same pattern)
claude.exeprocesses, 3.75 GiB private bytes. The process tree and growth looked the same, just smaller.Caveat: we count
claude.exeprocesses. We haven't mapped each process to a T3 thread or session, and we haven't split them into finished delegate children, parents and long-running threads. With the default 30-minute idle timeout, processes that are about five hours old must have had a turn at least every 30 minutes, or must still be held for some reason we haven't found.Why the existing levers aren't enough
#26413 diagnoses the root cause:
ProviderSessionManageruses a fixedDEFAULT_IDLE_TIMEOUT_MSof 30 minutes, no caller passesidleTimeoutMs, and "there is no cap on how many idle sessions may stay live". Sessions are otherwise released only on settle or detach.The proposals so far address part of this:
What's missing is a limit on the number of live sessions. Each live session costs a roughly fixed amount of RAM, about 0.44 GiB on our machine, so a count limit is the only one of these levers that limits worst-case memory directly.
Proposal (a starting point for maintainers)
Open questions we'd defer to maintainers:
Justification
claude.exeprocesses in under two hours, with three processes about five hours old. A timeout alone never stops that kind of growth.Support for related open work
We support all four of these. Merging them would cut our session count before a cap ever needed to act:
delegate_taskClaude sessions keep the process and MCP servers for 30 minutes): its diagnosis matches what we saw, including the point that nothing limits how many idle sessions stay live. 👍delegate_task. 👍Environment
t3.exe) on Windows 11 Pro for Workstations (build 26200)claude.exe) with MCP servers; heavydelegate_taskuse, with long-running coordinator threads plus delegated childrenRequested next step
Following CONTRIBUTING, we're asking whether maintainers would accept this direction and scope: the cap, how eviction works, and what happens when no session is idle. If so, a PR would link to that approval. We haven't opened one yet.
All reactions