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
|
|
248
|
-
|
|
247
|
+
if (messageCount > 1) {
|
|
248
|
+
// Always clear streaming bubble on new turn (prevents cross-turn accumulation)
|
|
249
249
|
ws.sendPMStreamEnd(task.id, streamMsgId);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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 = '';
|