JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(docker): EXTENSION_DIRS 支持分号分隔多目录并保证内置扩展目录生效
chen hui801b0ef38213
diff --git a/docker/start.sh b/docker/start.shindex ba4f445d93..818fd57290 100755--- a/docker/start.sh+++ b/docker/start.sh@@ -26,18 +26,32 @@ if ! /usr/local/bin/python3 "${SCRIPT_DIR}/update_conf.py"; thenfi# AGENT_RUNTIME_ENABLED=false(不部署 agent-runtime)时,关断 gateway 的 runtime-# 路由扩展+# 路由扩展。EXTENSION_DIRS 为分号分隔的多目录(如 dir1;dir2);内置扩展目录+# /app/jiuwenswarm/jiuwenswarm/extensions 无条件追加(+= 语义,无论 EXTENSION_DIRS+# 是否设置/是否已含该目录)if [ "${ROLE}" = "gateway" ] && [ "${AGENT_RUNTIME_ENABLED}" == "false" ]; then- ext_dir="${EXTENSION_DIRS:-packages/jiuwenclaw-ee/gateway/extensions}"- if [ -z "${EXTENSION_DIRS:-}" ]; then- echo "[start.sh] WARNING: EXTENSION_DIRS not set, fallback to '${ext_dir}'" >&2+ ext_dirs=()+ if [ -n "${EXTENSION_DIRS:-}" ]; then+ IFS=';' read -r -a ext_dirs <<< "${EXTENSION_DIRS}"fi- file="${ext_dir}/runtime_management_extension/extension.yaml"- if [ -f "${file}" ]; then- yq -i '.enabled = false' "${file}"- echo "[start.sh] AGENT_RUNTIME_ENABLED=false → runtime extension disabled: ${file}"- else- echo "[start.sh] WARNING: runtime extension file not found, skip disabling: ${file}" >&2+ builtin_dir="/app/jiuwenswarm/jiuwenswarm/extensions"+ dir_in_list=0+ for d in "${ext_dirs[@]}"; do+ [ "${d%/}" = "${builtin_dir}" ] && dir_in_list=1 && break+ done+ [ "${dir_in_list}" -eq 0 ] && ext_dirs+=("${builtin_dir}")+ disabled_any=0+ for ext_dir in "${ext_dirs[@]}"; do+ [ -z "${ext_dir}" ] && continue+ file="${ext_dir%/}/runtime_management_extension/extension.yaml"+ if [ -f "${file}" ]; then+ yq -i '.enabled = false' "${file}"+ echo "[start.sh] AGENT_RUNTIME_ENABLED=false → runtime extension disabled: ${file}"+ disabled_any=1+ fi+ done+ if [ "${disabled_any}" -eq 0 ]; then+ echo "[start.sh] WARNING: runtime extension file not found in any extension dir ($(IFS=';'; echo "${ext_dirs[*]}")), skip disabling" >&2fifi