Files
oh-my-pi/packages/coding-agent/test
Slava Zavadsky 326fb24367 fix(coding-agent): chain every queued dispatch onto the current tail
The previous #runSerialized waited on the shared #dispatchTail, then ran
unconditionally: when two or more events queued behind an in-flight run,
each resumed from the same settled await and started its own run in
parallel, defeating the ordering guarantee for a burst landing in one
coalescing window (message_end + agent_end behind a suspended flush).

Each waiter now chains its own link onto the current tail
(tail.then(run, run)), so queued runs start strictly one after another;
the idle path still runs synchronously, preserving the flush timing the
coalescing tests assert on. The in-flight flag clears only when the
settling link is still the tail, so a later chained link's settle does
not clear it early.

Regression test: two message_end events queued behind a suspended window
flush stay serialized (init call count steps 1 -> 2 -> 3 as each gate
opens); fails on the previous implementation.
2026-08-04 17:42:54 -04:00
..
2026-07-27 16:43:53 +02:00
2026-08-02 20:39:23 +02:00
2026-07-27 16:43:53 +02:00
2026-07-27 16:43:53 +02:00
2026-08-02 20:39:23 +02:00
2026-07-27 16:43:53 +02:00
2026-08-02 20:39:23 +02:00
2026-08-02 20:39:23 +02:00
2026-07-01 00:07:30 +00:00
2026-05-30 18:08:51 +02:00
2026-07-27 16:43:53 +02:00
2026-07-30 04:25:32 +02:00
2026-06-24 13:44:47 +00:00