You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Agents often start a dev server (npm run dev, python3 -m http.server, a test server) and leave it running after the turn ends. bb does not show which servers a thread started or on which ports. To open one, the user scrolls the thread output for the port. To stop one, the user finds the process with lsof or ps and kills it by hand. Servers that nobody stops keep their ports and use memory.
Steps to reproduce
Start a Claude Code thread with the prompt: "Run nohup python3 -m http.server 48231 --bind 127.0.0.1 &, then reply done."
Wait for the turn to end.
Look at the thread, and run bb thread show <thread-id>.
Expected: the thread shows that it has a server on port 48231, with a way to open it and a way to stop it. The CLI lists the same.
Actual: nothing in the thread, the CLI, or the SDK shows the server. It runs until someone kills it.
Proposal
List the servers each thread started: processes that listen on a TCP port and that the thread's agent started from its shell. bb sets BB_THREAD_ID in agent shells, so the machine of the thread's environment can attribute each listening process to a thread. Show them above the composer with the ports, an Open action, and a Stop action. Stop ends the server's command and the processes under it, and never the agent, its shell, or bb. Add bb dev-servers list|stop for the CLI.
Related: #3192 asks for a list of listening ports on the in-app browser's new-tab page. #5954 asks bb to clean up processes agents leave behind.
Type: Feature — adds per-thread server discovery and lifecycle controls rather than correcting existing functionality.
Priority: Medium — meaningful workflow and resource-management improvement; manual inspection and termination remain available.
Effort: High — requires process attribution, safe termination, and coordinated UI, CLI, and SDK surfaces.
Labels:host, threads.
No existing classification values were present; all applied values were verified. Reproduction reporting and a fix PR were skipped because the final Type is Feature.
Hi, I'd like a maintainer's sign-off on this feature before #7970 goes up for review. I opened it too early, so I've moved it to draft. Please treat it as a prototype for now.
What #7970 does: a built-in plugin lists the servers a thread's agent started, with their ports, and offers Open and Stop. It finds them through the BB_THREAD_ID variable in agent shells, on Linux and macOS, with no daemon change. CLI: bb processes servers|stop.
I renamed the plugin from dev-servers to processes, because I'd also like to propose per-thread CPU and memory use and port forwarding on top of it. Those would get their own issues first.
Happy to change the approach, or close it if you'd rather solve this another way.
Update: I closed #7970. The prototype stays on my fork: main...lanjak:bb:thread-dev-servers (head 1105f33375). The rename to processes that I mentioned above is not on the branch yet. I'll post an update when it is.
The plugin is renamed to Processes: directory plugins/processes, plugin id bb--processes, package bb-plugin-bb--processes. The CLI is bb processes servers [thread-id] [--json] and bb processes stop <pid> [--thread <thread-id>] [--json]. Per-thread resource use and port forwarding can build on the same plugin later.
Attribution now covers Codex. Codex starts some commands without a shell and marks each with CODEX_TOOL_CALL_ID. A listener with that id is rooted at the highest ancestor with the same id.
On macOS, ps -E shows no environment for processes that rewrite their command line (npm, zsh). On Linux, /proc/<pid>/environ can be empty. Such processes take the thread of their nearest visible ancestor.
A root that the provider bridge started is never used. This covers the agent, its MCP servers, and agents that a package runner (npx) or a shell started. The check skips package runners and wrapper shells between the root and the bridge.
New setting stopOnArchive (default on): archiving or deleting a thread stops its servers, if its machine is online.
The list shows the command of the listening process. The root is only the target of Stop.
macOS results (rufimac, Darwin 27, real ps and lsof)
A real Claude Code thread on the Mac ran nohup npm run serve & and started python3 -m http.server as a background task. The plugin's host code from the branch:
listed both servers under the thread;
did not list the claude process, which carries BB_THREAD_ID;
stopped both servers and closed both ports, after which the orphaned npm exited;
refused to stop the claude pid.
Agent-shaped process trees under the real host daemon gave these results:
npm run serve under a live zsh tool shell is rooted at npm.
An orphaned server is listed.
A Codex-shaped agent's server is listed.
The agent's own port, an npm exec --call child, and an agent launched through npm exec are not listed.
Stop ended only the npm tree and refused both agents.
One difference from Linux: on macOS a nohup npm run serve server whose shell has exited is rooted at python3, not npm, because npm hides its environment. Stop still ends the server, and npm exits after it.
Other checks
Linux QA with a real Codex thread: the server was listed during the turn, Stop closed the port, and codex kept running.
Linux QA with a real Claude Code thread: archiving the thread stopped its nohup server.
pnpm exec turbo run test typecheck lint lint:type-aware --filter=bb-plugin-bb--processes: 48 tests pass.
The server's builtin registry, bb-official generator and plugin install job tests, the CLI skill coverage test, and the plugin-guide first-party test pass.
Activity
bb-slop-cop commentedon Nov 21, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied the missing classification:
host,threads.No existing classification values were present; all applied values were verified. Reproduction reporting and a fix PR were skipped because the final Type is Feature.
lanjak commentedon Nov 21, 2026
Hi, I'd like a maintainer's sign-off on this feature before #7970 goes up for review. I opened it too early, so I've moved it to draft. Please treat it as a prototype for now.
What #7970 does: a built-in plugin lists the servers a thread's agent started, with their ports, and offers Open and Stop. It finds them through the
BB_THREAD_IDvariable in agent shells, on Linux and macOS, with no daemon change. CLI:bb processes servers|stop.I renamed the plugin from dev-servers to processes, because I'd also like to propose per-thread CPU and memory use and port forwarding on top of it. Those would get their own issues first.
Happy to change the approach, or close it if you'd rather solve this another way.
lanjak commentedon Nov 21, 2026
Update: I closed #7970. The prototype stays on my fork: main...lanjak:bb:thread-dev-servers (head
1105f33375). The rename to processes that I mentioned above is not on the branch yet. I'll post an update when it is.lanjak commentedon Nov 21, 2026
Update: the prototype for this issue is on the fork branch, now at 987431f.
Compare: main...lanjak:bb:thread-dev-servers
Changes since the closed PR #7970
plugins/processes, plugin idbb--processes, packagebb-plugin-bb--processes. The CLI isbb processes servers [thread-id] [--json]andbb processes stop <pid> [--thread <thread-id>] [--json]. Per-thread resource use and port forwarding can build on the same plugin later.CODEX_TOOL_CALL_ID. A listener with that id is rooted at the highest ancestor with the same id.ps -Eshows no environment for processes that rewrite their command line (npm,zsh). On Linux,/proc/<pid>/environcan be empty. Such processes take the thread of their nearest visible ancestor.npx) or a shell started. The check skips package runners and wrapper shells between the root and the bridge.stopOnArchive(default on): archiving or deleting a thread stops its servers, if its machine is online.macOS results (rufimac, Darwin 27, real
psandlsof)A real Claude Code thread on the Mac ran
nohup npm run serve &and startedpython3 -m http.serveras a background task. The plugin's host code from the branch:claudeprocess, which carriesBB_THREAD_ID;npmexited;claudepid.Agent-shaped process trees under the real host daemon gave these results:
npm run serveunder a livezshtool shell is rooted atnpm.npm exec --callchild, and an agent launched throughnpm execare not listed.npmtree and refused both agents.One difference from Linux: on macOS a
nohup npm run serveserver whose shell has exited is rooted atpython3, notnpm, becausenpmhides its environment. Stop still ends the server, andnpmexits after it.Other checks
codexkept running.nohupserver.pnpm exec turbo run test typecheck lint lint:type-aware --filter=bb-plugin-bb--processes: 48 tests pass.