Before submitting#
Area#
apps/server
Steps to reproduce#
- In a Claude thread, have the agent start a server from an ordinary Bash call, not as a background task:
nohup python3 -m http.server 8766 >/dev/null 2>&1 &. Agents often start dev servers this way.
- Settle the thread.
- Check port 8766.
Expected behavior#
Settle stops the server, as the settle comment says: after Settle or archive, a thread "must not keep running background work (PR monitors, dev servers, subagent fleets)".
Actual behavior#
The server keeps running. Settle closes the Claude Code process (query.close in the provider log), but this server was never its child for long: once the Bash call returns, the server is reparented to systemd --user. T3 never showed it as background work, so there was no Waiting strip and no Stop, and T3 doesn't list it under the thread. Its port stays taken until someone finds the PID by hand. The process-diagnostics Kill refuses it, because it is no longer a T3 backend descendant.
T3 doesn't track or signal the provider's process tree or group for Claude; only the Pi, OpenCode and ACP adapters use signalProcessGroup. The orphan does stay in T3's cgroup (app-com.t3tools.T3Code-<pid>.scope on systemd), so membership survives the reparenting.
A possible fix: start each provider session in its own cgroup (for example a child scope) and kill that cgroup on Settle and archive, which also catches processes that detached.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.46-nightly.20261003.2623 (fed41fa)
Environment#
Desktop app on Linux (NixOS, Wayland, niri); Claude Code 2.1.288
Logs or stack traces#
No response
Screenshots, recordings, or supporting files#
No response
Workaround#
No response
Note
Grok responding on behalf of Julius.
Triage#
Thanks @Vantrongs, this is a well-observed one, including the note about the cgroup surviving the reparenting.
Confirmed. Settle does release the Claude session. Once a thread is settled or archived, the live provider session is detached. For Claude, that closes the session scope, and the scope's cleanup only calls
query.close()on the Agent SDK query. Nothing on that path creates or signals a process group.signalProcessGroupis only used by the Pi, OpenCode, and ACP adapters.A
nohup … &from an ordinary Bash call returns right away. The shell exits, and the server is reparented (tosystemd --useron a systemd session) before Settle ever runs, which drops it out of the parent-process tree. Process diagnostics only tracks descendants of the server (select_tracked_pidsin the resource monitor), so Kill can't reach it afterwards. Staying insideapp-com.t3tools.T3Code-*.scopedoesn't put it back in that tree, and the Claude CLI isn't started as a process-group leader, so there's no group to signal either.This is the gap merged #5774 left open. That PR started stopping provider sessions on settle and called out
nohup/setsidas a separate follow-up that would need process-group or cgroup ownership. That follow-up is still open for Claude.Likely fix area#
nohuprepro, since group membership survives reparenting, but it wouldn't catchsetsid.cgroup.killwhen the session scope closes.Either way, containment would apply only to the provider session. T3 terminal panes are a separate resource, and #5774 deliberately leaves a terminal that's running a command (including a dev server) up after settle.
A maintainer will decide on the fix direction.