@integrity-labs/agt-cli 0.28.204 → 0.28.206

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.
@@ -3,7 +3,7 @@ import {
3
3
  formatMissingVar,
4
4
  isClaudeFastMode,
5
5
  probeMcpEnvSubstitution
6
- } from "./chunk-2AWUVRIX.js";
6
+ } from "./chunk-ELBYWACS.js";
7
7
  import {
8
8
  reapOrphanChannelMcps
9
9
  } from "./chunk-XWVM4KPK.js";
@@ -554,6 +554,10 @@ function syncClaudeCredsToRoot() {
554
554
  return false;
555
555
  }
556
556
  }
557
+ function resolveOAuthCredAction(claudeAuthMode, openRouterMode) {
558
+ if (openRouterMode) return "sync";
559
+ return claudeAuthMode === "api_key" ? "purge" : "sync";
560
+ }
557
561
  var cachedClaudePath = null;
558
562
  function resolveClaudeBinary() {
559
563
  if (cachedClaudePath) return cachedClaudePath;
@@ -924,9 +928,16 @@ function spawnSession(config, session) {
924
928
  execSync(`tmux kill-session -t ${tmuxSession} 2>/dev/null`, { stdio: "ignore" });
925
929
  } catch {
926
930
  }
927
- if (claudeAuthMode === "subscription" && !openRouterMode) {
931
+ if (resolveOAuthCredAction(claudeAuthMode, openRouterMode) === "sync") {
928
932
  const credsSynced = syncClaudeCredsToRoot();
929
- if (!credsSynced && platform() === "linux" && typeof process.getuid === "function" && process.getuid() === 0) {
933
+ const onLinuxRoot = platform() === "linux" && typeof process.getuid === "function" && process.getuid() === 0;
934
+ if (openRouterMode) {
935
+ if (credsSynced) {
936
+ log(`[persistent-session] OpenRouter mode for '${codeName}' - model=${config.openRouter.model}; inference via OpenRouter, claude.ai OAuth retained for channels.`);
937
+ } else if (onLinuxRoot) {
938
+ log(`[persistent-session] OpenRouter mode for '${codeName}' - model=${config.openRouter.model}; no claude.ai OAuth creds under /root/.claude or /home/*, so channels (Telegram/Slack/direct-chat) will not load. Inference still works via OpenRouter. Run 'claude /login' on the host to enable channels.`);
939
+ }
940
+ } else if (!credsSynced && onLinuxRoot) {
930
941
  log(`[persistent-session] No Claude Code credentials found under /root/.claude or /home/*. Pair via browser from the host page, or run 'claude /login' on the host.`);
931
942
  }
932
943
  } else {
@@ -941,9 +952,7 @@ function spawnSession(config, session) {
941
952
  }
942
953
  }
943
954
  }
944
- if (openRouterMode) {
945
- log(`[persistent-session] OpenRouter mode for '${codeName}' \u2014 model=${config.openRouter.model} (OAuth creds purged; using ANTHROPIC_BASE_URL override)`);
946
- } else if (!config.anthropicApiKey) {
955
+ if (!config.anthropicApiKey) {
947
956
  log(`[persistent-session] api_key mode but no anthropicApiKey passed. Session will fail auth.`);
948
957
  }
949
958
  }
@@ -1585,6 +1594,7 @@ export {
1585
1594
  checkChannelInputs,
1586
1595
  takeWatchdogGiveUpCount,
1587
1596
  creditWatchdogGiveUpCount,
1597
+ resolveOAuthCredAction,
1588
1598
  resolveClaudeBinary,
1589
1599
  isolationMode,
1590
1600
  EGRESS_BASELINE_DOMAINS,
@@ -1621,4 +1631,4 @@ export {
1621
1631
  stopAllSessionsAndWait,
1622
1632
  getProjectDir
1623
1633
  };
1624
- //# sourceMappingURL=chunk-2A2EV3B3.js.map
1634
+ //# sourceMappingURL=chunk-GWBOA7ZY.js.map