tuna-agent 0.1.92 → 0.1.93
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.
|
@@ -342,14 +342,17 @@ export class ClaudeCodeAdapter {
|
|
|
342
342
|
this.runReflection(task, result.result, 'failed', cwd).catch(() => { });
|
|
343
343
|
return;
|
|
344
344
|
}
|
|
345
|
-
// Track last output for reflection
|
|
346
|
-
lastTaskOutput = turnAccumulatedText.trim();
|
|
345
|
+
// Track last output for reflection (fallback to result.result if no streaming text)
|
|
346
|
+
lastTaskOutput = turnAccumulatedText.trim() || result.result;
|
|
347
347
|
if (lastTaskOutput) {
|
|
348
348
|
console.log(`[Reflection] Captured ${lastTaskOutput.length} chars of task output for reflection`);
|
|
349
349
|
}
|
|
350
350
|
// Send finalized message for the last turn's remaining text (skip if duplicate)
|
|
351
|
-
if (
|
|
352
|
-
|
|
351
|
+
// Fallback: if no streaming deltas were captured (e.g. agent_team mode may emit
|
|
352
|
+
// complete assistant messages instead of stream_event deltas), use result.result
|
|
353
|
+
const finalText = turnAccumulatedText.trim() || result.result;
|
|
354
|
+
if (finalText) {
|
|
355
|
+
const simplified = simplifyMarkdown(finalText);
|
|
353
356
|
if (!isSimilar(simplified, lastSentContent)) {
|
|
354
357
|
ws.sendPMMessage(task.id, {
|
|
355
358
|
sender: 'pm',
|