mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 04:18:05 +00:00
refactor(cliproxy): check lifecycle events in remaining SSE buffer
Add message_start/message_delta/message_stop detection to the remaining-buffer block in the SSE processing path for defensive completeness. Addresses code review feedback on PR #493.
This commit is contained in:
@@ -535,6 +535,15 @@ export class ToolSanitizationProxy {
|
||||
if (buffer.includes('"content_block_start"')) {
|
||||
hasReceivedContent = true;
|
||||
}
|
||||
if (buffer.includes('"message_start"')) {
|
||||
hasReceivedMessageStart = true;
|
||||
}
|
||||
if (buffer.includes('"message_delta"')) {
|
||||
hasReceivedMessageDelta = true;
|
||||
}
|
||||
if (buffer.includes('"message_stop"')) {
|
||||
hasReceivedMessageStop = true;
|
||||
}
|
||||
const processedEvent = this.processSSEEvent(buffer, mapper);
|
||||
clientRes.write(processedEvent + '\n\n');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user