A provider CLI can exit during startup while the turn reports a control-RPC failure or a generic error, hiding the process diagnostic. Reproduced on current main a003b73aa8 against an isolated development server: wrapper CLIs print an EPERM diagnostic and exit 1; Codex shows only its exit code and Claude shows “Provider turn failed.”
References #5943.
The fix retains a bounded stderr tail while draining each CLI, preserves process exit status, and carries typed process errors through the existing sanitized failure formatter. Permission and mode behavior are unchanged.
Validation at a7e642d26c: 222 scoped tests passed across Claude adapter, Codex client/termination, and provider-failure tests; the final Claude fixture rerun passed both cases. Scoped server, Codex package, and provider-core typechecks pass. Formatting passes; lint reports one existing unused-variable warning. Four startup cases failed on the base implementation before the fix. Independent reviews and runtime after evidence are pending.
Evidence: baseline runtime transcript.
| Codex baseline | Claude baseline |
|---|
 |  |
Unverified: macOS desktop TCC trigger (Linux VM); native desktop and mobile clients. Real-data seed failed due to incompatible migration history; reproduction used fresh isolated state and existing-thread retry.
Model: GPT-6.1-Sol. Harness: Codex through T3 Code, with delegated implementation and review steps recorded below when complete.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
efdda5e· PR result:a7e642d· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.