tuna-agent 0.1.85 → 0.1.87

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.
@@ -312,7 +312,7 @@ export async function handleGenerateScript(ws, code, taskId, idea, topic, style,
312
312
  cwd: CONTENT_CREATOR_DIR,
313
313
  maxTurns: 4,
314
314
  outputFormat: 'stream-json',
315
- includePartialMessages: true,
315
+ includePartialMessages: false,
316
316
  timeoutMs: 180000,
317
317
  onStreamLine: (data) => {
318
318
  if (streamChunks < 5) {
@@ -782,7 +782,7 @@ ${skillContent.slice(0, 15000)}`;
782
782
  cwd,
783
783
  allowedTools: ['Read', 'Edit', 'Write', 'Bash', 'Glob', 'Grep'],
784
784
  outputFormat: 'stream-json',
785
- includePartialMessages: true,
785
+ includePartialMessages: false,
786
786
  agentTeam: true,
787
787
  maxTurns: 200,
788
788
  resumeSessionId: sessionId,
@@ -819,20 +819,21 @@ ${skillContent.slice(0, 15000)}`;
819
819
  if (data.type === 'system' && data.subtype === 'init') {
820
820
  sessionId = data.session_id;
821
821
  }
822
- // Patch missing stream chunks from assistant message (same as handleTask)
822
+ // Extract tool usage from assistant messages (no text patching —
823
+ // content_block_delta is the sole source of streaming text)
823
824
  if (data.type === 'assistant' && data.message) {
824
825
  const msg = data.message;
825
826
  const content = msg.content;
826
827
  if (content) {
827
- const fullText = content
828
- .filter(b => b.type === 'text' && b.text)
829
- .map(b => b.text)
830
- .join('');
831
- if (fullText && fullText.length > turnAccumulatedText.length) {
832
- const missed = fullText.slice(turnAccumulatedText.length);
833
- if (missed.length > 0) {
834
- turnAccumulatedText = fullText;
835
- wsClient.sendPMStream(taskId, missed);
828
+ for (const block of content) {
829
+ if (block.type === 'tool_use') {
830
+ const toolName = block.name;
831
+ const toolInput = block.input;
832
+ const detail = toolInput?.file_path || toolInput?.command || toolInput?.pattern || '';
833
+ wsClient.sendProgress(taskId, 'subtask_log', {
834
+ subtaskId: 'agent-team',
835
+ log: { type: 'action', message: `${toolName}: ${String(detail).substring(0, 80)}` },
836
+ });
836
837
  }
837
838
  }
838
839
  }
@@ -142,7 +142,7 @@ export async function planTask(task, onProgress, signal, onTextChunk, inputFiles
142
142
  systemPrompt,
143
143
  maxTurns,
144
144
  outputFormat: 'stream-json',
145
- includePartialMessages: !!onTextChunk,
145
+ includePartialMessages: false,
146
146
  onStreamLine: createPlanningStreamHandler(task.id, onProgress, onTextChunk),
147
147
  signal,
148
148
  inputFiles,
@@ -284,7 +284,7 @@ User message: ${userMessage}`;
284
284
  maxTurns: 1,
285
285
  lightweight: true,
286
286
  outputFormat: 'stream-json',
287
- includePartialMessages: !!onTextChunk,
287
+ includePartialMessages: false,
288
288
  inputFiles,
289
289
  onStreamLine: onTextChunk ? (data) => {
290
290
  // Parse stream_event → content_block_delta for real token streaming
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.85",
3
+ "version": "0.1.87",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"