@integrity-labs/agt-cli 0.25.2 → 0.26.0

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.
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-MUJA45LT.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-3ITHPO4P.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-Q5CZLM2R.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-7PHOEAUN.js.map
@@ -13,9 +13,8 @@ import {
13
13
  provisionOrientHook,
14
14
  provisionStopHook,
15
15
  requireHost
16
- } from "../chunk-U4DAVDAZ.js";
16
+ } from "../chunk-XG4X7BNT.js";
17
17
  import {
18
- findTaskByTemplate,
19
18
  getProjectDir as getProjectDir2,
20
19
  getReadyTasks,
21
20
  loadSchedulerState,
@@ -24,7 +23,6 @@ import {
24
23
  } from "../chunk-HR5T2RQF.js";
25
24
  import {
26
25
  buildAllowedTools,
27
- ensureKanbanLoopArmed,
28
26
  getLastFailureContext,
29
27
  getProjectDir,
30
28
  getSessionState,
@@ -32,8 +30,6 @@ import {
32
30
  injectMessageWithStatus,
33
31
  isAgentIdle,
34
32
  isAgentPromptReady,
35
- isKanbanLoopArmedForCurrentSession,
36
- isKanbanLoopDisabled,
37
33
  isSessionHealthy,
38
34
  isStaleForToday,
39
35
  parsePsRows,
@@ -50,7 +46,7 @@ import {
50
46
  stopAllSessionsAndWait,
51
47
  stopPersistentSession,
52
48
  takeZombieDetection
53
- } from "../chunk-M2RBM3M5.js";
49
+ } from "../chunk-LULDCIUS.js";
54
50
  import {
55
51
  KANBAN_CHECK_COMMAND,
56
52
  appendDmFooter,
@@ -73,7 +69,7 @@ import {
73
69
  resolveConnectivityProbe,
74
70
  resolveDmTarget,
75
71
  wrapScheduledTaskPrompt
76
- } from "../chunk-VWOXS4YP.js";
72
+ } from "../chunk-YMIDZT5T.js";
77
73
 
78
74
  // src/lib/manager-worker.ts
79
75
  import { createHash as createHash3 } from "crypto";
@@ -3130,7 +3126,7 @@ var cachedFrameworkVersion = null;
3130
3126
  var lastVersionCheckAt = 0;
3131
3127
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
3132
3128
  var lastResponsivenessProbeAt = 0;
3133
- var agtCliVersion = true ? "0.25.2" : "dev";
3129
+ var agtCliVersion = true ? "0.26.0" : "dev";
3134
3130
  function resolveBrewPath(execFileSync4) {
3135
3131
  try {
3136
3132
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -4089,7 +4085,7 @@ async function pollCycle() {
4089
4085
  }
4090
4086
  try {
4091
4087
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
4092
- const { collectDiagnostics } = await import("../persistent-session-MUJA45LT.js");
4088
+ const { collectDiagnostics } = await import("../persistent-session-3ITHPO4P.js");
4093
4089
  const diagCodeNames = [...persistentSessionAgents];
4094
4090
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
4095
4091
  let tailscaleHostname;
@@ -4147,7 +4143,7 @@ async function pollCycle() {
4147
4143
  const {
4148
4144
  collectResponsivenessProbes,
4149
4145
  getResponsivenessIntervalMs
4150
- } = await import("../responsiveness-probe-2TBRHC5T.js");
4146
+ } = await import("../responsiveness-probe-7XWORQLO.js");
4151
4147
  const probeIntervalMs = getResponsivenessIntervalMs();
4152
4148
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
4153
4149
  const probeCodeNames = [...persistentSessionAgents];
@@ -5221,12 +5217,15 @@ async function processAgent(agent, agentStates) {
5221
5217
  }
5222
5218
  let tasks = refreshData.scheduled_tasks ?? [];
5223
5219
  const existingTemplateIds = new Set(tasks.map((t) => t.template_id));
5220
+ const kanbanWorkRetired = (agentFrameworkCache.get(agent.code_name) ?? "openclaw") === "claude-code" && agentSessionMode === "persistent";
5224
5221
  try {
5225
5222
  const defaultsData = await api.post("/host/resolve-default-schedules", { agent_id: agent.agent_id });
5226
- const missing = (defaultsData.schedules ?? []).filter(
5223
+ const allSchedules = (defaultsData.schedules ?? []).filter(
5224
+ (s) => !(kanbanWorkRetired && s.template_id === "kanban-work")
5225
+ );
5226
+ const missing = allSchedules.filter(
5227
5227
  (s) => !existingTemplateIds.has(s.template_id)
5228
5228
  );
5229
- const allSchedules = defaultsData.schedules ?? [];
5230
5229
  if (allSchedules.length > 0) {
5231
5230
  await api.post("/host/ensure-default-schedules", {
5232
5231
  agent_id: agent.agent_id,
@@ -5243,6 +5242,9 @@ async function processAgent(agent, agentStates) {
5243
5242
  } catch (err) {
5244
5243
  log(`Default schedule provisioning failed for '${agent.code_name}': ${err.message}`);
5245
5244
  }
5245
+ if (kanbanWorkRetired) {
5246
+ tasks = tasks.filter((t) => t.template_id !== "kanban-work");
5247
+ }
5246
5248
  if (agent.status === "active") {
5247
5249
  if (frameworkAdapter.installPlugin) {
5248
5250
  try {
@@ -5486,10 +5488,6 @@ async function processAgent(agent, agentStates) {
5486
5488
  sessionHealthy: psResult.sessionHealthyAfter,
5487
5489
  spawnAttempted: psResult.spawnAttempted
5488
5490
  });
5489
- if (psResult.sessionHealthyAfter) {
5490
- ensureKanbanLoopArmed(agent.code_name, log).catch(() => {
5491
- });
5492
- }
5493
5491
  if (stuck.shouldWarn) {
5494
5492
  log(
5495
5493
  `[persistent-session-stuck] WARN: agent=${agent.code_name} unhealthy with no spawn attempt for ${stuck.consecutiveTicks} consecutive ticks (last_decision=${psResult.decision}) \u2014 manager-worker may need restart, or upstream guard is mis-firing (see ENG-5116)`
@@ -5688,8 +5686,6 @@ async function processAgent(agent, agentStates) {
5688
5686
  } else {
5689
5687
  log(`[persistent-session] Work trigger skipped for '${agent.code_name}' \u2014 session not yet healthy`);
5690
5688
  }
5691
- } else {
5692
- fireClaudeWorkTrigger(agent.code_name, agent.agent_id, boardItems);
5693
5689
  }
5694
5690
  }
5695
5691
  }
@@ -6006,8 +6002,7 @@ async function syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData
6006
6002
  if (ready.length === 0) return;
6007
6003
  for (const task of ready) {
6008
6004
  if ((claudeTaskConcurrency.get(codeName) ?? 0) >= MAX_CLAUDE_CONCURRENCY) break;
6009
- if (KANBAN_WORK_TEMPLATES.has(task.templateId) && !hasActionableItems(boardItems)) {
6010
- log(`[claude-scheduler] Skipping '${task.name}' for '${codeName}' \u2014 board is empty`);
6005
+ if (KANBAN_WORK_TEMPLATES.has(task.templateId)) {
6011
6006
  const updated = markTaskFired(codeName, task.taskId, "ok");
6012
6007
  claudeSchedulerStates.set(codeName, updated);
6013
6008
  continue;
@@ -6018,20 +6013,6 @@ async function syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData
6018
6013
  const boardPrefix = formatBoardForPrompt(boardItems, template);
6019
6014
  prompt = boardPrefix + prompt;
6020
6015
  }
6021
- if (KANBAN_WORK_TEMPLATES.has(task.templateId)) {
6022
- const todayItem = boardItems.find((b) => b.status === "todo");
6023
- if (todayItem) {
6024
- try {
6025
- await api.post("/host/kanban", {
6026
- agent_id: agent.agent_id,
6027
- update: [{ id: todayItem.id, title: todayItem.title, status: "in_progress" }]
6028
- });
6029
- log(`[claude-scheduler] Moved '${todayItem.title}' to in_progress for '${codeName}'`);
6030
- } catch (err) {
6031
- log(`[claude-scheduler] Failed to move item to in_progress: ${err.message}`);
6032
- }
6033
- }
6034
- }
6035
6016
  inFlightClaudeTasks.add(task.taskId);
6036
6017
  claudeTaskConcurrency.set(codeName, (claudeTaskConcurrency.get(codeName) ?? 0) + 1);
6037
6018
  log(`[claude-scheduler] Firing '${task.name}' for '${codeName}'`);
@@ -6433,30 +6414,6 @@ async function processClaudeTaskResult(codeName, agentId, templateId, rawOutput,
6433
6414
  log(`[claude-scheduler] Failed to post result for '${codeName}': ${err.message}`);
6434
6415
  }
6435
6416
  }
6436
- function fireClaudeWorkTrigger(codeName, agentId, boardItems) {
6437
- const state5 = claudeSchedulerStates.get(codeName) ?? loadSchedulerState(codeName);
6438
- const kanbanTask = findTaskByTemplate(state5, "kanban-work");
6439
- if (!kanbanTask) {
6440
- log(`[claude-scheduler] Work trigger: no kanban-work task found for '${codeName}'`);
6441
- return;
6442
- }
6443
- if (inFlightClaudeTasks.has(kanbanTask.taskId)) {
6444
- log(`[claude-scheduler] Work trigger: kanban-work already in-flight for '${codeName}'`);
6445
- return;
6446
- }
6447
- let prompt = kanbanTask.prompt;
6448
- if (boardItems.length > 0) {
6449
- const boardPrefix = formatBoardForPrompt(boardItems, "follow-up");
6450
- prompt = boardPrefix + prompt;
6451
- }
6452
- inFlightClaudeTasks.add(kanbanTask.taskId);
6453
- claudeTaskConcurrency.set(codeName, (claudeTaskConcurrency.get(codeName) ?? 0) + 1);
6454
- log(`[claude-scheduler] Work trigger: firing kanban-work for '${codeName}'`);
6455
- executeAndProcessClaudeTask(codeName, agentId, kanbanTask, prompt).finally(() => {
6456
- inFlightClaudeTasks.delete(kanbanTask.taskId);
6457
- claudeTaskConcurrency.set(codeName, Math.max(0, (claudeTaskConcurrency.get(codeName) ?? 1) - 1));
6458
- });
6459
- }
6460
6417
  var persistentSessionAgents = /* @__PURE__ */ new Set();
6461
6418
  var lastMcpFailedBannerCount = /* @__PURE__ */ new Map();
6462
6419
  var persistentSessionStuckTracker = new PersistentSessionStuckTracker();
@@ -6711,13 +6668,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash3("sha256").
6711
6668
  log(`[persistent-session] ${ready.length} ready task(s) for '${codeName}': ${ready.map((t) => `${t.name}(next=${t.nextFireAt ? new Date(t.nextFireAt).toISOString() : "null"})`).join(", ")}`);
6712
6669
  }
6713
6670
  for (const task of ready) {
6714
- if (KANBAN_WORK_TEMPLATES.has(task.templateId) && isKanbanWorkCronDisabled() && isKanbanLoopArmedForCurrentSession(codeName)) {
6715
- const updated = markTaskFired(codeName, task.taskId, "ok");
6716
- claudeSchedulerStates.set(codeName, updated);
6717
- continue;
6718
- }
6719
- if (KANBAN_WORK_TEMPLATES.has(task.templateId) && !hasActionableItems(boardItems)) {
6720
- log(`[persistent-session] Skipping '${task.name}' for '${codeName}' \u2014 board is empty`);
6671
+ if (KANBAN_WORK_TEMPLATES.has(task.templateId)) {
6721
6672
  const updated = markTaskFired(codeName, task.taskId, "ok");
6722
6673
  claudeSchedulerStates.set(codeName, updated);
6723
6674
  continue;
@@ -6728,19 +6679,6 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash3("sha256").
6728
6679
  const boardPrefix = formatBoardForPrompt(boardItems, template);
6729
6680
  prompt = boardPrefix + prompt;
6730
6681
  }
6731
- if (KANBAN_WORK_TEMPLATES.has(task.templateId)) {
6732
- const todayItem = boardItems.find((b) => b.status === "todo");
6733
- if (todayItem) {
6734
- try {
6735
- await api.post("/host/kanban", {
6736
- agent_id: agent.agent_id,
6737
- update: [{ id: todayItem.id, title: todayItem.title, status: "in_progress" }]
6738
- });
6739
- log(`[persistent-session] Moved '${todayItem.title}' to in_progress for '${codeName}'`);
6740
- } catch {
6741
- }
6742
- }
6743
- }
6744
6682
  if (inFlightClaudeTasks.has(task.taskId)) {
6745
6683
  continue;
6746
6684
  }
@@ -6974,15 +6912,13 @@ function ensureRealtimeKanbanStarted(agentStates) {
6974
6912
  if (!agent) return;
6975
6913
  const agentFw = agentFrameworkCache.get(agent.codeName) ?? "openclaw";
6976
6914
  if (agentFw === "claude-code") {
6977
- const boardItems = kanbanBoardCache.get(agent.codeName) ?? [];
6978
6915
  if (isSessionHealthy(agent.codeName)) {
6979
6916
  injectMessage(agent.codeName, "task", `New task added to your board: id=${item.id} title=${JSON.stringify(item.title)} priority=${item.priority}. Call kanban_move("${item.id}", "in_progress") and start working.`, {
6980
6917
  task_name: "kanban-work-trigger"
6981
6918
  }, log);
6982
6919
  log(`[realtime] Injected kanban-work trigger for '${agent.codeName}': "${item.title}"`);
6983
6920
  } else {
6984
- fireClaudeWorkTrigger(agent.codeName, agent.agentId, boardItems);
6985
- log(`[realtime] Fired kanban-work for '${agent.codeName}': "${item.title}"`);
6921
+ log(`[realtime] Work trigger skipped for '${agent.codeName}' \u2014 session not yet healthy; hybrid will pick up "${item.title}"`);
6986
6922
  }
6987
6923
  }
6988
6924
  },
@@ -7221,13 +7157,8 @@ var KANBAN_WORK_TEMPLATES = /* @__PURE__ */ new Set(["kanban-work"]);
7221
7157
  function isPlainScheduledTemplate(templateId) {
7222
7158
  return !STANDUP_TEMPLATES.has(templateId) && !TASK_UPDATE_TEMPLATES.has(templateId) && !PLAN_TEMPLATES.has(templateId) && !KANBAN_WORK_TEMPLATES.has(templateId);
7223
7159
  }
7224
- function isKanbanWorkCronDisabled() {
7225
- const v = process.env["AGT_DISABLE_KANBAN_WORK_CRON"];
7226
- return v === "1" || v?.toLowerCase() === "true";
7227
- }
7228
7160
  function isKanbanHybridEnabled() {
7229
- const v = process.env["AGT_KANBAN_HYBRID"];
7230
- return v === "1" || v?.toLowerCase() === "true";
7161
+ return true;
7231
7162
  }
7232
7163
  function isKanbanHybridDryRun() {
7233
7164
  const v = process.env["AGT_KANBAN_HYBRID_DRY_RUN"];
@@ -7302,18 +7233,7 @@ ${formatRunMarker(run_id)}` : KANBAN_CHECK_COMMAND;
7302
7233
  log(`[manager-worker] kanban inject failed for '${codeName}'`);
7303
7234
  }
7304
7235
  }
7305
- function warnOnConflictingKanbanModes() {
7306
- if (!isKanbanHybridEnabled()) return;
7307
- const cronOff = isKanbanWorkCronDisabled();
7308
- const loopOff = isKanbanLoopDisabled();
7309
- if (!cronOff || !loopOff) {
7310
- const stillOn = !cronOff && !loopOff ? "AGT_DISABLE_KANBAN_WORK_CRON and AGT_DISABLE_KANBAN_LOOP are" : !cronOff ? "AGT_DISABLE_KANBAN_WORK_CRON is" : "AGT_DISABLE_KANBAN_LOOP is";
7311
- log(
7312
- `[manager-worker] WARN AGT_KANBAN_HYBRID=1 but ${stillOn} not set \u2014 kanban-work will fire from MULTIPLE sources (doubles token spend). Set both predecessors to 1 for clean hybrid mode.`
7313
- );
7314
- }
7315
- }
7316
- var BOARD_INJECT_TEMPLATES = /* @__PURE__ */ new Set(["morning-plan", "task-update", "hourly-status", "end-of-day-summary", "kanban-work"]);
7236
+ var BOARD_INJECT_TEMPLATES = /* @__PURE__ */ new Set(["morning-plan", "task-update", "hourly-status", "end-of-day-summary"]);
7317
7237
  var ACTIONABLE_STATUSES = /* @__PURE__ */ new Set(["todo", "in_progress"]);
7318
7238
  function hasActionableItems(items) {
7319
7239
  return items.some((item) => ACTIONABLE_STATUSES.has(item.status));
@@ -8151,7 +8071,7 @@ async function processClaudePairSessions(agents) {
8151
8071
  killPairSession,
8152
8072
  pairTmuxSession,
8153
8073
  finalizeClaudePairOnboarding
8154
- } = await import("../claude-pair-runtime-Q5CZLM2R.js");
8074
+ } = await import("../claude-pair-runtime-7PHOEAUN.js");
8155
8075
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
8156
8076
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
8157
8077
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -8754,7 +8674,6 @@ function startManager(opts) {
8754
8674
  log(
8755
8675
  `[startup] worker pid=${process.pid} ppid=${process.ppid} node=${process.version} log=${join6(homedir4(), ".augmented", "manager.log")}`
8756
8676
  );
8757
- warnOnConflictingKanbanModes();
8758
8677
  deployMcpAssets();
8759
8678
  reapOrphanChannelMcps({ log });
8760
8679
  void ensureHostFrameworkBinaries();
@@ -8933,7 +8852,6 @@ export {
8933
8852
  isHybridActionable,
8934
8853
  isKanbanHybridDryRun,
8935
8854
  isKanbanHybridEnabled,
8936
- isKanbanWorkCronDisabled,
8937
8855
  isPlainScheduledTemplate,
8938
8856
  isScheduledCardTracked,
8939
8857
  isScheduledViaKanbanEnabled,
@@ -8945,7 +8863,6 @@ export {
8945
8863
  shouldSkipRevokedCleanup,
8946
8864
  stampClaudeCodeUpgradeMarker,
8947
8865
  startManager,
8948
- stopManager,
8949
- warnOnConflictingKanbanModes
8866
+ stopManager
8950
8867
  };
8951
8868
  //# sourceMappingURL=manager-worker.js.map