tuna-agent 0.1.177 → 0.1.179

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.
@@ -280,6 +280,15 @@ function createStreamHandler(info, subtask, callbacks) {
280
280
  const content = msg.content;
281
281
  if (content) {
282
282
  for (const block of content) {
283
+ // The agent's own narration between tool calls ("checking X first…",
284
+ // "step 1 done, now…") — relay it so surfaces can show progressive
285
+ // partial answers instead of silence until the final report.
286
+ if (block.type === 'text') {
287
+ const text = String(block.text || '').trim();
288
+ if (text) {
289
+ callbacks?.onSubtaskLog?.(subtask.id, { type: 'note', message: text });
290
+ }
291
+ }
283
292
  if (block.type === 'tool_use') {
284
293
  const toolName = block.name;
285
294
  const toolInput = block.input;
@@ -528,7 +537,7 @@ export function buildExecutionLayers(subtasks) {
528
537
  const completed = new Set();
529
538
  let remaining = [...subtasks];
530
539
  while (remaining.length > 0) {
531
- const layer = remaining.filter((s) => s.dependencies.every((dep) => completed.has(dep)));
540
+ const layer = remaining.filter((s) => (s.dependencies ?? []).every((dep) => completed.has(dep)));
532
541
  if (layer.length === 0) {
533
542
  console.warn('[Executor] Warning: unresolvable dependencies, forcing execution');
534
543
  layers.push(remaining);
@@ -190,6 +190,9 @@ export async function planTask(task, onProgress, signal, onTextChunk, inputFiles
190
190
  contracts: parsed.contracts,
191
191
  subtasks: parsed.subtasks.map((s) => ({
192
192
  ...s,
193
+ // The model sometimes omits optional-looking fields — never let a missing
194
+ // dependencies array crash layering/logging downstream.
195
+ dependencies: Array.isArray(s.dependencies) ? s.dependencies : [],
193
196
  status: 'pending',
194
197
  })),
195
198
  };
@@ -205,7 +208,7 @@ export async function planTask(task, onProgress, signal, onTextChunk, inputFiles
205
208
  }
206
209
  console.log(`[PM] Subtasks: ${plan.subtasks.length}`);
207
210
  plan.subtasks.forEach((s) => {
208
- console.log(` - [${s.role}] ${s.description.substring(0, 60)}... (deps: ${s.dependencies.join(',') || 'none'})`);
211
+ console.log(` - [${s.role}] ${s.description.substring(0, 60)}... (deps: ${(s.dependencies ?? []).join(',') || 'none'})`);
209
212
  });
210
213
  return { plan, pmSessionId: result.sessionId };
211
214
  }
@@ -336,7 +339,11 @@ User message: ${userMessage}`;
336
339
  const plan = {
337
340
  summary: parsed.summary,
338
341
  contracts: parsed.contracts,
339
- subtasks: parsed.subtasks.map((s) => ({ ...s, status: 'pending' })),
342
+ subtasks: parsed.subtasks.map((s) => ({
343
+ ...s,
344
+ dependencies: Array.isArray(s.dependencies) ? s.dependencies : [],
345
+ status: 'pending',
346
+ })),
340
347
  };
341
348
  if (parsed.questions?.length)
342
349
  plan.questions = parsed.questions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.177",
3
+ "version": "0.1.179",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"