Tomu Hirata
d20c465457
fix(codex): serialize stdin writes to prevent parallel tool-call interleaving ( #5229 )
...
When Codex emits parallel tool calls, the harness processes them
sequentially but _send_message's write+drain sequence is not atomic:
a concurrent caller can write() between another caller's write() and
drain(), interleaving bytes on the subprocess stdin pipe. The Codex
app-server then reads a corrupted JSON-RPC line, drops the response,
and the remaining tool outputs never arrive — causing the turn to stall
for minutes before timing out.
Fix: guard _send_message with an asyncio.Lock (_stdin_lock) so that
the write/drain pair is always atomic. The lock is initialized in
__init__ alongside the other per-session state.
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com >
2026-08-21 22:24:09 +00:00
..
2026-08-03 20:03:46 +07:00
2026-08-06 17:53:04 -07:00
2026-07-31 15:02:20 +00:00
2026-06-23 18:56:15 +09:00
2026-06-13 00:37:34 +00:00
2026-07-31 17:07:26 +00:00
2026-08-07 21:56:04 +00:00
2026-08-04 13:49:59 +00:00
2026-06-13 00:37:34 +00:00
2026-06-13 00:37:34 +00:00
2026-08-20 15:37:02 +00:00
2026-08-20 15:37:02 +00:00
2026-08-17 01:23:12 +00:00
2026-08-13 18:00:38 -07:00
2026-08-01 01:57:14 +08:00
2026-08-10 17:37:16 +00:00
2026-06-24 19:53:32 +00:00
2026-06-13 00:37:34 +00:00
2026-06-16 10:10:01 -07:00
2026-08-12 09:22:28 +00:00
2026-08-07 21:56:04 +00:00
2026-06-13 00:37:34 +00:00
2026-08-20 12:01:47 +07:00
2026-06-13 00:37:34 +00:00
2026-08-18 04:32:05 +00:00
2026-08-12 09:22:28 +00:00
2026-08-21 22:24:09 +00:00
2026-08-01 10:46:25 +00:00
2026-08-12 09:22:28 +00:00
2026-08-21 20:52:14 +00:00
2026-06-13 00:37:34 +00:00
2026-08-10 10:14:58 -07:00
2026-08-10 10:14:58 -07:00
2026-07-31 16:32:09 +00:00
2026-08-02 08:55:13 +00:00
2026-07-13 11:40:28 -07:00
2026-08-10 17:37:16 +00:00
2026-06-18 21:57:31 +08:00
2026-07-29 15:08:43 +00:00
2026-08-06 17:53:04 -07:00
2026-08-12 09:22:28 +00:00
2026-08-13 06:33:35 +00:00
2026-08-10 17:37:16 +00:00
2026-07-20 15:20:38 -07:00
2026-08-10 17:37:16 +00:00
2026-06-23 16:21:04 -07:00
2026-07-30 06:29:36 +00:00
2026-07-20 15:20:38 -07:00
2026-08-10 17:37:16 +00:00
2026-06-25 15:24:39 +00:00
2026-07-29 15:08:43 +00:00
2026-08-01 11:51:38 +00:00
2026-07-20 15:20:38 -07:00
2026-08-10 17:37:16 +00:00
2026-06-25 02:01:57 +00:00
2026-08-10 17:37:16 +00:00
2026-06-25 00:55:25 +00:00
2026-08-06 21:01:30 +09:00
2026-06-16 13:59:54 -07:00
2026-07-31 07:31:03 +00:00
2026-08-02 08:55:13 +00:00
2026-08-20 14:57:57 -07:00
2026-08-20 14:57:57 -07:00
2026-07-31 04:53:51 +00:00
2026-06-23 19:04:37 -07:00
2026-08-10 14:58:07 -07:00
2026-08-18 04:32:05 +00:00
2026-08-12 09:22:28 +00:00
2026-08-01 11:04:24 +00:00
2026-06-15 19:08:37 -07:00
2026-07-31 17:37:06 +00:00
2026-08-03 14:01:19 +00:00
2026-08-10 17:37:16 +00:00
2026-07-20 15:20:38 -07:00
2026-08-10 17:37:16 +00:00
2026-06-24 21:38:03 +08:00
2026-08-10 14:58:07 -07:00
2026-07-31 09:32:32 -07:00
2026-08-20 17:30:55 -07:00
2026-08-13 18:00:38 -07:00
2026-07-31 14:09:11 +00:00
2026-08-01 09:22:04 +00:00
2026-07-31 15:44:18 +00:00
2026-06-17 14:17:42 -07:00