Commit 592ae3a
fix(transport): isolate stderr callback failures, continue reading
`SubprocessCLITransport._handle_stderr` wrapped the entire ``async for``
loop in a single ``except Exception: pass``, so a raise from the
user-provided ``options.stderr`` callback was caught at the outer level
— the loop terminated and no further stderr lines were delivered for
the rest of the session. The failure was silent: no log, no traceback.
A reproducer at the regression test confirms a callback that raises on
the first line previously dropped lines 2 and 3; with the fix all three
lines are delivered.
Move the ``try/except`` inside the loop and log at debug level so a
buggy callback fails per-line but doesn't disable stderr piping. Also
log (instead of silently swallow) at the outer level so a stream-read
failure is at least visible at debug level.
Closes #929
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 9aafd84 commit 592ae3a
2 files changed
Lines changed: 43 additions & 3 deletions
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
530 | 533 | | |
531 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
532 | 540 | | |
533 | 541 | | |
534 | 542 | | |
535 | | - | |
| 543 | + | |
536 | 544 | | |
537 | 545 | | |
538 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
2071 | 2072 | | |
2072 | 2073 | | |
2073 | 2074 | | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
2074 | 2106 | | |
2075 | 2107 | | |
2076 | 2108 | | |
| |||
0 commit comments