[Bug]: 会话内 client terminal 不携带 AIONUI_* 运行期变量 —— $AIONUI_HELPER_BIN 为空,内置技能与 aioncore config CLI 不可用
Author: marce006982Created Sep 15, 2026Updated Sep 15, 2026
Labelsneeds-triage
环境
- AionUi 2.2.2;Windows 11 Pro(10.0.26200)
- aioncore v0.2.2(bundled;
resources/bundled-aioncore/win32-x64/manifest.json标"version": "v0.2.2",2026-09-09 构建) - 会话 agent:Kimi Code(aioncore 日志
Spawning CLI process (SDK mode)) - 涉及功能:内置技能(Assistant Rules / skills,如 skills、cron、aionui-config)
Bug 描述
内置技能文档要求 agent 经终端调用 helper(官方示例):
printf '%s' '{"name":"cron"}' | "$AIONUI_HELPER_BIN" skills show实际在 agent 会话内执行时,$AIONUI_HELPER_BIN 为空展开:
/usr/bin/bash: line 1: : command not found
exit=127直接写 aioncore.exe 绝对路径调用同样不可用:
> aioncore.exe config cron current list
CONFIG_ENV_MISSING command="config cron current list" field="AIONUI_BASE_URL": missing required environment variable (exit=2)根因面:agent 进程本身有这 5 个运行期变量,但 agent 执行命令的 client terminal 进程没有(AIONUI_USER_ID / AIONUI_CONVERSATION_ID / AIONUI_HELPER_BIN / AIONUI_BASE_URL / AIONUI_RUNTIME_TOKEN)。因此所有以 "$AIONUI_HELPER_BIN" 为入口的内置技能工作流在会话内全部不可用。
复现(任意 AionUi 会话,让 agent 在终端执行)
env | grep '^AION'
# 只有 6 个静态键,没有任何运行期键:
# AIONCORE_BOOTSTRAP_SECRET AIONUI_CACHE_DIR AIONUI_CDP_ACTIVE_PORT
# AIONUI_CDP_BRIDGE_TOKEN AIONUI_LOG_DIR AIONUI_WORK_DIR
"$AIONUI_HELPER_BIN" skills capabilities # → 空展开,command not found实测证据(同一时刻,同机)
- 终端 shell 的父进程链:
bash → … → aioncore.exe → AionUi.exe;命令由 aioncore 的 client terminal 代执行(aioncore 日志client terminal created与每条工具命令一一对应,09-16 当天 365 条),不是 agent 进程的子进程。 - 以
AIONUI_HELPER_BIN/AIONUI_RUNTIME_TOKEN任一存在筛选扫描当前用户可读的进程环境(系统侧 psutil 读取,仅核对键名):唯一命中者是 agent 本体kimi.exe;终端 shell 一个运行期键都没有。 - 同日 aioncore 日志同时存在
Spawning CLI process (SDK mode)(这 5 个键随该处注入 agent 进程)与大量client terminal created—— 注入只发生在前者。
代码线索(v0.2.2;terminal.rs 实测 main 与 v0.2.2 内容一致)
crates/aionui-ai-agent/src/protocol/acp.rs·handle_terminal_create():组装CreateTerminalParams时env只透传 agent 请求携带的 env(env: request.env.iter().map(...)),无任何兜底/合并。crates/aionui-ai-agent/src/terminal.rs·TerminalRegistry::create():spawn 时也只builder.env(k, v)(来自params.env),其余继承 aioncore 进程环境;而 aioncore 自身环境并不包含这 5 个 per-conversation 变量。- 对照设计意图:
crates/aionui-ai-agent/src/types.rs中runtime_env注释为 "Per-turn environment values exposed to runtime tool execution";ConversationService::runtime_token_for_build注释说明 token 是给 "in-conversation CLI(aioncore config/diagnose)" 用的 —— 但终端创建路径没有把这套运行期上下文并入。 - 参考方向(供你们判断):连接构建处已在传
terminal_label/terminal_cwd(TerminalRegistry::new(terminal_label, terminal_cwd)),可再带一份会话运行期 env 并在create()合并;或在handle_terminal_create侧从会话上下文解析后并入。
影响
- 内置技能在会话内形同虚设:文档入口就是
"$AIONUI_HELPER_BIN",实测不可执行。 - agent 无法用 CLI 管理定时任务 / 技能 / 会话(如
aioncore config cron),只能靠 UI 手动操作。 - 无法用「用户预设静态环境变量」绕过:
AIONUI_BASE_URL每次启动为随机端口、AIONUI_RUNTIME_TOKEN是进程内存一次性凭据,写死必然过期。
相关
- #4250:Hermes 团队成员缺失
AIONUI_*变量(team mailbox 不可用)——同类、不同场景(团队/ACP 进程面);本 issue 是普通单会话的 client terminal 面。 - #4145:aioncore config CLI 的 HTTP_PROXY 问题——该 CLI 的会话内可用性属同一套机制。
Source: iOfficeAI/AionUi