groove-dev 0.26.8 → 0.26.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,18 +126,21 @@ export class AgentLoop extends EventEmitter {
126
126
  }
127
127
  this.messages.push(assistantMsg);
128
128
 
129
- // Broadcast text output to GUI
130
- if (content) {
131
- this._writeLog({ type: 'assistant', content: content.slice(0, 2000) });
132
- this.emit('output', { type: 'activity', subtype: 'text', data: content });
133
- }
134
-
135
- // No tool calls → turn complete, go idle
129
+ // No tool calls → turn complete, broadcast final text and go idle
136
130
  if (!toolCalls || toolCalls.length === 0) {
131
+ if (content) {
132
+ this._writeLog({ type: 'assistant', content: content.slice(0, 2000) });
133
+ }
137
134
  this.emit('output', { type: 'result', data: content || 'Turn complete', turns: this.turns });
138
135
  break;
139
136
  }
140
137
 
138
+ // Has tool calls — broadcast text before executing tools (if model sent text + tools)
139
+ if (content) {
140
+ this._writeLog({ type: 'assistant', content: content.slice(0, 2000) });
141
+ this.emit('output', { type: 'activity', subtype: 'text', data: content });
142
+ }
143
+
141
144
  // Execute each tool call
142
145
  for (const call of toolCalls) {
143
146
  if (!this.running) break;