@integrity-labs/agt-cli 0.24.4 → 0.24.6

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.
@@ -12,7 +12,7 @@ import {
12
12
  provisionOrientHook,
13
13
  provisionStopHook,
14
14
  requireHost
15
- } from "../chunk-3TYBPBDA.js";
15
+ } from "../chunk-VMHT2DM7.js";
16
16
  import {
17
17
  findTaskByTemplate,
18
18
  getProjectDir as getProjectDir2,
@@ -534,7 +534,7 @@ function reapMissingMcpSessions(args) {
534
534
  );
535
535
  }
536
536
  }
537
- stopSession(codeName);
537
+ stopSession(codeName, { activeKeys: active });
538
538
  return {
539
539
  missing,
540
540
  restarted: true,
@@ -572,6 +572,9 @@ function decideChannelRestart(input) {
572
572
  }
573
573
 
574
574
  // src/lib/restart-breaker.ts
575
+ function reaperRestartBreakerReason(activeKeys) {
576
+ return activeKeys.length >= 2 ? "mcp-presence-reaper" : void 0;
577
+ }
575
578
  var DEFAULT_MAX = 2;
576
579
  var DEFAULT_WINDOW_MS = 6e5;
577
580
  function readEnvNumber(name, fallback) {
@@ -2806,7 +2809,7 @@ var cachedFrameworkVersion = null;
2806
2809
  var lastVersionCheckAt = 0;
2807
2810
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
2808
2811
  var lastResponsivenessProbeAt = 0;
2809
- var agtCliVersion = true ? "0.24.4" : "dev";
2812
+ var agtCliVersion = true ? "0.24.6" : "dev";
2810
2813
  function resolveBrewPath(execFileSync4) {
2811
2814
  try {
2812
2815
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -5149,12 +5152,17 @@ async function processAgent(agent, agentStates) {
5149
5152
  codeName: agent.code_name,
5150
5153
  mcpJson: mcpJsonParsed,
5151
5154
  sessionStartedAt: sess?.startedAt ?? null,
5152
- // ENG-5441: mcp-presence-reaper-driven restart counts against
5153
- // the breaker. Each declared MCP has its own ENG-5279 give-up
5154
- // cap (~3 cycles per server), but a thrashing collection of
5155
- // MCPs can still rotate restarts of the whole session. The
5156
- // breaker catches the rotating case the per-MCP cap can't see.
5157
- stopSession: (codeName) => stopPersistentSessionAndForgetMcpBaseline(codeName, "mcp-presence-reaper"),
5155
+ // ENG-5441 / ENG-5547: a mcp-presence-reaper restart counts against
5156
+ // the agent-wide breaker ONLY when several distinct MCP servers are
5157
+ // missing at once a thrashing collection that rotates restarts of
5158
+ // the whole session, which the per-MCP cap can't see. A restart
5159
+ // driven by a SINGLE persistently-failing server is left to that
5160
+ // server's own ENG-5279 give-up cap ( marked unhealthy via onGiveUp
5161
+ // → dropped from the next .mcp.json), so one bad integration is
5162
+ // isolated and the agent keeps running degraded instead of being
5163
+ // paused wholesale. reaperRestartBreakerReason() encodes that
5164
+ // single-vs-multi decision; undefined means "restart, don't count".
5165
+ stopSession: (codeName, ctx) => stopPersistentSessionAndForgetMcpBaseline(codeName, reaperRestartBreakerReason(ctx.activeKeys)),
5158
5166
  // ENG-5292: when the reaper gives up on a managed MCP (cap from
5159
5167
  // ENG-5279 + state-preservation from ENG-5285 both said "this
5160
5168
  // MCP keeps failing after 3 restart cycles"), mark the matching