@integrity-labs/agt-cli 0.28.635 → 0.28.637
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.
- package/dist/bin/agt.js +5 -5
- package/dist/{chunk-J6KQDGWM.js → chunk-3JBA6RYG.js} +140 -30
- package/dist/{chunk-J6KQDGWM.js.map → chunk-3JBA6RYG.js.map} +1 -1
- package/dist/{chunk-FKG7DIE2.js → chunk-JT2JQUK3.js} +24 -1
- package/dist/{chunk-FKG7DIE2.js.map → chunk-JT2JQUK3.js.map} +1 -1
- package/dist/{chunk-GNTCOXZG.js → chunk-W4GVD3KK.js} +2 -2
- package/dist/{claude-pair-runtime-DWNJWCSU.js → claude-pair-runtime-CE72HQE7.js} +2 -2
- package/dist/lib/manager-worker.js +69 -35
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/augmented-admin.js +1 -1
- package/dist/{persistent-session-ORYBOIBQ.js → persistent-session-SZLOBXBQ.js} +3 -3
- package/dist/{responsiveness-probe-WYCKY2BJ.js → responsiveness-probe-MDPLVVKC.js} +3 -3
- package/dist/{session-auth-dead-NASGEQCA.js → session-auth-dead-ZLENJLLO.js} +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-GNTCOXZG.js.map → chunk-W4GVD3KK.js.map} +0 -0
- /package/dist/{claude-pair-runtime-DWNJWCSU.js.map → claude-pair-runtime-CE72HQE7.js.map} +0 -0
- /package/dist/{persistent-session-ORYBOIBQ.js.map → persistent-session-SZLOBXBQ.js.map} +0 -0
- /package/dist/{responsiveness-probe-WYCKY2BJ.js.map → responsiveness-probe-MDPLVVKC.js.map} +0 -0
- /package/dist/{session-auth-dead-NASGEQCA.js.map → session-auth-dead-ZLENJLLO.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
rotateDailySession,
|
|
17
17
|
sessionFileExists,
|
|
18
18
|
todayLocalIso
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JT2JQUK3.js";
|
|
20
20
|
import {
|
|
21
21
|
reapOrphanChannelMcps
|
|
22
22
|
} from "./chunk-XWVM4KPK.js";
|
|
@@ -4313,4 +4313,4 @@ export {
|
|
|
4313
4313
|
stopAllSessionsAndWait,
|
|
4314
4314
|
getProjectDir
|
|
4315
4315
|
};
|
|
4316
|
-
//# sourceMappingURL=chunk-
|
|
4316
|
+
//# sourceMappingURL=chunk-W4GVD3KK.js.map
|
|
@@ -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-
|
|
103
|
+
const { resolveClaudeBinary } = await import("./persistent-session-SZLOBXBQ.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-
|
|
376
|
+
//# sourceMappingURL=claude-pair-runtime-CE72HQE7.js.map
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
safeWriteJsonAtomic,
|
|
55
55
|
setConfigHash,
|
|
56
56
|
tripClass
|
|
57
|
-
} from "../chunk-
|
|
57
|
+
} from "../chunk-3JBA6RYG.js";
|
|
58
58
|
import {
|
|
59
59
|
getProjectDir as getProjectDir2,
|
|
60
60
|
getReadyTasks,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
takeZombieDetection,
|
|
111
111
|
toOpencodeModel,
|
|
112
112
|
writeEgressAllowlist
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-W4GVD3KK.js";
|
|
114
114
|
import {
|
|
115
115
|
ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
|
|
116
116
|
AnchorSessionClient,
|
|
@@ -187,7 +187,7 @@ import {
|
|
|
187
187
|
subagentActivityAgeSeconds,
|
|
188
188
|
sumTranscriptUsageInWindow,
|
|
189
189
|
transcriptActivityAgeSeconds
|
|
190
|
-
} from "../chunk-
|
|
190
|
+
} from "../chunk-JT2JQUK3.js";
|
|
191
191
|
import {
|
|
192
192
|
reapOrphanChannelMcps
|
|
193
193
|
} from "../chunk-XWVM4KPK.js";
|
|
@@ -1273,15 +1273,21 @@ function decideStaleTripClear(opts) {
|
|
|
1273
1273
|
|
|
1274
1274
|
// src/lib/pending-suppression-reports.ts
|
|
1275
1275
|
var pending = /* @__PURE__ */ new Map();
|
|
1276
|
-
function queueSuppressionReport(codeName, payload) {
|
|
1277
|
-
pending.
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1276
|
+
function queueSuppressionReport(codeName, reason, payload) {
|
|
1277
|
+
let byReason = pending.get(codeName);
|
|
1278
|
+
if (!byReason) {
|
|
1279
|
+
byReason = /* @__PURE__ */ new Map();
|
|
1280
|
+
pending.set(codeName, byReason);
|
|
1281
|
+
}
|
|
1282
|
+
byReason.set(reason, { ...payload, reason });
|
|
1283
|
+
}
|
|
1284
|
+
function takeSuppressionReports(codeName, agentId) {
|
|
1285
|
+
const byReason = pending.get(codeName);
|
|
1286
|
+
if (!byReason || byReason.size === 0) return [];
|
|
1287
|
+
if (!agentId) return [];
|
|
1288
|
+
const payloads = [...byReason.values()];
|
|
1283
1289
|
pending.delete(codeName);
|
|
1284
|
-
return
|
|
1290
|
+
return payloads;
|
|
1285
1291
|
}
|
|
1286
1292
|
|
|
1287
1293
|
// src/lib/resume-reconciler.ts
|
|
@@ -10895,6 +10901,28 @@ function recordRestartForBreaker(codeName, reason) {
|
|
|
10895
10901
|
}
|
|
10896
10902
|
}
|
|
10897
10903
|
const result = restartBreaker.record(codeName, reason, integrationKey);
|
|
10904
|
+
if (result.scheduledLoop) {
|
|
10905
|
+
const { count, windowMs, reason: loopReason } = result.scheduledLoop;
|
|
10906
|
+
const windowMins = Math.round(windowMs / 6e4);
|
|
10907
|
+
log(
|
|
10908
|
+
`[restart-breaker] agent=${codeName} SCHEDULED-RESTART LOOP: ${count} '${loopReason}' restarts in ${windowMins}m. A correct day rollover fires ONCE per agent per day, so this is a platform bug, not an unhealthy agent. The agent is deliberately NOT paused (ENG-9138) \u2014 reporting it instead so somebody fixes the rollover.`
|
|
10909
|
+
);
|
|
10910
|
+
queueSuppressionReport(codeName, "scheduled_rollover_loop", {
|
|
10911
|
+
trip_class: "scheduled",
|
|
10912
|
+
// No integration is involved in a scheduled restart, and the route renders
|
|
10913
|
+
// an empty key as "an unattributed integration" rather than inventing one.
|
|
10914
|
+
bucket_key: "",
|
|
10915
|
+
bucket_count: count,
|
|
10916
|
+
scheduled_window_ms: windowMs,
|
|
10917
|
+
scheduled_reason: loopReason,
|
|
10918
|
+
// Not applicable: this suppression has nothing to do with the agent's age
|
|
10919
|
+
// or the new-agent grace. Sent as null rather than 0, which would read as
|
|
10920
|
+
// "brand new" — the one wrong answer (same reasoning as ENG-8679 AC4).
|
|
10921
|
+
agent_age_ms: null,
|
|
10922
|
+
grace_expires_at: null
|
|
10923
|
+
});
|
|
10924
|
+
maybeReportPendingSuppression(codeName);
|
|
10925
|
+
}
|
|
10898
10926
|
if (!result.tripped || !result.trip) {
|
|
10899
10927
|
if (isProvisioningReloadReason(reason) && result.maxProvisioningBucket >= RESTART_BREAKER_PROVISIONING_MAX) {
|
|
10900
10928
|
const culprit = result.maxProvisioningBucketKey ? ` [${result.maxProvisioningBucketKey}]` : "";
|
|
@@ -10928,7 +10956,7 @@ function recordRestartForBreaker(codeName, reason) {
|
|
|
10928
10956
|
agent_age_ms: sup ? sup.agentAgeMs : null,
|
|
10929
10957
|
grace_expires_at: result.newAgentGraceExpiresAt ?? null
|
|
10930
10958
|
};
|
|
10931
|
-
queueSuppressionReport(codeName, suppressionPayload);
|
|
10959
|
+
queueSuppressionReport(codeName, "new_agent_grace", suppressionPayload);
|
|
10932
10960
|
if (!agentState.codeNameToAgentId.has(codeName)) {
|
|
10933
10961
|
log(
|
|
10934
10962
|
`[restart-breaker] agent=${codeName} suppression report DEFERRED: no agent_id known yet (cold-start before processAgent). The local suppression still applied; the report is queued and will be sent on the next poll once the id is cached (ENG-8679).`
|
|
@@ -10966,13 +10994,15 @@ function maybeReportCurrentTrip(codeName) {
|
|
|
10966
10994
|
}
|
|
10967
10995
|
function maybeReportPendingSuppression(codeName) {
|
|
10968
10996
|
const agentId = agentState.codeNameToAgentId.get(codeName);
|
|
10969
|
-
const
|
|
10970
|
-
if (
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10997
|
+
const payloads = takeSuppressionReports(codeName, agentId);
|
|
10998
|
+
if (payloads.length === 0 || !agentId) return;
|
|
10999
|
+
for (const payload of payloads) {
|
|
11000
|
+
void api.post("/host/circuit-breaker/suppressed", { agent_id: agentId, ...payload }).catch((err) => {
|
|
11001
|
+
log(
|
|
11002
|
+
`[restart-breaker] agent=${codeName} suppression report failed (non-fatal): ${err instanceof Error ? err.message : String(err)}`
|
|
11003
|
+
);
|
|
11004
|
+
});
|
|
11005
|
+
}
|
|
10976
11006
|
}
|
|
10977
11007
|
function maybeClearStaleTrip(agent) {
|
|
10978
11008
|
const codeName = agent.code_name;
|
|
@@ -11492,7 +11522,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
|
|
|
11492
11522
|
var dayRolloverInboundHold = /* @__PURE__ */ new Map();
|
|
11493
11523
|
var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
|
|
11494
11524
|
async function channelInboundActivityAgeSecondsFor(codeName) {
|
|
11495
|
-
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-
|
|
11525
|
+
const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-MDPLVVKC.js");
|
|
11496
11526
|
const newest = newestPendingInboundActivityMtimeMs(dirname9(paneLogPath(codeName)));
|
|
11497
11527
|
if (newest === null) return null;
|
|
11498
11528
|
return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
|
|
@@ -11878,13 +11908,17 @@ async function runAgentSessionToolBindProbes(agent, integrations, projectDir, op
|
|
|
11878
11908
|
// on a busy agent. Rolling probes keep the default cap.
|
|
11879
11909
|
...opts?.forceDue ? { maxPerRun: integrations.length } : {}
|
|
11880
11910
|
});
|
|
11881
|
-
if (result && result.reports.length > 0) {
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11911
|
+
if (result && (result.reports.length > 0 || result.skippedDetail.length > 0)) {
|
|
11912
|
+
if (result.reports.length > 0) {
|
|
11913
|
+
await api.post("/host/session-tool-bind", {
|
|
11914
|
+
agent_id: agent.agent_id,
|
|
11915
|
+
results: result.reports
|
|
11916
|
+
});
|
|
11917
|
+
}
|
|
11918
|
+
const naCount = result.reports.filter((r) => r.status === "not_applicable").length;
|
|
11919
|
+
const skipSummary = result.skippedDetail.length > 0 ? ` skipped=[${result.skippedDetail.map((s) => `${s.definition_id}:${s.reason}`).join(" ")}]` : "";
|
|
11886
11920
|
log(
|
|
11887
|
-
`Session-tool-bind probe${opts?.forceDue ? " (prompt, ENG-7429)" : ""} for '${agent.code_name}': probed=${result.probed} reported=${result.reports.length} due=${result.due}`
|
|
11921
|
+
`Session-tool-bind probe${opts?.forceDue ? " (prompt, ENG-7429)" : ""} for '${agent.code_name}': probed=${result.probed} reported=${result.reports.length} due=${result.due} not_applicable=${naCount}${skipSummary}`
|
|
11888
11922
|
);
|
|
11889
11923
|
}
|
|
11890
11924
|
if (result && result.rebindCandidates.length > 0 && hostFlagStore().getBoolean("session-tool-rebind")) {
|
|
@@ -12131,7 +12165,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
12131
12165
|
var lastVersionCheckAt = 0;
|
|
12132
12166
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
12133
12167
|
var lastResponsivenessProbeAt = 0;
|
|
12134
|
-
var agtCliVersion = true ? "0.28.
|
|
12168
|
+
var agtCliVersion = true ? "0.28.637" : "dev";
|
|
12135
12169
|
function resolveBrewPath(execFileSync3) {
|
|
12136
12170
|
try {
|
|
12137
12171
|
const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -13438,7 +13472,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
13438
13472
|
if (codeNames.length === 0) return;
|
|
13439
13473
|
void (async () => {
|
|
13440
13474
|
try {
|
|
13441
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
13475
|
+
const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
|
|
13442
13476
|
await api.post("/host/heartbeat", {
|
|
13443
13477
|
host_id: hostId,
|
|
13444
13478
|
agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
|
|
@@ -13554,7 +13588,7 @@ async function pollCycleInner() {
|
|
|
13554
13588
|
}
|
|
13555
13589
|
try {
|
|
13556
13590
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
13557
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
13591
|
+
const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
|
|
13558
13592
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
13559
13593
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
|
|
13560
13594
|
let tailscaleHostname;
|
|
@@ -13677,7 +13711,7 @@ async function pollCycleInner() {
|
|
|
13677
13711
|
collectPanelessActivityProbes,
|
|
13678
13712
|
getResponsivenessIntervalMs,
|
|
13679
13713
|
occupancyQualificationClassifications
|
|
13680
|
-
} = await import("../responsiveness-probe-
|
|
13714
|
+
} = await import("../responsiveness-probe-MDPLVVKC.js");
|
|
13681
13715
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
13682
13716
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
13683
13717
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -13783,7 +13817,7 @@ async function pollCycleInner() {
|
|
|
13783
13817
|
collectResponsivenessProbes,
|
|
13784
13818
|
livePendingInboundOldestAgeSeconds,
|
|
13785
13819
|
parkPendingInbound
|
|
13786
|
-
} = await import("../responsiveness-probe-
|
|
13820
|
+
} = await import("../responsiveness-probe-MDPLVVKC.js");
|
|
13787
13821
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
|
|
13788
13822
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
13789
13823
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -13939,7 +13973,7 @@ async function pollCycleInner() {
|
|
|
13939
13973
|
}
|
|
13940
13974
|
try {
|
|
13941
13975
|
const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
|
|
13942
|
-
const { probeSessionAuth } = await import("../session-auth-dead-
|
|
13976
|
+
const { probeSessionAuth } = await import("../session-auth-dead-ZLENJLLO.js");
|
|
13943
13977
|
const observations = [];
|
|
13944
13978
|
const pendingCacheCommits = [];
|
|
13945
13979
|
const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
|
|
@@ -17506,7 +17540,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
17506
17540
|
void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
|
|
17507
17541
|
void (async () => {
|
|
17508
17542
|
try {
|
|
17509
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
17543
|
+
const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
|
|
17510
17544
|
await api.post("/host/heartbeat", {
|
|
17511
17545
|
host_id: hostId,
|
|
17512
17546
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
|
|
@@ -17557,7 +17591,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
17557
17591
|
}
|
|
17558
17592
|
try {
|
|
17559
17593
|
const hostId = await getHostId();
|
|
17560
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
17594
|
+
const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
|
|
17561
17595
|
await api.post("/host/heartbeat", {
|
|
17562
17596
|
host_id: hostId,
|
|
17563
17597
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
|
|
@@ -18153,7 +18187,7 @@ async function processClaudePairSessions(agents) {
|
|
|
18153
18187
|
killPairSession,
|
|
18154
18188
|
pairTmuxSession,
|
|
18155
18189
|
finalizeClaudePairOnboarding
|
|
18156
|
-
} = await import("../claude-pair-runtime-
|
|
18190
|
+
} = await import("../claude-pair-runtime-CE72HQE7.js");
|
|
18157
18191
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
18158
18192
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
18159
18193
|
const killed = await killPairSession(pairTmuxSession(pairId));
|