fix(stream): skip non-object envelopes in onResumeStreamReplay

Matches the existing guard in clearResumeFence. A malformed entry
from the server (version skew, serialization mishap) would otherwise
throw on `envelope._replayed = true` mid-iteration and leave the
fence half-flushed via the finally-block.
This commit is contained in:
Claude 2026-04-15 07:07:24 +00:00
parent 4cc28eabff
commit 1eae0f793a
No known key found for this signature in database

View file

@ -721,6 +721,7 @@
const envelopes = Array.isArray(payload?.envelopes) ? payload.envelopes : [];
try {
for (const envelope of envelopes) {
if (!envelope || typeof envelope !== 'object') continue;
envelope._replayed = true;
await chatEventHandler(envelope);
}