Skip to content

Commit 7ad8bda

Browse files
author
Tulga Tsogtgerel
committed
feat: add streaming logs for tool usage
Add onSessionUpdate callback to stream tool execution in real-time. This provides visibility into what Auggie is doing during execution. Logs include: - 🔧 When a tool starts executing (with input parameters) - ✅ When a tool completes (with output, truncated if long) - Real-time progress updates during long-running operations Benefits: - Users can see what's happening in the workflow logs - Easier to debug when things go wrong - Better transparency into Auggie's actions - Helps understand which tools are being used Inspired by examples/dev.ts in the Auggie SDK.
1 parent 0484fd3 commit 7ad8bda

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

assistant/src/index.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,44 @@ After making the changes, provide a brief summary of what you implemented.`;
314314
allowIndexing: true,
315315
});
316316

317+
// Set up streaming to log tool usage and progress
318+
let currentToolName = '';
319+
auggie.onSessionUpdate(event => {
320+
switch (event.update.sessionUpdate) {
321+
case 'agent_message_chunk':
322+
// Stream agent text responses (optional - can be verbose)
323+
// if (event.update.content.type === 'text') {
324+
// core.info(event.update.content.text);
325+
// }
326+
break;
327+
328+
case 'tool_call':
329+
// Log when a tool starts executing
330+
currentToolName = event.update.title || 'unknown tool';
331+
core.info(`🔧 Tool: ${currentToolName}`);
332+
if (event.update.rawInput) {
333+
core.info(` Input: ${JSON.stringify(event.update.rawInput)}`);
334+
}
335+
break;
336+
337+
case 'tool_call_update':
338+
// Log when a tool finishes executing
339+
core.info(`✅ Tool completed: ${currentToolName}`);
340+
if (event.update.rawOutput) {
341+
const output = JSON.stringify(event.update.rawOutput);
342+
// Truncate long outputs
343+
const truncated = output.length > 200 ? `${output.substring(0, 200)}...` : output;
344+
core.info(` Output: ${truncated}`);
345+
}
346+
break;
347+
348+
default:
349+
// Log other session updates for debugging
350+
// core.debug(`Session update: ${event.update.sessionUpdate}`);
351+
break;
352+
}
353+
});
354+
317355
// Send the instruction to Auggie
318356
core.info('💬 Sending instruction to Auggie...');
319357
const response = await auggie.prompt(instruction, { isAnswerOnly: true });

0 commit comments

Comments
 (0)