@integrity-labs/agt-cli 0.25.0 → 0.25.1

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-3SNFKR2Q.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-3FQVLVJM.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-SENCKRI4.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-ZWE5572F.js.map
@@ -13,7 +13,7 @@ import {
13
13
  provisionOrientHook,
14
14
  provisionStopHook,
15
15
  requireHost
16
- } from "../chunk-5PS4FY7I.js";
16
+ } from "../chunk-AAK2IU2Z.js";
17
17
  import {
18
18
  findTaskByTemplate,
19
19
  getProjectDir as getProjectDir2,
@@ -50,7 +50,7 @@ import {
50
50
  stopAllSessionsAndWait,
51
51
  stopPersistentSession,
52
52
  takeZombieDetection
53
- } from "../chunk-IEVHEZV4.js";
53
+ } from "../chunk-4FSQVXWB.js";
54
54
  import {
55
55
  KANBAN_CHECK_COMMAND,
56
56
  appendDmFooter,
@@ -71,7 +71,7 @@ import {
71
71
  resolveChannels,
72
72
  resolveDmTarget,
73
73
  wrapScheduledTaskPrompt
74
- } from "../chunk-7DRLULIO.js";
74
+ } from "../chunk-4K3ERUGE.js";
75
75
 
76
76
  // src/lib/manager-worker.ts
77
77
  import { createHash as createHash3 } from "crypto";
@@ -681,6 +681,16 @@ function formatStatusMessage(events, windowMs) {
681
681
  return `Circuit breaker tripped: ${events.length} restarts in ${windowLabel} (${breakdown}); most recent=${last.reason} at ${new Date(last.at).toISOString()}`;
682
682
  }
683
683
 
684
+ // src/lib/model-change-respawn.ts
685
+ function shouldRespawnForModelChange(input) {
686
+ const { previousModel, primaryModel, framework, sessionHealthy } = input;
687
+ if (framework !== "claude-code") return false;
688
+ if (!sessionHealthy) return false;
689
+ if (!previousModel) return false;
690
+ if (!primaryModel) return false;
691
+ return previousModel !== primaryModel;
692
+ }
693
+
684
694
  // src/lib/usage-banner-monitor.ts
685
695
  var MIN_CHECK_INTERVAL_MS = 6e4;
686
696
  var PANE_TAIL_LINES_FOR_BANNER = 200;
@@ -2852,7 +2862,7 @@ var cachedFrameworkVersion = null;
2852
2862
  var lastVersionCheckAt = 0;
2853
2863
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
2854
2864
  var lastResponsivenessProbeAt = 0;
2855
- var agtCliVersion = true ? "0.25.0" : "dev";
2865
+ var agtCliVersion = true ? "0.25.1" : "dev";
2856
2866
  function resolveBrewPath(execFileSync4) {
2857
2867
  try {
2858
2868
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -3811,7 +3821,7 @@ async function pollCycle() {
3811
3821
  }
3812
3822
  try {
3813
3823
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
3814
- const { collectDiagnostics } = await import("../persistent-session-3SNFKR2Q.js");
3824
+ const { collectDiagnostics } = await import("../persistent-session-3FQVLVJM.js");
3815
3825
  const diagCodeNames = [...persistentSessionAgents];
3816
3826
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
3817
3827
  let tailscaleHostname;
@@ -3869,7 +3879,7 @@ async function pollCycle() {
3869
3879
  const {
3870
3880
  collectResponsivenessProbes,
3871
3881
  getResponsivenessIntervalMs
3872
- } = await import("../responsiveness-probe-UBNJFMAU.js");
3882
+ } = await import("../responsiveness-probe-M7PUFD5V.js");
3873
3883
  const probeIntervalMs = getResponsivenessIntervalMs();
3874
3884
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
3875
3885
  const probeCodeNames = [...persistentSessionAgents];
@@ -4485,6 +4495,27 @@ async function processAgent(agent, agentStates) {
4485
4495
  } catch (err) {
4486
4496
  log(`Failed to update model for '${agent.code_name}': ${err.message}`);
4487
4497
  }
4498
+ if (shouldRespawnForModelChange({
4499
+ previousModel,
4500
+ primaryModel,
4501
+ framework: frameworkId,
4502
+ sessionHealthy: isSessionHealthy(agent.code_name)
4503
+ })) {
4504
+ const restartNotice = `Your model was changed to ${primaryModel}. Claude Code applies the model at launch, so your manager will restart your session shortly to switch.`;
4505
+ const delivered = await injectMessage(
4506
+ agent.code_name,
4507
+ "system",
4508
+ restartNotice,
4509
+ { task_name: "model-update" },
4510
+ log
4511
+ ).catch(() => false);
4512
+ const delay = delivered ? 8e3 : 3e3;
4513
+ if (!delivered) {
4514
+ log(`[hot-reload] Inject notification unconfirmed for '${agent.code_name}' \u2014 proceeding with shorter delay`);
4515
+ }
4516
+ log(`[hot-reload] Model changed for '${agent.code_name}': ${previousModel} \u2192 ${primaryModel} \u2014 restarting session`);
4517
+ scheduleSessionRestart(agent.code_name, delay, "model change", "model-change");
4518
+ }
4488
4519
  }
4489
4520
  knownModels.set(agent.agent_id, primaryModel);
4490
4521
  }
@@ -6340,6 +6371,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash3("sha256").
6340
6371
  source_type: "system",
6341
6372
  metadata: { type: "persistent_session_boot" }
6342
6373
  });
6374
+ const spawnPrimaryModel = resolveModelChain(refreshData).primary ?? refreshData.agent?.["primary_model"] ?? null;
6343
6375
  startPersistentSession({
6344
6376
  codeName,
6345
6377
  agentId: agent.agent_id,
@@ -6351,6 +6383,7 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash3("sha256").
6351
6383
  apiHost: requireHost(),
6352
6384
  claudeAuthMode,
6353
6385
  anthropicApiKey,
6386
+ primaryModel: spawnPrimaryModel,
6354
6387
  runId: sessionRunResult.run_id,
6355
6388
  agentTimezone,
6356
6389
  log
@@ -7842,7 +7875,7 @@ async function processClaudePairSessions(agents) {
7842
7875
  killPairSession,
7843
7876
  pairTmuxSession,
7844
7877
  finalizeClaudePairOnboarding
7845
- } = await import("../claude-pair-runtime-SENCKRI4.js");
7878
+ } = await import("../claude-pair-runtime-ZWE5572F.js");
7846
7879
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
7847
7880
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
7848
7881
  const killed = await killPairSession(pairTmuxSession(pairId));