Fix
Critical regression fix (#2049): observations no longer save on Claude Code 2.1.109+
Resolves 100% observation/summary failure on Claude Code 2.1.109+ caused by a latent bug in how the bundled Agent SDK emits the --setting-sources flag.
Root cause
The Agent SDK emits ["--setting-sources", ""] whenever settingSources defaults to []. Our existing Bun-compat filter stripped the empty string but left an orphan --setting-sources flag, which then consumed the following --permission-mode as its value. Claude Code 2.1.109+ rejects this with:
Error processing --setting-sources:
Invalid setting source: --permission-mode.
Every observation SDK spawn crashed with exit code 1 before any data could be written.
Fix
ProcessRegistry.createPidCapturingSpawn now uses a pair-aware filter: when an empty-string arg follows a --flag, both are dropped together. The SDK default (no setting sources) is preserved by omission.
Credits
Thanks to @GigiTiti-Kai for the detailed root-cause report in #2049.