tuna-agent 0.1.177 → 0.1.178

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.
@@ -528,7 +528,7 @@ export function buildExecutionLayers(subtasks) {
528
528
  const completed = new Set();
529
529
  let remaining = [...subtasks];
530
530
  while (remaining.length > 0) {
531
- const layer = remaining.filter((s) => s.dependencies.every((dep) => completed.has(dep)));
531
+ const layer = remaining.filter((s) => (s.dependencies ?? []).every((dep) => completed.has(dep)));
532
532
  if (layer.length === 0) {
533
533
  console.warn('[Executor] Warning: unresolvable dependencies, forcing execution');
534
534
  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.178",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"