Files
oh-my-pi/packages
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-08-04 05:53:35 +02:00
2026-07-31 20:56:49 +02:00
2026-08-04 05:53:35 +02:00
2026-08-04 05:53:35 +02:00
2026-08-04 05:53:35 +02:00
2026-08-04 05:53:35 +02:00
2026-08-04 05:53:35 +02:00
2026-08-04 05:53:35 +02:00
2026-08-04 05:53:35 +02:00
2026-08-04 05:53:35 +02:00