botmux 2.80.0 → 2.81.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.
package/dist/worker.js CHANGED
@@ -39,7 +39,7 @@ import { t, setDefaultLocale } from './i18n/index.js';
39
39
  import { TerminalRenderer } from './utils/terminal-renderer.js';
40
40
  import { DEFAULT_RENDER_COLS, DEFAULT_RENDER_ROWS, MAX_RENDER_COLS, MAX_RENDER_ROWS, MIN_RENDER_COLS, MIN_RENDER_ROWS, clamp, resolveRenderDimensions, } from './utils/render-dimensions.js';
41
41
  import { createCliAdapterSync, locateOnPath } from './adapters/cli/registry.js';
42
- import { buildWrappedLaunch } from './setup/cli-selection.js';
42
+ import { buildWrappedLaunch, parseWrapperCli } from './setup/cli-selection.js';
43
43
  import { findLaunchedCliPid, scheduleWrapperRealCliPid } from './core/session-discovery.js';
44
44
  import { claudeJsonlPathForSession, resolveJsonlFromPid, findOpenClaudeSessionIds, DEFAULT_CLAUDE_DATA_DIR } from './adapters/cli/claude-code.js';
45
45
  import { mtrSessionIdForBotmuxSession } from './adapters/cli/mtr.js';
@@ -3913,6 +3913,13 @@ function spawnCli(cfg) {
3913
3913
  // bin 走 PATH 解析),无需 wrapper 脚本、跨系统。aiden x claude 形态会剥掉 aiden 拒收的
3914
3914
  // --settings(见 buildWrappedLaunch)。与文件沙盒互斥:沙盒已把命令重写成 bwrap,叠加
3915
3915
  // 前缀会破坏隔离,故 sandboxOn 时跳过并告警(网关 + oncall 沙盒本就不是合理组合)。
3916
+ // CJADK_INTERACTIVE is a cjadk-only knob we set on the cjadk wrapper branch
3917
+ // below. Strip any value inherited from the daemon's own env first so a
3918
+ // daemon launched under `cjadk feishu` (which exports it) can't leak it via
3919
+ // the tmux env allowlist into EVERY bot's pane — only the cjadk branch should
3920
+ // ever (re)set it. Harmless for non-cjadk CLIs (they don't read it), but this
3921
+ // keeps the behaviour intentional rather than ambient. (Codex review note.)
3922
+ delete childEnv.CJADK_INTERACTIVE;
3916
3923
  if (cfg.wrapperCli && cfg.wrapperCli.trim()) {
3917
3924
  if (sandboxOn) {
3918
3925
  log(`wrapperCli="${cfg.wrapperCli}" ignored: file sandbox enabled and takes precedence (cannot combine launch prefix with bwrap)`);
@@ -3923,6 +3930,19 @@ function spawnCli(cfg) {
3923
3930
  spawnBin = launch.bin;
3924
3931
  spawnArgs = launch.args;
3925
3932
  log(`Launch prefix: spawning ${spawnBin} ${spawnArgs.slice(0, 2).join(' ')} … (cliId=${cfg.cliId})`);
3933
+ // cjadk runs its launched agent in an INTERACTIVE wrapper by default —
3934
+ // a model/session selector at startup plus terminal quirks that fight
3935
+ // botmux's automated input (the selector eats the first prompt; the
3936
+ // pre-render lag fragments multi-line messages; follow-ups can stick in
3937
+ // the input box). cjadk's own botmux integration (`cjadk feishu`, see its
3938
+ // botmux-wrapper-writer) sets CJADK_INTERACTIVE=0 to disable all of that.
3939
+ // We mirror it here so a `cjadk <agent>` wrapperCli is driven the way
3940
+ // cjadk intends — no selector, clean soft-newline input. Keyed on the
3941
+ // wrapper's leading token so only cjadk launches are affected.
3942
+ if (parseWrapperCli(cfg.wrapperCli)[0] === 'cjadk') {
3943
+ childEnv.CJADK_INTERACTIVE = '0';
3944
+ log('cjadk launcher: set CJADK_INTERACTIVE=0 (non-interactive, mirrors cjadk feishu wrapper)');
3945
+ }
3926
3946
  }
3927
3947
  }
3928
3948
  }