# Helper shutdown behavior proof

Target: [#12513](https://github.com/pingdotgg/t3code/pull/12513).
Tested local head b1e9a5b597bacae65331c73d1dcd760073dc2ea0, Linux Node24.21.0.

The production fix adds one-second forced-kill escalation to ProcessRunner, Claude prompt, Codex exec and Codex mcp list. Private process groups remain enabled.

| Behavior | Exact main | Attached original prototype | Revised head |
| --- | --- | --- | --- |
| Stubborn helper timeout | fails | passes | passes |
| Descendant after wrapper timeout | passes | fails | passes |
| Descendant after wrapper success | passes | fails | passes |
| Graceful backend group shutdown | fails | passes | passes |
| Claude stalled CLI timeout | fails | passes | passes |
| Codex exec interruption | fails | passes | passes |
| Codex mcp list interruption | fails | fails | passes |

Baseline substitutions were temporary and restored byte-for-byte. Exact main was7e7e6d8240858d19d8e72dbcd0f0117e3d0a7f56.
All68 focused tests pass. Scoped lint, formatting, server typecheck and whitespace check pass.
Primary independently reran all7 lifecycle cases at final head:7passed/61skipped.

The integrated graceful-shutdown fixture starts a real Node backend using production ProcessRunner and NodeRuntime signal handling. Its helper installs a SIGTERM-ignoring handler before reporting readiness. Sending SIGTERM to the backend process group must produce both backend exit and helper TCP socket closure inside4-second failure deadlines, within desktop's5-second grace. Success is observed through native events; no sleep or process-table polling establishes success. The test harness escalates only to clean up its own fixture on failure.

The other cases execute real fixture CLI processes. They observe helper/descendant socket closure on timeout, interruption or wrapper success. No secrets, live application data or real provider accounts are used.

Focused command:
pnpm exec vp test run apps/server/src/processRunner.test.ts apps/server/src/textGeneration/ClaudeTextGeneration.test.ts apps/server/src/textGeneration/CodexTextGeneration.test.ts

This is backend behavior proof, with no visual UI change. No screenshot applies. It does not exercise packaged Electron, macOS, Windows/WSL, iOS or Android. Arbitrary backend SIGKILL/crash/OOM cleanup is unchanged from main: private helper groups can survive when finalizers cannot run. Independent supervision is outside this PR.

Tests: GPT-6 Astra/Codex. Implementation: GPT-6.1 Sol/Codex. Primary verification: GPT-6.1 Sol/Codex in T3 Code.
