tuna-agent 0.1.83 → 0.1.84

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.
@@ -244,20 +244,23 @@ export class ClaudeCodeAdapter {
244
244
  if (event?.type === 'message_start') {
245
245
  messageCount++;
246
246
  console.log(`[ClaudeCode] message_start #${messageCount}, accumulated=${turnAccumulatedText.length} chars`);
247
- if (messageCount > 1 && turnAccumulatedText.trim()) {
248
- console.log(`[ClaudeCode] ✂️ Splitting bubble finalizing ${turnAccumulatedText.length} chars from previous turn`);
247
+ if (messageCount > 1) {
248
+ // Always clear streaming bubble on new turn (prevents cross-turn accumulation)
249
249
  ws.sendPMStreamEnd(task.id, streamMsgId);
250
- const simplified = simplifyMarkdown(turnAccumulatedText);
251
- if (!isSimilar(simplified, lastSentContent)) {
252
- ws.sendPMMessage(task.id, {
253
- sender: 'pm',
254
- content: simplified,
255
- startedAt: firstChunkIso || undefined,
256
- });
257
- lastSentContent = simplified;
258
- }
259
- else {
260
- console.log(`[ClaudeCode] ⏭️ Skipping duplicate message (${simplified.length} chars)`);
250
+ if (turnAccumulatedText.trim()) {
251
+ console.log(`[ClaudeCode] ✂️ Splitting bubble — finalizing ${turnAccumulatedText.length} chars from previous turn`);
252
+ const simplified = simplifyMarkdown(turnAccumulatedText);
253
+ if (!isSimilar(simplified, lastSentContent)) {
254
+ ws.sendPMMessage(task.id, {
255
+ sender: 'pm',
256
+ content: simplified,
257
+ startedAt: firstChunkIso || undefined,
258
+ });
259
+ lastSentContent = simplified;
260
+ }
261
+ else {
262
+ console.log(`[ClaudeCode] ⏭️ Skipping duplicate message (${simplified.length} chars)`);
263
+ }
261
264
  }
262
265
  turnAccumulatedText = '';
263
266
  firstChunkIso = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"