Skip to content

senior-dev: SENIOR_DEV_KEEP_SHELL_PROCESSES=1 leaves the run's processes running - #2950

Open
santoshkumarradha wants to merge 2 commits into
devfrom
santosh/seniordev-keep-shell-processes
Open

santoshkumarradha wants to merge 2 commits into
devfrom
santosh/seniordev-keep-shell-processes

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What changes

senior-dev stops every process its run started when the run ends. That covers its bash tool's background jobs and the descendants found by the subreaper and marker sweeps. When a request asks for a service to be left running, such as a web server, a package index or a git server, the service is gone by the time anyone uses it (#2901).

SENIOR_DEV_KEEP_SHELL_PROCESSES=1 leaves those processes running: CloseShellProcesses and CleanupDescendants return without killing. The default behavior is unchanged.

Validation

  • New tests:
    • TestBackgroundBashOutlivesTheRunWhenTheRunKeepsShellProcesses: a background bash job survives CloseShellProcesses.
    • TestCleanupDescendantsLeavesProcessesWhenTheRunKeepsThem: an orphaned descendant survives CleanupDescendants.
    • Both fail with the change removed, and pass with it.
  • Package tests: go test ./internal/processgroup/ ./internal/seniordev/tool/ passes, and go vet is clean.
  • Terminal-Bench 2.1 (87 tasks × 3 attempts, DeepSeek-V4.1-Flash):
    • Without the setting, every task graded on a service the agent leaves running scored 0: git-multibranch, nginx-request-logging, pypi-server, mailman, kv-store-grpc, hf-model-inference, configure-git-webserver.
    • With it, those tasks pass.

Limitations

The setting is opt-in and covers the whole run. A later change could keep only the processes the request asks to keep running. Until then, #2901 stays open.

Refs #2901

🤖 Generated with Claude Code

santoshkumarradha and others added 2 commits November 25, 2026 18:12
…ses running

By default senior-dev stops every process its run started: background
jobs of its bash tool, and descendants found by the subreaper and marker
sweeps. A request that asks for a service to be left running (a web
server, a package index, a git server) therefore ends with the service
gone (#2901).

With SENIOR_DEV_KEEP_SHELL_PROCESSES=1, CloseShellProcesses and
CleanupDescendants leave those processes running. The default is
unchanged.

Tests: a background bash job and an orphaned descendant both survive the
end of a run with the setting on; both fail without the change.

Refs #2901

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant