Repository navigation
Replies: 8 comments 2 replies
|
+1 to a queue with a visible "Waiting for capacity" state. One suggestion on the admission rule: gate on measured machine load, not on a count of active threads. Why not a thread countA count gets it wrong in both directions:
What overloads a machine is what admitted threads do, and that changes over a thread's life. A cap also risks a deadlock if a parent waiting on its child holds one of the slots the child needs. What to measure insteadPer machine, sampled every few seconds and smoothed over about a minute:
The current balancer sample has CPU and memory but not load, pressure or disk; adding those would help both auto placement and admission. Rules that kept it safe in our design
Admission alone doesn't stop threads that were admitted while the machine was quiet and later all start heavy work at once. For that, a machine-wide lease that installs, builds and test suites take (one or two at a time) is the complement to admission. RolloutAn observe-only mode first: compute the verdict and log every moment it would have held, without changing behaviour. A week of that tells you whether the thresholds match the moments the machine actually felt slow, before anything is enforced. On the open question about #33413: we'd keep a session cap and load-based admission as separate settings. A session cap bounds memory held by idle provider processes; admission bounds work starting. Neither substitutes for the other. |
|
+1. Data from a real two-machine setup, where this caused the overload rather than being a hypothetical. I have a desktop and a smaller Linux box linked, with Auto balance on and the desktop clearly the stronger machine. The Linux box still ended up running nearly everything. Breakdown of the threads its server created over one week, from
So about 90% of the threads never went through load balancing. The chain was:
The Linux box then hit memory pressure, and systemd-oomd killed nine agent sessions in 45 minutes (details in #37876). Meanwhile the desktop did very little. Two points for the open questions:
Investigated with Claude Code (Opus 5.5). |
|
Would love some solution for this, I've had my machines be unreachable from T3 Code due to load being too high. So they are stuck on // viell |
|
+1. My use case is close to this one, with one difference: the batch comes from me through the composer, not from an agent. I want to be able to schedule a few threads from the composer in the evening and have them ready by the next morning without overloading my machine on launch. |
|
Note Drafted by Claude (Fable 5.2) in T3 Code from this machine's logs. Reviewed and posted by me. +1. Here is a data point from a setup with only one machine. There was no second machine to balance onto, so only admission control would have helped. Setup. T3 Code 0.1.9 desktop on a MacBook Air (M5, 10 cores, 24 GB). One orchestrating thread started five What happened (18 Nov, local time)
What this adds to the proposal
The overload came from my own workloads, not from a T3 Code bug. I have a redacted extract of the server spans and event-loop stalls for the period, and I can share it if it helps. |
|
As your agent-created-threads / user-created-threads ratio rises, and how often your threads are talking to each other rises, this becomes more & more important. |
|
For your build/Lighthouse batch, WorkLedger can separate the audit jobs from your interactive threads. We build it at Digital Disruptors: queue Claude Code or Codex work items on our managed workers or runners in your infrastructure. A runner claims queued work within its configured capacity, and the task keeps the run state and recorded results. This is a separate worker workflow, rather than a change to T3’s launch tools. We can try one repository audit on a runner configured for your test environment in a free guided pilot: |
|
Note Drafted by Claude (Opus 5.5) in T3 Code from this machine's logs. Reviewed and posted by me. +1. Another data point from a single machine, where only admission control would have helped. Setup: One workflow started 8 Claude agents at once, each working on a different repository's PR. Two of them ran vitest at the same moment. Vitest defaults to one worker per CPU minus one, so each suite started 7 workers of about 360 MB. At the OOM, 11 This fits the point above about load-based admission. The 8 agents alone fit in about 2 GB; the two test suites running at once didn't. Admitting on measured memory, or a per-environment cap on running delegate and workflow agents (#40929), would have run the two test suites one after the other. For now I set |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When an agent starts many threads at once, such as one per repository, T3 has no way to queue them and start each on whichever linked machine has room. Every launch starts at once on the calling machine or on a machine named explicitly. I'm proposing an opt-in placement queue for agent-launched threads, building on the
"auto"placement discussed in #27530.Use case
A reusable agent skill fans out about 15 threads, one per repository. Each thread installs dependencies, makes a production build, and runs headless Chrome (Lighthouse audits), then opens a PR. That's CPU- and RAM-heavy, and all 15 don't need to run at the same moment.
Today the orchestrating agent can call
t3_thread_launchorcreate_threads, but:chooseLoadBalancedEnvironment(packages/client-runtime) is used byapps/webonly. The MCP launch tools take an explicitenvironmentIdor default to the caller's machine.Workarounds: the skill can list environments and round-robin by count, but that ignores real load and can't wait for capacity. Or a human pastes 15 prompts into 15 composer drafts just to get Auto balance.
Proposal
"auto"placement on launch tools. AcceptenvironmentId: "auto"ont3_thread_launch,create_threads, anddelegate_task, using the existing score and skip rules. Candidates must have the project and a ready provider, as [Feature]: Load-balance scheduled task runs and delegated tasks, and cap how many run at once #27530 proposes for v1.maxActiveAgentThreads. A launch that finds no machine under its limit, or every machine skipped by the balancer (CPU ≥ 95%, memory ≤ 5%), is created as a thread in a queued state rather than started:status: "queued", so the orchestrator can end its turn instead of holding one open to wait.clientRequestIdkeeps retries idempotent. An optionalmaxQueueMinutesgives up on stale entries.Open questions
Related
#27530 (auto placement for delegated and scheduled runs), #33413 (per-environment session cap), #31048 (no-project threads skip load balancing), #24048 (desktop hangs from uncapped agent children).
Environment: T3 Code v0.1.8, Linux, Claude provider.
All reactions