agy-mcp-bridge 0.1.18 → 0.1.19

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.
@@ -425,7 +425,7 @@ export class TaskManager {
425
425
  task.process_running = false;
426
426
  task.ended_at = new Date().toISOString();
427
427
  task.duration_ms = Date.now() - started;
428
- task.status = entry.stop ?? 'failed';
428
+ let finalStatus = entry.stop ?? 'failed';
429
429
  if (!entry.stop) {
430
430
  try {
431
431
  const result = await agent.adapter.parseResult({
@@ -440,11 +440,11 @@ export class TaskManager {
440
440
  action: redact(item.action).slice(0, 200), display_name: redact(item.display_name).slice(0, 200)
441
441
  }));
442
442
  if (result.timeout) {
443
- task.status = 'timeout';
443
+ finalStatus = 'timeout';
444
444
  task.error = result.error ? redact(result.error) : 'CLI reported a timeout';
445
445
  }
446
446
  else if (result.success) {
447
- task.status = 'completed';
447
+ finalStatus = 'completed';
448
448
  }
449
449
  else {
450
450
  task.error = result.error ? redact(result.error) : `${agent.adapter.label} did not provide a complete successful response`;
@@ -454,9 +454,9 @@ export class TaskManager {
454
454
  task.error ??= error instanceof Error ? redact(error.message) : `Could not parse ${agent.adapter.label} output`;
455
455
  }
456
456
  }
457
- if (task.status === 'timeout')
457
+ if (finalStatus === 'timeout')
458
458
  task.error ??= 'Task exceeded its execution deadline';
459
- if (task.status === 'canceled')
459
+ if (finalStatus === 'canceled')
460
460
  task.error ??= 'Task canceled; partial file changes may remain';
461
461
  if (worktree) {
462
462
  try {
@@ -476,6 +476,9 @@ export class TaskManager {
476
476
  task.error ??= 'Could not release execution lock';
477
477
  }
478
478
  }
479
+ // The terminal status is written last: a reader that polls the moment the process exits must never see
480
+ // "completed" while the owns-scope check on the worktree is still outstanding.
481
+ task.status = finalStatus;
479
482
  await this.persist(task);
480
483
  await appendUsage(this.runtime.stateDirectory, {
481
484
  at: task.ended_at ?? new Date().toISOString(), status: task.status, model: entry.request?.model ?? null, effort: entry.request?.effort ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agy-mcp-bridge",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "Local loopback HTTP MCP bridge that delegates bounded coding tasks to multiple agent CLIs (Antigravity, Codex) with optional parallel git worktrees",
5
5
  "license": "MIT",
6
6
  "keywords": [