Claude background agents can still be killed by idle cleanup after four hours without provider progress: the session manager releases the process even while the adapter reports pending work. Keep the session pinned while that work would die with its process; release it normally after the work finishes. Background work that can outlive its process keeps the existing cap.
Refs #29319. This addresses the reproducible four-hour silent-pin expiry only. The maintainer's short real-Claude reproductions did not fail, and this does not establish the cause of the report's other restarts or change compaction, manual Stop, or update/shutdown behavior. It qualifies as the small, focused bug-fix exception: an idle cleanup was terminating explicitly reported live work.
Verification on Linux:
- Added a parameterized regression to the existing session-manager fixture. With the original condition, the process-bound case fails after five simulated hours (
expected live=true, got false); the case where work survives its process passes.
vp test run apps/server/src/orchestration-v2/ProviderSessionManager.test.ts: 50 tests pass. The regression also verifies eventual release and roster cleanup once pending work ends, and preserves the other session's roster.
vp run check:changed upstream/main: format, lint, both knip passes, GraphQL generation, typechecks for three affected packages, and 51 tests across two files pass.
Service-runtime transcript (fixture provider and Effect TestClock, not a five-hour real Claude session; temporary diagnostics removed):
original: processBound=true +5h pending=true live=false closeCount=1
fixed: processBound=true +5h pending=true live=true closeCount=0
fixed: processBound=true +5.5h pending=false live=false closeCount=1
fixed: processBound=false +5h pending=true live=false closeCount=1
Trade-off: this replaces forced release of live process-bound work with an indefinite pin if the provider's background roster leaks. Stop or server shutdown can still release it. No client or wire changes; the shared server path covers web, desktop, mobile, and remote connections.
Reviewed with review-loop: 1 round with Claude Opus 5.5. Reviewer verdict: approved.
Created with GPT-6.1 Sol in the Codex harness.