tuna-agent 0.1.81 → 0.1.82

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.
@@ -185,6 +185,7 @@ export class ClaudeCodeAdapter {
185
185
  let firstChunkIso = '';
186
186
  let turnAccumulatedText = '';
187
187
  let messageCount = 0; // Track message_start events to detect new turns
188
+ let lastSentContent = ''; // Dedup: skip sending same message twice
188
189
  console.log(`[ClaudeCode] Agent Team round ${round + 1}: ${userMessage.substring(0, 80)}${currentInputFiles?.length ? ` (+${currentInputFiles.length} images)` : ''}`);
189
190
  const defaultWorkspace = path.join(os.homedir(), 'tuna-workspace');
190
191
  const cwd = task.repoPath || defaultWorkspace;
@@ -231,11 +232,18 @@ export class ClaudeCodeAdapter {
231
232
  if (messageCount > 1 && turnAccumulatedText.trim()) {
232
233
  console.log(`[ClaudeCode] ✂️ Splitting bubble — finalizing ${turnAccumulatedText.length} chars from previous turn`);
233
234
  ws.sendPMStreamEnd(task.id, streamMsgId);
234
- ws.sendPMMessage(task.id, {
235
- sender: 'pm',
236
- content: simplifyMarkdown(turnAccumulatedText),
237
- startedAt: firstChunkIso || undefined,
238
- });
235
+ const simplified = simplifyMarkdown(turnAccumulatedText);
236
+ if (simplified !== lastSentContent) {
237
+ ws.sendPMMessage(task.id, {
238
+ sender: 'pm',
239
+ content: simplified,
240
+ startedAt: firstChunkIso || undefined,
241
+ });
242
+ lastSentContent = simplified;
243
+ }
244
+ else {
245
+ console.log(`[ClaudeCode] ⏭️ Skipping duplicate message (${simplified.length} chars)`);
246
+ }
239
247
  turnAccumulatedText = '';
240
248
  firstChunkIso = '';
241
249
  streamMsgId = `team-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
@@ -327,13 +335,20 @@ export class ClaudeCodeAdapter {
327
335
  if (lastTaskOutput) {
328
336
  console.log(`[Reflection] Captured ${lastTaskOutput.length} chars of task output for reflection`);
329
337
  }
330
- // Send finalized message for the last turn's remaining text
338
+ // Send finalized message for the last turn's remaining text (skip if duplicate)
331
339
  if (turnAccumulatedText.trim()) {
332
- ws.sendPMMessage(task.id, {
333
- sender: 'pm',
334
- content: simplifyMarkdown(turnAccumulatedText),
335
- startedAt: firstChunkIso || undefined,
336
- });
340
+ const simplified = simplifyMarkdown(turnAccumulatedText);
341
+ if (simplified !== lastSentContent) {
342
+ ws.sendPMMessage(task.id, {
343
+ sender: 'pm',
344
+ content: simplified,
345
+ startedAt: firstChunkIso || undefined,
346
+ });
347
+ lastSentContent = simplified;
348
+ }
349
+ else {
350
+ console.log(`[ClaudeCode] ⏭️ Skipping duplicate final message (${simplified.length} chars)`);
351
+ }
337
352
  }
338
353
  // Last round → close
339
354
  if (round === MAX_ROUNDS - 1)
package/dist/cli/index.js CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.81",
3
+ "version": "0.1.82",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"