MCPcopy Create free account
hub / github.com/Roy3838/Observer / onStreamChunk

Function onStreamChunk

app/src/utils/main_loop.ts:325–335  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

323 // Streaming callback that logs chunks - Logger dispatches events automatically
324 let isFirstChunk = true;
325 const onStreamChunk = (chunk: string) => {
326 try {
327 if (isFirstChunk) {
328 Logger.debug(agentId, 'Stream started', { logType: 'stream-start', iterationId });
329 isFirstChunk = false;
330 }
331 Logger.debug(agentId, 'Stream chunk', { logType: 'stream-chunk', iterationId, content: { chunk } });
332 } catch (error) {
333 Logger.debug(agentId, `Failed to log streaming event: ${error}`, { iterationId });
334 }
335 };
336
337 const onReasoningChunk = (chunk: string) => {
338 try {

Callers 1

consumeFunction · 0.85

Calls 1

debugMethod · 0.45

Tested by

no test coverage detected