fix(web,gateway): close P3 re-review#4 findings — sanitize all executor catches; lock pre-start turn boundary (wire turnId deferred)
This commit is contained in:
@@ -1587,7 +1587,14 @@ describe('useChatConnection', () => {
|
||||
expect(fake.emitted.filter((e) => e.event === 'command:approve')).toHaveLength(2);
|
||||
});
|
||||
|
||||
it("does not settle turn B when a duplicate agent:end from already-settled turn A is redelivered after B's own ack but before B's own start", async () => {
|
||||
it("P3-5c: locks the achievable pre-start boundary — turn A settled, turn B sent and acked but before B's own start, a stale/duplicate agent:end from A does not release B (a third send stays blocked), and only B's own start/end sequence legitimately releases it", async () => {
|
||||
// This is the provable boundary: in-order Socket.IO delivery guarantees
|
||||
// a same-conversation agent:end arriving before this turn's own
|
||||
// agent:start can only be a stale straggler. Once a turn is 'active',
|
||||
// AgentEndPayload/ErrorPayload carry no turn identity to further
|
||||
// distinguish a genuine end from a duplicate — that residual is not,
|
||||
// and cannot be, asserted here; full correlation needs a wire turnId
|
||||
// (deferred to P5). See the reducer comments in use-chat-connection.ts.
|
||||
// Turn A completes normally on c1.
|
||||
await act(async () => {
|
||||
fake.serverEmit('message:ack', { conversationId: 'c1', messageId: 'm1' });
|
||||
|
||||
Reference in New Issue
Block a user