Commit f0e49c2
fix(copilot): clear O_NONBLOCK on subprocess pipes to prevent BlockingIOError
Large JSON-RPC messages (e.g., prompts with many gathered articles)
can exceed the OS pipe buffer. When the asyncio event loop sets
O_NONBLOCK on inherited file descriptors, writes raise BlockingIOError
instead of blocking until the reader drains the pipe. This adds a
post-start fixup that clears O_NONBLOCK on stdin/stdout of the Copilot
CLI subprocess, since the SDK already runs writes in a thread-pool
executor where blocking is safe and correct.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 930a057 commit f0e49c2
1 file changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1373 | 1373 | | |
1374 | 1374 | | |
1375 | 1375 | | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
1376 | 1409 | | |
1377 | 1410 | | |
1378 | 1411 | | |
| |||
0 commit comments