@integrity-labs/agt-cli 0.27.137 → 0.27.139

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-NSN62HZN.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-SOCMTNFC.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-ZOHU673W.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-ZLYTTNUY.js.map
@@ -0,0 +1,27 @@
1
+ import {
2
+ _internals,
3
+ getOrCreateDailySession,
4
+ isAgentIdle,
5
+ isStaleForToday,
6
+ markDailySessionSpawn,
7
+ peekCurrentSession,
8
+ rotateDailySession,
9
+ sessionFileExists,
10
+ sessionFilePath,
11
+ sessionTranscriptDir,
12
+ transcriptActivityAgeSeconds
13
+ } from "./chunk-354FAVQR.js";
14
+ export {
15
+ _internals,
16
+ getOrCreateDailySession,
17
+ isAgentIdle,
18
+ isStaleForToday,
19
+ markDailySessionSpawn,
20
+ peekCurrentSession,
21
+ rotateDailySession,
22
+ sessionFileExists,
23
+ sessionFilePath,
24
+ sessionTranscriptDir,
25
+ transcriptActivityAgeSeconds
26
+ };
27
+ //# sourceMappingURL=daily-session-PNQX5URX.js.map
@@ -17,7 +17,7 @@ import {
17
17
  provisionStopHook,
18
18
  requireHost,
19
19
  safeWriteJsonAtomic
20
- } from "../chunk-UIRCFCED.js";
20
+ } from "../chunk-PSH4UXVY.js";
21
21
  import {
22
22
  getProjectDir as getProjectDir2,
23
23
  getReadyTasks,
@@ -36,13 +36,10 @@ import {
36
36
  getSessionState,
37
37
  injectMessage,
38
38
  injectMessageWithStatus,
39
- isAgentIdle,
40
39
  isAgentPromptReady,
41
40
  isSessionHealthy,
42
- isStaleForToday,
43
41
  paneLogPath,
44
42
  parseEnvIntegrations,
45
- peekCurrentSession,
46
43
  prepareForRespawn,
47
44
  probeMcpEnvSubstitution,
48
45
  readPaneLogTail,
@@ -51,13 +48,12 @@ import {
51
48
  rotateSessionForWedge,
52
49
  sanitizeMcpJson,
53
50
  sendToAgent,
54
- sessionTranscriptDir,
55
51
  startPersistentSession,
56
52
  stopAllSessionsAndWait,
57
53
  stopPersistentSession,
58
54
  takeWatchdogGiveUpCount,
59
55
  takeZombieDetection
60
- } from "../chunk-YJOFVGD2.js";
56
+ } from "../chunk-IDDSO7Q5.js";
61
57
  import {
62
58
  KANBAN_CHECK_COMMAND,
63
59
  SUPPRESS_SENTINEL,
@@ -84,7 +80,13 @@ import {
84
80
  resolveDmTarget,
85
81
  worseConnectivityOutcome,
86
82
  wrapScheduledTaskPrompt
87
- } from "../chunk-TDMOEMDM.js";
83
+ } from "../chunk-WCXA7EEP.js";
84
+ import {
85
+ isAgentIdle,
86
+ isStaleForToday,
87
+ peekCurrentSession,
88
+ sessionTranscriptDir
89
+ } from "../chunk-354FAVQR.js";
88
90
  import {
89
91
  parsePsRows,
90
92
  reapOrphanChannelMcps
@@ -3360,8 +3362,15 @@ function clearAgentState(agentId, codeName) {
3360
3362
  // src/lib/wedge-detection.ts
3361
3363
  var DEFAULTS = {
3362
3364
  inboundWaitSeconds: 120,
3363
- inboundHardWaitSeconds: 300,
3365
+ // ENG-6238: the hard cap is now an ABSOLUTE BACKSTOP, not the primary
3366
+ // discriminator — a still-producing session (e.g. a runaway loop) is only
3367
+ // reaped here. Raised 300→1200 because the soft path now reliably catches
3368
+ // the frozen-turn wedge via the transcript signal, so the hard cap no longer
3369
+ // needs to fire early (which is exactly what false-killed kylie's long
3370
+ // legitimate turns, ENG-6238).
3371
+ inboundHardWaitSeconds: 1200,
3364
3372
  paneStaleSeconds: 120,
3373
+ transcriptStaleSeconds: 60,
3365
3374
  minCycles: 3
3366
3375
  };
3367
3376
  function parseMode(raw) {
@@ -3387,17 +3396,28 @@ function resolveWedgeConfig(env = process.env) {
3387
3396
  inboundWaitSeconds,
3388
3397
  inboundHardWaitSeconds,
3389
3398
  paneStaleSeconds: parsePositiveInt(env.AGT_WEDGE_PANE_STALE_SECONDS, DEFAULTS.paneStaleSeconds, 30),
3399
+ transcriptStaleSeconds: parsePositiveInt(
3400
+ env.AGT_WEDGE_TRANSCRIPT_STALE_SECONDS,
3401
+ DEFAULTS.transcriptStaleSeconds,
3402
+ 15
3403
+ ),
3390
3404
  minCycles: parsePositiveInt(env.AGT_WEDGE_MIN_CYCLES, DEFAULTS.minCycles, 2)
3391
3405
  };
3392
3406
  }
3407
+ function isSessionProducing(signals, config2) {
3408
+ const transcriptAge = signals.transcriptActivityAgeSeconds;
3409
+ if (transcriptAge !== null) return transcriptAge < config2.transcriptStaleSeconds;
3410
+ const paneAge = signals.paneActivityAgeSeconds;
3411
+ return paneAge !== null && paneAge < config2.paneStaleSeconds;
3412
+ }
3393
3413
  function isWedgeCandidateCycle(signals, config2) {
3394
3414
  const inboundAge = signals.pendingInboundOldestAgeSeconds;
3395
3415
  if (inboundAge === null) return false;
3396
3416
  if (inboundAge < config2.inboundWaitSeconds) return false;
3397
- if (inboundAge >= config2.inboundHardWaitSeconds) return true;
3398
- const paneAge = signals.paneActivityAgeSeconds;
3399
- const paneAdvancing = paneAge !== null && paneAge < config2.paneStaleSeconds;
3400
- return !paneAdvancing;
3417
+ if (isSessionProducing(signals, config2)) {
3418
+ return inboundAge >= config2.inboundHardWaitSeconds;
3419
+ }
3420
+ return true;
3401
3421
  }
3402
3422
  function decideWedgeRestart(input, config2) {
3403
3423
  if (!isWedgeCandidateCycle(input, config2)) return "none";
@@ -4718,7 +4738,7 @@ var cachedMaintenanceWindow = null;
4718
4738
  var lastVersionCheckAt = 0;
4719
4739
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
4720
4740
  var lastResponsivenessProbeAt = 0;
4721
- var agtCliVersion = true ? "0.27.137" : "dev";
4741
+ var agtCliVersion = true ? "0.27.139" : "dev";
4722
4742
  function resolveBrewPath(execFileSync4) {
4723
4743
  try {
4724
4744
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -5916,7 +5936,7 @@ async function pollCycle() {
5916
5936
  }
5917
5937
  try {
5918
5938
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
5919
- const { collectDiagnostics } = await import("../persistent-session-NSN62HZN.js");
5939
+ const { collectDiagnostics } = await import("../persistent-session-SOCMTNFC.js");
5920
5940
  const diagCodeNames = [...agentState.persistentSessionAgents];
5921
5941
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
5922
5942
  let tailscaleHostname;
@@ -6003,12 +6023,12 @@ async function pollCycle() {
6003
6023
  const {
6004
6024
  collectResponsivenessProbes,
6005
6025
  getResponsivenessIntervalMs
6006
- } = await import("../responsiveness-probe-RF5ZCTE7.js");
6026
+ } = await import("../responsiveness-probe-USWGCI4C.js");
6007
6027
  const probeIntervalMs = getResponsivenessIntervalMs();
6008
6028
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
6009
6029
  const probeCodeNames = [...agentState.persistentSessionAgents];
6010
6030
  if (probeCodeNames.length > 0) {
6011
- const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-NSN62HZN.js");
6031
+ const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-SOCMTNFC.js");
6012
6032
  const drainedGiveUps = /* @__PURE__ */ new Map();
6013
6033
  const drainedAcpxFailures = /* @__PURE__ */ new Map();
6014
6034
  const probes = collectResponsivenessProbes(probeCodeNames).map((p) => {
@@ -6042,7 +6062,9 @@ async function pollCycle() {
6042
6062
  collectResponsivenessProbes,
6043
6063
  livePendingInboundOldestAgeSeconds,
6044
6064
  deadLetterPendingInbound
6045
- } = await import("../responsiveness-probe-RF5ZCTE7.js");
6065
+ } = await import("../responsiveness-probe-USWGCI4C.js");
6066
+ const { transcriptActivityAgeSeconds } = await import("../daily-session-PNQX5URX.js");
6067
+ const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
6046
6068
  const wedgeNow = /* @__PURE__ */ new Date();
6047
6069
  const liveAgents = agentState.persistentSessionAgents;
6048
6070
  for (const tracked of consecutiveWedgeCycles.keys()) {
@@ -6058,9 +6080,16 @@ async function pollCycle() {
6058
6080
  consecutiveWedgeCycles.delete(codeName);
6059
6081
  continue;
6060
6082
  }
6061
- const sessionStartMs = getSessionState(codeName)?.startedAt ?? null;
6083
+ const wedgeSession = getSessionState(codeName);
6084
+ const sessionStartMs = wedgeSession?.startedAt ?? null;
6085
+ const transcriptAge = transcriptActivityAgeSeconds(
6086
+ wedgeProjectDir(codeName),
6087
+ wedgeSession?.currentSessionId ?? null,
6088
+ wedgeNow
6089
+ );
6062
6090
  const signals = {
6063
6091
  paneActivityAgeSeconds: probe.pane_activity_age_seconds,
6092
+ transcriptActivityAgeSeconds: transcriptAge,
6064
6093
  pendingInboundOldestAgeSeconds: livePendingInboundOldestAgeSeconds(
6065
6094
  codeName,
6066
6095
  sessionStartMs,
@@ -6076,7 +6105,8 @@ async function pollCycle() {
6076
6105
  if (decideWedgeRestart({ ...signals, consecutiveWedgeCycles: streak }, wedgeConfig) !== "wedged") {
6077
6106
  continue;
6078
6107
  }
6079
- const detail = `agent=${codeName} paneAge=${signals.paneActivityAgeSeconds}s inboundAge=${signals.pendingInboundOldestAgeSeconds}s cycles=${streak}`;
6108
+ const transcriptAgeLabel = transcriptAge === null ? "n/a" : `${transcriptAge}s`;
6109
+ const detail = `agent=${codeName} paneAge=${signals.paneActivityAgeSeconds}s transcriptAge=${transcriptAgeLabel} inboundAge=${signals.pendingInboundOldestAgeSeconds}s cycles=${streak}`;
6080
6110
  if (wedgeConfig.mode === "shadow") {
6081
6111
  if (streak === wedgeConfig.minCycles) {
6082
6112
  log(`[wedge] SHADOW would force-fresh respawn ${detail}`);
@@ -10548,7 +10578,7 @@ async function processClaudePairSessions(agents) {
10548
10578
  killPairSession,
10549
10579
  pairTmuxSession,
10550
10580
  finalizeClaudePairOnboarding
10551
- } = await import("../claude-pair-runtime-ZOHU673W.js");
10581
+ } = await import("../claude-pair-runtime-ZLYTTNUY.js");
10552
10582
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
10553
10583
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
10554
10584
  const killed = await killPairSession(pairTmuxSession(pairId));