@koalaauto/agentchannel 3.26.3 → 3.26.5

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.
@@ -264,7 +264,7 @@ export declare class Runner {
264
264
  /** Stop polling; abort running jobs without failing their tasks (they resume on restart). */
265
265
  stop(): Promise<void>;
266
266
  }
267
- /** `ach run --gc`: remove work dirs of tasks terminal for more than `days` (branches are kept). */
267
+ /** `ach run --gc`: remove work dirs of tasks terminal for more than `days`, and of tasks the hub does not have untouched for as long (branches are kept). */
268
268
  export declare function gcWorktrees(client: Pick<Client, 'getTask'>, ws: Workspace, o?: {
269
269
  days?: number;
270
270
  now?: number;
@@ -1463,13 +1463,26 @@ export class Runner {
1463
1463
  await Promise.all([...this.active.values()].map((a) => a.done));
1464
1464
  }
1465
1465
  }
1466
- /** `ach run --gc`: remove work dirs of tasks terminal for more than `days` (branches are kept). */
1466
+ /** `ach run --gc`: remove work dirs of tasks terminal for more than `days`, and of tasks the hub does not have untouched for as long (branches are kept). */
1467
1467
  export async function gcWorktrees(client, ws, o = {}) {
1468
1468
  const cutoff = (o.now ?? Date.now()) - (o.days ?? 7) * 86_400_000;
1469
1469
  const removed = [];
1470
1470
  for (const id of ws.list()) {
1471
1471
  try {
1472
- const { task } = await client.getTask(id);
1472
+ const got = await client.getTask(id).catch((e) => {
1473
+ // a task this hub does not have (an older hub's, or deleted) never ends here: its dir goes once it sat untouched past the cutoff
1474
+ if (e instanceof HubError && e.status === 404)
1475
+ return null;
1476
+ throw e;
1477
+ });
1478
+ if (!got) {
1479
+ if (ws.mtime(id) > cutoff)
1480
+ continue;
1481
+ await ws.remove(id);
1482
+ removed.push(id);
1483
+ continue;
1484
+ }
1485
+ const { task } = got;
1473
1486
  if (!isTerminal(task.status))
1474
1487
  continue;
1475
1488
  if (o.keepFailed && task.status === 'failed')
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "3.26.3";
1
+ export declare const VERSION = "3.26.5";
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export declare const PKG_NAME = "@koalaauto/agentchannel";
4
4
  /**
@@ -1,4 +1,4 @@
1
- export const VERSION = '3.26.3';
1
+ export const VERSION = '3.26.5';
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export const PKG_NAME = '@koalaauto/agentchannel';
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalaauto/agentchannel",
3
- "version": "3.26.3",
3
+ "version": "3.26.5",
4
4
  "description": "Hand work between your team's agents (Claude Code, Codex) and follow it in one panel: the ach CLI, MCP server and runner for AgentChannel v2",
5
5
  "keywords": [
6
6
  "agentchannel",