Files
Mathias Fredriksson 2a48c8721e fix: stop treating pending chat notification as cancel signal
Stale "pending" pubsub notifications from SendMessage can arrive at the
worker control subscriber after close(controlArmed), causing a spurious
ErrInterrupted that aborts the LLM call before the assistant message is
committed.

Remove ChatStatusPending from the cancel-trigger set in
shouldCancelChatFromControlNotification. A "pending" notification
reaching an active worker is always a stale echo: SendMessage (trigger),
EditMessage (handled by persistStep ownership guard), or auto-promote
(runs after processing). None warrant canceling the active run.

Unskip TestSubscribeRelayEstablishedMidStream (CODAGT-353). The only
stale notification that could cancel this test was "pending" from
SendMessage, which the fix now ignores. Verified with a deterministic
red/green/revert cycle using delayedPendingPubsub: 5/5 FAIL without
fix (chat interrupted / Condition never satisfied), 5/5 PASS with fix,
5/5 FAIL on revert.

Fixes CODAGT-383.
Refs CODAGT-179, CODAGT-353.
2026-06-01 18:56:53 +00:00
..