Repository navigation
Replies: 1 comment
|
Note 🤖 Claude Opus 5.5 responding on behalf of Guria
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Note
Drafted with Claude Code on behalf of @Jamaalx; I reviewed it and the numbers come from my server.
Before submitting
Area
apps/server (scheduled tasks,
process/agentScope.ts)Problem or use case
I run about 40 recurring unattended Claude jobs (security, dependency and DB audits, a morning digest) on a 125 GB Linux server that also hosts production apps and databases. Today they run from cron through a small wrapper around
claude -p. I'd like to move them into T3 scheduled tasks so every run is a thread I can read and continue, but the wrapper does four things a scheduled task can't express yet:python3grew to 72 GB and froze the server, including SSH and Tailscale, for 23 minutes. The wrapper now runs each job in its ownsystemd-run --scope -p MemoryMax=12G. T3 already puts agents inapp-t3code-agents.slice, but that limit is shared by all agents and set to total RAM minus 4 GB (about 121 GB here), so a single runaway agent can still take everything the production services need.The right limit depends on the job. A quick health check should be capped tightly; a quarterly audit on a quiet night should not be capped at all. A single service-wide limit can't express that.
Proposed solution
Optional, per-task settings, all off by default so current behaviour is unchanged:
memoryMax(and possiblymemoryHigh): on Linux, run the task's agent in its own scope under the existing agents slice with these values. The slice-wide limit stays as the outer bound.timeout: stop the run after this duration and record it astimed_outinlast_run_status.concurrencyGroup: runs in the same group wait for each other (or are skipped, configurable).minFreeMemory: skip the run, with a clear status, when available memory is below this.The same fields could be set per thread when a thread is started from the CLI (
t3 thread start --memory-max 12G --timeout 40m), which would also cover scripts that hand their output to an agent.Why this matters
Unattended agents on shared or production machines are the case where a runaway process does the most damage and nobody is watching. Per-task limits let people move those jobs into T3 instead of keeping a parallel cron setup, and they fit the reliability work already done in
agentScope.ts(#20329, #24048).Alternatives considered
t3 thread start --wait: the agent then runs inside the T3 server's slice, so the wrapper'sMemoryMaxandtimeoutno longer apply to it. Killing the waiting CLI doesn't stop the agent.claude -pfrom cron: works, but the runs never show up in T3.Related: #31997 (scheduled tasks as files in the repo) — these fields would belong in that config too.
If the direction is acceptable, I'm happy to implement the Linux part (scope per task, timeout, concurrency group) in a focused PR.
All reactions