@integrity-labs/agt-cli 0.28.529 → 0.28.531

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.
@@ -14493,6 +14493,21 @@ function collectMcpServerNames(mcpConfigPath) {
14493
14493
  return [];
14494
14494
  }
14495
14495
  }
14496
+ var REQUIRED_SPAWN_ENV = ["AGT_AGENT_ID", "AGT_HOST", "AGT_API_KEY"];
14497
+ function buildSpawnEnv(args) {
14498
+ const { base, agentId, runId } = args;
14499
+ const env2 = {
14500
+ ...base,
14501
+ HOME: base.HOME?.trim() || homedir6(),
14502
+ USER: base.USER?.trim() || userInfo2().username
14503
+ };
14504
+ if (runId) env2["AGT_RUN_ID"] = runId;
14505
+ env2["AGT_AGENT_ID"] = agentId;
14506
+ return env2;
14507
+ }
14508
+ function findMissingSpawnEnv(env2) {
14509
+ return REQUIRED_SPAWN_ENV.filter((k) => !env2[k]?.trim());
14510
+ }
14496
14511
  var sessions2 = /* @__PURE__ */ new Map();
14497
14512
  var PANE_LOG_DIR = join6(homedir6(), ".augmented");
14498
14513
  var PANE_TAIL_LINES = 20;
@@ -14828,17 +14843,11 @@ function spawnSession(config, session) {
14828
14843
  forwardTurnFailureNotice: !!process.env["AGT_WEDGE_TRANSIENT_NOTICE_ENABLED"] || // feature-gate-allow: registry-flag envVar operator-override precedence, not a new gate
14829
14844
  !!config.turnFailureNoticeEnabled
14830
14845
  }) : JSON.stringify(wrapperPath);
14831
- const tmuxEnv = {
14832
- ...process.env,
14833
- // Treat empty-string as missing too — `HOME=""` makes ~ resolve
14834
- // to cwd, which is the same broken outcome as no HOME, just
14835
- // better hidden.
14836
- HOME: process.env.HOME?.trim() || homedir6(),
14837
- USER: process.env.USER?.trim() || userInfo2().username
14838
- };
14839
- if (config.runId) {
14840
- tmuxEnv["AGT_RUN_ID"] = config.runId;
14841
- }
14846
+ const tmuxEnv = buildSpawnEnv({
14847
+ base: process.env,
14848
+ agentId: config.agentId,
14849
+ runId: config.runId
14850
+ });
14842
14851
  const apiKeyEnv = !openRouterMode && claudeAuthMode === "api_key" && config.anthropicApiKey ? { ANTHROPIC_API_KEY: config.anthropicApiKey } : {};
14843
14852
  const openRouterEnv = openRouterMode ? {
14844
14853
  ANTHROPIC_BASE_URL: OPENROUTER_ANTHROPIC_BASE_URL,
@@ -14862,6 +14871,12 @@ function spawnSession(config, session) {
14862
14871
  })) {
14863
14872
  log2(`[persistent-session] ${formatMissingVar(f)} agent=${codeName}`);
14864
14873
  }
14874
+ const missingSpawnEnv = findMissingSpawnEnv(probeBaseEnv);
14875
+ for (const key of missingSpawnEnv) {
14876
+ log2(
14877
+ `[persistent-session] MISSING SPAWN ENV ${key} agent=${codeName} isolation=${isolationMode(codeName)} \u2014 programs reading process.env.${key} will fail (e.g. the agt-bin/gh GitHub credential shim hard-exits without AGT_AGENT_ID, taking every git fetch/push with it)`
14878
+ );
14879
+ }
14865
14880
  const child = spawn2("tmux", [
14866
14881
  "new-session",
14867
14882
  "-d",
@@ -15604,6 +15619,9 @@ export {
15604
15619
  restartEgressSidecar,
15605
15620
  buildDockerRunCommand,
15606
15621
  writePersistentClaudeWrapper,
15622
+ REQUIRED_SPAWN_ENV,
15623
+ buildSpawnEnv,
15624
+ findMissingSpawnEnv,
15607
15625
  paneLogPath,
15608
15626
  rotatePaneLogForDayRollover,
15609
15627
  readPaneLogTail,
@@ -15631,4 +15649,4 @@ export {
15631
15649
  stopAllSessionsAndWait,
15632
15650
  getProjectDir
15633
15651
  };
15634
- //# sourceMappingURL=chunk-Q4XGKOHZ.js.map
15652
+ //# sourceMappingURL=chunk-3FCJXTHW.js.map