GeezerVison is showing github.com — Dev servers an agent leaves running stay alive for days; stop them after a configurable idle time, with a one-click "Turn it back on" in the chat · Issue #35223 · pingdotgg/t3code
Dev servers an agent leaves running stay alive for days; stop them after a configurable idle time, with a one-click "Turn it back on" in the chat #35223DescriptionWhat happened
Agents often start a dev server, report back and end their turn. The server keeps running and waiting for traffic, often for no reason, and a dev server with its file watchers can hold several GB of RAM. With a few parallel threads on a laptop or a small cloud box, a lot of memory goes to servers nobody uses. Today nothing stops them until the thread is settled. Stopping them by hand means remembering Stop in every thread, and getting one back means messaging the agent, which costs a turn just to run one command again.
Diagnosis
T3 already cleans this work up, but on a very long clock:
- Settling or archiving stops the work. Settle and archive detach the thread's provider sessions and so stop its idle background work (
apps/server/src/orchestration-v2/Orchestrator.ts, "Archive and settle stop idle background work"). For Claude, the adapter also kills the CLI's tracked descendant processes.
- Automatic settlement takes 7 days. It happens after 7 days of inactivity by default (
DEFAULT_SIDEBAR_AUTO_SETTLE_AFTER_DAYS = 7, packages/contracts/src/settings.ts), and never for snoozed threads or threads with auto-settle turned off.
stopOnSettle doesn't cover agent-started servers. It exists only for project-action terminals. The docs say commands started through an agent's own shell tools "are managed by the provider" (docs/user/thread-sidebar.md, "Settle finished work").
- So a dev server an agent left behind usually lives for days. It doesn't hold the thread in Working or Waiting ([Bug]: Sidebar hides a finished thread's unseen completion while a background shell it left running is still alive #14872, fix(clients): a dev server left running no longer says the thread is waiting #15114), which is right, but nothing bounds its lifetime either.
Suggested fix
1. Stop un-awaited background work after a configurable idle time. When a thread has had no new chat activity (no message, run or turn item) for the configured time, T3 stops its background work that is not awaited: dev servers and other processes the agent left running. It uses the same path as the composer's Stop button. The thread is not settled, archived or woken.
- Setting: under Settings → General, next to automatic settlement: "Stop idle background processes after [1 hour]". It's one environment setting in the same style as
sidebarAutoSettleAfterDays, with null meaning off (e.g. idleBackgroundWorkStopAfterMinutes). Choices: 15 min, 30 min, 1h, 2h, 4h, 8h, 24h.
- Default: on at 1h, so users opt out. If maintainers prefer, the same setting can ship off first (opt-in), with nothing else in the design changing.
- Waits are never touched. Awaited commands, monitors and subagents are excluded. That only works if
awaited is accurate, which A thread waiting on its own background command shows as done unless the agent marks the wait; T3 could mark obvious waits itself #35214 addresses.
2. Tell the user in the chat, with a button. T3 adds a timeline row:
Stopped bun run dev (Start the dev server) after 1h without activity, to free memory. [Turn it back on]
- Turn it back on runs the same command again in the original working directory and environment, started by T3 itself. The agent isn't involved, and no turn or tokens are spent. Once restarted, the row reads "Running again · Stop".
- The agent's next turn is told that the server was stopped and restarted, the same way it hears about work a restart stopped (
RestartBackgroundNote), so it doesn't assume the old process is still running.
3. Nothing else changes. No new task kinds and no new agent tools: one setting, one timer next to the auto-settle sweep, the existing stop path, and one timeline row with a button.
Why chat activity rather than traffic, and why a short default. Chat activity is something T3 already has and is easy to explain. Measuring traffic per server is hard across platforms, and it's wrong for "opened the preview once and walked away". With a one-click restart, stopping a server you were still using costs a few seconds, so the default can be short. The case where it's wrong: someone uses the server in a browser for over an hour without touching the thread. They click the button, choose a longer time, or turn the setting off.
Open questions:
- Default on (opt-out) or off (opt-in)?
- Should "Turn it back on" start the command as a thread terminal (T3-owned, visible in the drawer, follows terminal rules), or hand it back to the provider's background shell? Restarting faithfully needs the original working directory and environment. The provider reports only the command line, and the agent's shell may have run
cd/export earlier.
- Should pinned threads be exempt by default?
- Should the stop also send a notification, or only add the chat row?
Steps to reproduce
- In any thread, ask the agent: "Start the dev server in the background and tell me the URL." Then leave the thread alone.
- Hours later, the server is still running and holding its memory. The composer shows "Running: …", and the sidebar shows the thread as done.
- It keeps running until you press Stop or the thread is settled or archived. Automatic settlement takes 7 days by default, and never comes for snoozed threads or threads with auto-settle turned off.
Version
0.1.10-nightly.20261112.4564
Environment
Server on Linux x64 (cloud), viewed through the web client. Applies to any provider whose agent can leave a background command running.
Evidence
# apps/server/src/orchestration-v2/Orchestrator.ts
// Archive and settle stop idle background work; serialized commands prevent starts racing detach.
# packages/contracts/src/settings.ts
const DEFAULT_SIDEBAR_AUTO_SETTLE_AFTER_DAYS: SidebarAutoSettleAfterDays = 7;
# docs/user/thread-sidebar.md, "Settle finished work"
A terminal that runs a command, such as a dev server, stays open unless its action has
**Stop this action when the thread settles** enabled ... Commands started through an
agent's own shell tools are managed by the provider.
Related issues
Fix applied or workaround
None. Workaround: press Stop in each thread that left a server running, or settle the thread.
Filed by
claude (claude-opus-5-5) via T3 Code, following the t3 triage playbook Activityjuliusmarminge commented on Nov 12, 2026 Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|