@integrity-labs/agt-cli 0.28.884 → 0.28.886
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 +4 -4
- package/dist/{chunk-5P4R3IPC.js → chunk-2E7GOSID.js} +138 -62
- package/dist/chunk-2E7GOSID.js.map +1 -0
- package/dist/{chunk-YNYWVGHB.js → chunk-FP5M5OVX.js} +83 -26
- package/dist/chunk-FP5M5OVX.js.map +1 -0
- package/dist/{claude-pair-runtime-KASKEKMC.js → claude-pair-runtime-BQGZXRPV.js} +2 -2
- package/dist/lib/manager-worker.js +12 -12
- package/dist/{persistent-session-24MHPATY.js → persistent-session-SG4HA35I.js} +6 -2
- package/dist/{responsiveness-probe-AUCVVUFG.js → responsiveness-probe-3OEZ6D3O.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-5P4R3IPC.js.map +0 -1
- package/dist/chunk-YNYWVGHB.js.map +0 -1
- /package/dist/{claude-pair-runtime-KASKEKMC.js.map → claude-pair-runtime-BQGZXRPV.js.map} +0 -0
- /package/dist/{persistent-session-24MHPATY.js.map → persistent-session-SG4HA35I.js.map} +0 -0
- /package/dist/{responsiveness-probe-AUCVVUFG.js.map → responsiveness-probe-3OEZ6D3O.js.map} +0 -0
|
@@ -3985,6 +3985,77 @@ function collectMcpServerNames(mcpConfigPath) {
|
|
|
3985
3985
|
}
|
|
3986
3986
|
}
|
|
3987
3987
|
var PANE_AGENT_ID_PROBE_TIMEOUT_MS = 2e3;
|
|
3988
|
+
function applyPaneAgentIdVerdict(args) {
|
|
3989
|
+
const { session, mismatch, codeName, tmuxSession, log: log2 } = args;
|
|
3990
|
+
if (!mismatch) return false;
|
|
3991
|
+
log2(
|
|
3992
|
+
`[persistent-session] PANE AGENT ID MISMATCH agent=${codeName} isolation=${args.isolation} \u2014 ${mismatch}`
|
|
3993
|
+
);
|
|
3994
|
+
session.status = "crashed";
|
|
3995
|
+
session.startedAt = args.now ? args.now() : Date.now();
|
|
3996
|
+
log2(
|
|
3997
|
+
`[persistent-session] requesting kill of session '${tmuxSession}' for '${codeName}' \u2014 refusing to run an agent under another agent's identity (ENG-8800)`
|
|
3998
|
+
);
|
|
3999
|
+
let teardown;
|
|
4000
|
+
try {
|
|
4001
|
+
teardown = Promise.resolve(args.killSession(tmuxSession));
|
|
4002
|
+
} catch (err) {
|
|
4003
|
+
teardown = Promise.resolve({
|
|
4004
|
+
ok: false,
|
|
4005
|
+
reason: `could not start the kill: ${err instanceof Error ? err.message : String(err)}`
|
|
4006
|
+
});
|
|
4007
|
+
}
|
|
4008
|
+
void teardown.catch((err) => ({
|
|
4009
|
+
ok: false,
|
|
4010
|
+
reason: `the kill rejected: ${err instanceof Error ? err.message : String(err)}`
|
|
4011
|
+
})).then((result) => {
|
|
4012
|
+
if (result?.ok) {
|
|
4013
|
+
log2(`[persistent-session] killed session '${tmuxSession}' for '${codeName}' (ENG-8800)`);
|
|
4014
|
+
} else {
|
|
4015
|
+
const reason = result && !result.ok ? result.reason : "no result from the kill";
|
|
4016
|
+
log2(
|
|
4017
|
+
`[persistent-session] FAILED TO KILL session '${tmuxSession}' for '${codeName}': ${reason}. It is marked crashed, but its pane may still be running under another agent's identity. Kill it by hand: tmux kill-session -t ${tmuxSession} (ENG-8800)`
|
|
4018
|
+
);
|
|
4019
|
+
}
|
|
4020
|
+
args.onTeardownSettled?.(result ?? { ok: false, reason: "no result from the kill" });
|
|
4021
|
+
});
|
|
4022
|
+
return true;
|
|
4023
|
+
}
|
|
4024
|
+
function killTmuxSessionBounded(tmuxSession, deps = {}) {
|
|
4025
|
+
const spawnFn = deps.spawnFn ?? spawn2;
|
|
4026
|
+
const timeoutMs = deps.timeoutMs ?? PANE_AGENT_ID_PROBE_TIMEOUT_MS;
|
|
4027
|
+
return new Promise((resolve) => {
|
|
4028
|
+
let deadline;
|
|
4029
|
+
let settled = false;
|
|
4030
|
+
const settle = (result) => {
|
|
4031
|
+
if (settled) return;
|
|
4032
|
+
settled = true;
|
|
4033
|
+
if (deadline) clearTimeout(deadline);
|
|
4034
|
+
resolve(result);
|
|
4035
|
+
};
|
|
4036
|
+
let killer;
|
|
4037
|
+
try {
|
|
4038
|
+
killer = spawnFn("tmux", ["kill-session", "-t", tmuxSession], { stdio: "ignore" });
|
|
4039
|
+
} catch (err) {
|
|
4040
|
+
settle({ ok: false, reason: `could not spawn tmux: ${err instanceof Error ? err.message : String(err)}` });
|
|
4041
|
+
return;
|
|
4042
|
+
}
|
|
4043
|
+
deadline = setTimeout(() => {
|
|
4044
|
+
try {
|
|
4045
|
+
killer.kill("SIGKILL");
|
|
4046
|
+
} catch {
|
|
4047
|
+
}
|
|
4048
|
+
settle({ ok: false, reason: `tmux kill-session did not exit within ${timeoutMs}ms` });
|
|
4049
|
+
}, timeoutMs);
|
|
4050
|
+
deadline.unref?.();
|
|
4051
|
+
killer.on("error", (err) => {
|
|
4052
|
+
settle({ ok: false, reason: `tmux kill-session could not run: ${err.message}` });
|
|
4053
|
+
});
|
|
4054
|
+
killer.on("close", (code, signal) => {
|
|
4055
|
+
settle(code === 0 ? { ok: true } : { ok: false, reason: `tmux kill-session exited ${code ?? signal}` });
|
|
4056
|
+
});
|
|
4057
|
+
});
|
|
4058
|
+
}
|
|
3988
4059
|
var REQUIRED_SPAWN_ENV = ["AGT_AGENT_ID", "AGT_HOST", "AGT_API_KEY"];
|
|
3989
4060
|
function buildSpawnEnv(args) {
|
|
3990
4061
|
const { base, agentId, runId } = args;
|
|
@@ -4670,31 +4741,15 @@ function spawnSession(config, session) {
|
|
|
4670
4741
|
showEnvOutput: output,
|
|
4671
4742
|
expectedAgentId: config.agentId
|
|
4672
4743
|
});
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
});
|
|
4683
|
-
const killDeadline = setTimeout(() => {
|
|
4684
|
-
try {
|
|
4685
|
-
killer.kill("SIGKILL");
|
|
4686
|
-
} catch {
|
|
4687
|
-
}
|
|
4688
|
-
}, PANE_AGENT_ID_PROBE_TIMEOUT_MS);
|
|
4689
|
-
killDeadline.unref?.();
|
|
4690
|
-
killer.on("error", () => clearTimeout(killDeadline));
|
|
4691
|
-
killer.on("close", () => clearTimeout(killDeadline));
|
|
4692
|
-
} catch {
|
|
4693
|
-
}
|
|
4694
|
-
log2(
|
|
4695
|
-
`[persistent-session] killed session '${tmuxSession}' for '${codeName}' \u2014 refusing to run an agent under another agent's identity (ENG-8800)`
|
|
4696
|
-
);
|
|
4697
|
-
}
|
|
4744
|
+
applyPaneAgentIdVerdict({
|
|
4745
|
+
session,
|
|
4746
|
+
mismatch,
|
|
4747
|
+
codeName,
|
|
4748
|
+
tmuxSession,
|
|
4749
|
+
isolation: effectiveMode,
|
|
4750
|
+
log: log2,
|
|
4751
|
+
killSession: killTmuxSessionBounded
|
|
4752
|
+
});
|
|
4698
4753
|
};
|
|
4699
4754
|
const deadline = setTimeout(() => {
|
|
4700
4755
|
settle(null);
|
|
@@ -5401,6 +5456,8 @@ export {
|
|
|
5401
5456
|
buildDockerRunCommand,
|
|
5402
5457
|
writePersistentClaudeWrapper,
|
|
5403
5458
|
PANE_AGENT_ID_PROBE_TIMEOUT_MS,
|
|
5459
|
+
applyPaneAgentIdVerdict,
|
|
5460
|
+
killTmuxSessionBounded,
|
|
5404
5461
|
REQUIRED_SPAWN_ENV,
|
|
5405
5462
|
buildSpawnEnv,
|
|
5406
5463
|
findMissingSpawnEnv,
|
|
@@ -5441,4 +5498,4 @@ export {
|
|
|
5441
5498
|
stopAllSessionsAndWait,
|
|
5442
5499
|
getProjectDir
|
|
5443
5500
|
};
|
|
5444
|
-
//# sourceMappingURL=chunk-
|
|
5501
|
+
//# sourceMappingURL=chunk-FP5M5OVX.js.map
|