Commit 8614b96
fix: skip blank/whitespace-only lines in receive loop
`_receive_loop` only checked for EOF (`b""`), but blank lines like
`b"\n"`, `b" \n"`, or `b"\r\n"` are truthy and fell through to
`json.loads()`, causing `JSONDecodeError: Expecting value: line 1
column 2 (char 1)`. This is common on WSL where Windows-native agent
subprocesses emit `\r\n` blanks, or any CLI that prints empty lines to
stdout alongside JSON-RPC frames.
Strip each line and skip it when empty before attempting JSON parse.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0133bc4 commit 8614b96
2 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
285 | 303 | | |
286 | 304 | | |
287 | 305 | | |
| |||
0 commit comments