@integrity-labs/agt-cli 0.28.1257 → 0.28.1258
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/{api-client-6W27Z5SN.js → api-client-E5AB7DBB.js} +2 -2
- package/dist/bin/agt.js +4 -4
- package/dist/{chunk-HXM2V3VK.js → chunk-DISUKAOD.js} +2 -2
- package/dist/{chunk-W6NQLEKG.js → chunk-W2TGJEF3.js} +12 -9
- package/dist/chunk-W2TGJEF3.js.map +1 -0
- package/dist/lib/manager-worker.js +56 -29
- package/dist/lib/manager-worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-W6NQLEKG.js.map +0 -1
- /package/dist/{api-client-6W27Z5SN.js.map → api-client-E5AB7DBB.js.map} +0 -0
- /package/dist/{chunk-HXM2V3VK.js.map → chunk-DISUKAOD.js.map} +0 -0
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
tripClass,
|
|
70
70
|
writeEtcEnvironment,
|
|
71
71
|
writeProfileDScript
|
|
72
|
-
} from "../chunk-
|
|
72
|
+
} from "../chunk-W2TGJEF3.js";
|
|
73
73
|
import {
|
|
74
74
|
ApiError,
|
|
75
75
|
adoptHostKeyInProcess,
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
probeHostKey,
|
|
88
88
|
requireHost,
|
|
89
89
|
setConfigHash
|
|
90
|
-
} from "../chunk-
|
|
90
|
+
} from "../chunk-DISUKAOD.js";
|
|
91
91
|
import {
|
|
92
92
|
BLOCKED_ON_PROMPT_DECISION,
|
|
93
93
|
CHANNEL_SECRET_ENV_KEYS,
|
|
@@ -527,6 +527,36 @@ function staleSessionStopConfirmed(sessionState) {
|
|
|
527
527
|
return sessionState === "dead";
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
+
// src/lib/config-reload-confirm.ts
|
|
531
|
+
function staleReloadTmuxSession(framework, codeName) {
|
|
532
|
+
return framework === "opencode" ? opencodeTmuxSession(codeName) : `agt-${codeName}`;
|
|
533
|
+
}
|
|
534
|
+
function confirmConfigReload(input, deps) {
|
|
535
|
+
if (!configReloadConfirmed({ pending: input.pending, freshFetch: input.freshFetch, rendered: input.rendered })) {
|
|
536
|
+
return { action: "not_ready" };
|
|
537
|
+
}
|
|
538
|
+
const session = staleReloadTmuxSession(input.framework, input.codeName);
|
|
539
|
+
let stopped = false;
|
|
540
|
+
if (deps.probe(session) === "alive") {
|
|
541
|
+
deps.log(
|
|
542
|
+
`[restart] '${input.codeName}' is running config from before the reload's fresh render - restarting it (ENG-11912)`
|
|
543
|
+
);
|
|
544
|
+
if (input.framework === "opencode") deps.stopOpencode(input.codeName);
|
|
545
|
+
else deps.stopClaudeCode(input.codeName);
|
|
546
|
+
stopped = true;
|
|
547
|
+
}
|
|
548
|
+
const sessionState = deps.probe(session);
|
|
549
|
+
if (staleSessionStopConfirmed(sessionState)) {
|
|
550
|
+
deps.confirm(input.agentId);
|
|
551
|
+
deps.log(`[restart] config-change reload for '${input.codeName}' rendered from fresh integrations - acking (ENG-11912)`);
|
|
552
|
+
return { action: "acked", stopped };
|
|
553
|
+
}
|
|
554
|
+
deps.log(
|
|
555
|
+
`[restart] STALE_SESSION_STOP_FAILED agent='${input.codeName}' session_state=${sessionState}: the session spawned from pre-reload config is still running or could not be probed, so the config-change reload stays pending and the stop is retried next poll (ENG-11912)`
|
|
556
|
+
);
|
|
557
|
+
return { action: "stop_unconfirmed", sessionState, stopped };
|
|
558
|
+
}
|
|
559
|
+
|
|
530
560
|
// src/lib/manager-worker.ts
|
|
531
561
|
import { createHash as createHash20 } from "crypto";
|
|
532
562
|
import { readFileSync as readFileSync35, writeFileSync as writeFileSync18, mkdirSync as mkdirSync16, existsSync as existsSync19, rmSync as rmSync8, readdirSync as readdirSync14, statSync as statSync15, unlinkSync as unlinkSync6, renameSync as renameSync11, utimesSync as utimesSync4, readlinkSync as readlinkSync2 } from "fs";
|
|
@@ -14157,7 +14187,7 @@ function createFileMigrationReportIO(codeName, log2) {
|
|
|
14157
14187
|
};
|
|
14158
14188
|
}
|
|
14159
14189
|
var managerHostPost = async (path, body) => {
|
|
14160
|
-
const { api: api2, ApiError: ApiError3 } = await import("../api-client-
|
|
14190
|
+
const { api: api2, ApiError: ApiError3 } = await import("../api-client-E5AB7DBB.js");
|
|
14161
14191
|
try {
|
|
14162
14192
|
const json = await api2.post(path, body);
|
|
14163
14193
|
return { status: 200, json };
|
|
@@ -17012,7 +17042,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
17012
17042
|
var lastVersionCheckAt = 0;
|
|
17013
17043
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
17014
17044
|
var lastResponsivenessProbeAt = 0;
|
|
17015
|
-
var agtCliVersion = true ? "0.28.
|
|
17045
|
+
var agtCliVersion = true ? "0.28.1258" : "dev";
|
|
17016
17046
|
function resolveBrewPath(execFileSync4) {
|
|
17017
17047
|
try {
|
|
17018
17048
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -22648,35 +22678,32 @@ async function processAgent(agent, agentStates, managedToolkits) {
|
|
|
22648
22678
|
if (markMcpRepairPending(agentState.knownIntegrationHashes, agent.agent_id, orphanPruneFailed || mcpWriteFailed || !rotationHandled)) {
|
|
22649
22679
|
log(`[hot-reload] '${agent.code_name}': MCP config writes did not all land this poll; the next poll re-renders to repair them (ENG-11912)`);
|
|
22650
22680
|
}
|
|
22651
|
-
|
|
22652
|
-
|
|
22653
|
-
|
|
22654
|
-
|
|
22655
|
-
|
|
22656
|
-
|
|
22657
|
-
|
|
22658
|
-
|
|
22659
|
-
|
|
22660
|
-
|
|
22661
|
-
|
|
22662
|
-
|
|
22681
|
+
confirmConfigReload(
|
|
22682
|
+
{
|
|
22683
|
+
agentId: agent.agent_id,
|
|
22684
|
+
codeName: agent.code_name,
|
|
22685
|
+
framework: agentFrameworkCache.get(agent.code_name) ?? DEFAULT_FRAMEWORK,
|
|
22686
|
+
pending: configReloads.isPending(agent.agent_id),
|
|
22687
|
+
freshFetch: integrationsFresh,
|
|
22688
|
+
rendered: rotationHandled && !orphanPruneFailed && !mcpWriteFailed
|
|
22689
|
+
},
|
|
22690
|
+
{
|
|
22691
|
+
// CodeRabbit on ba9356f4: the tri-state probe, not the boolean health
|
|
22692
|
+
// checks, which read a tmux error (timeout, missing binary) as "no
|
|
22693
|
+
// session" and would confirm over a session that may still be running.
|
|
22694
|
+
probe: probeTmuxSession,
|
|
22695
|
+
stopOpencode: (code) => stopOpencodeSession(code, log),
|
|
22696
|
+
stopClaudeCode: (code) => {
|
|
22663
22697
|
try {
|
|
22664
|
-
syncExecFile("tmux", ["kill-session", "-t", `agt-${
|
|
22698
|
+
syncExecFile("tmux", ["kill-session", "-t", `agt-${code}`], { stdio: "ignore" });
|
|
22665
22699
|
} catch {
|
|
22666
22700
|
}
|
|
22667
|
-
stopPersistentSessionAndForgetMcpBaseline(
|
|
22668
|
-
}
|
|
22669
|
-
|
|
22670
|
-
|
|
22671
|
-
if (staleSessionStopConfirmed(staleSessionState)) {
|
|
22672
|
-
configReloads.confirm(agent.agent_id);
|
|
22673
|
-
log(`[restart] config-change reload for '${agent.code_name}' rendered from fresh integrations - acking (ENG-11912)`);
|
|
22674
|
-
} else {
|
|
22675
|
-
log(
|
|
22676
|
-
`[restart] STALE_SESSION_STOP_FAILED agent='${agent.code_name}' session_state=${staleSessionState}: the session spawned from pre-reload config is still running or could not be probed, so the config-change reload stays pending and the stop is retried next poll (ENG-11912)`
|
|
22677
|
-
);
|
|
22701
|
+
stopPersistentSessionAndForgetMcpBaseline(code, "integration-change");
|
|
22702
|
+
},
|
|
22703
|
+
confirm: (agentId) => configReloads.confirm(agentId),
|
|
22704
|
+
log
|
|
22678
22705
|
}
|
|
22679
|
-
|
|
22706
|
+
);
|
|
22680
22707
|
if (capSurfaceHash !== prevCapSurfaceHash && rotationHandled) {
|
|
22681
22708
|
if (intFlap.flapping) {
|
|
22682
22709
|
log(`[mcp-flap-dampener] suppressed integration-update notice for '${agent.code_name}' (set flapping, ENG-6123): ${capSurfaceNames}`);
|