fix: load model keys from environment

This commit is contained in:
董宏凯 committed 2026-07-26 13:08:09 +08:00
1 parent 25153dbd84
commit 3779bb69ef
3 files changed
+20 -11

No files matched your search

@@ -19,6 +19,14 @@ CONFIG_FILE="${CONFIG_DIR}/config.yaml"
EXTENSIONS_FILE="${CONFIG_DIR}/extensions_config.json"
LANGGRAPH_FILE="${CONFIG_DIR}/langgraph.json"
ENV_FILE="${CONFIG_DIR}/.env"
ENV_SOURCE="${CODE_DIR}/.env"
# The repository-level offline deployment keeps its tracked environment file
# one directory above the backend source. Prefer a backend-local file when a
# deployment provides one, otherwise use that shared file.
if [[ ! -f "${ENV_SOURCE}" && -f "$(dirname "${CODE_DIR}")/.env" ]]; then
ENV_SOURCE="$(dirname "${CODE_DIR}")/.env"
fi
copy_if_missing() {
local src="$1"
@@ -43,7 +51,7 @@ mkdir -p "${CONFIG_DIR}" "${RUNTIME_DIR}/data" "${LOGS_DIR}"
copy_if_missing "${CODE_DIR}/config.yaml" "${CONFIG_FILE}"
copy_if_missing "${CODE_DIR}/extensions_config.json" "${EXTENSIONS_FILE}"
copy_if_missing "${CODE_DIR}/langgraph.json" "${LANGGRAPH_FILE}"
copy_if_missing "${CODE_DIR}/.env" "${ENV_FILE}"
copy_if_missing "${ENV_SOURCE}" "${ENV_FILE}"
touch "${ENV_FILE}"
copy_dir_if_missing "${CODE_DIR}/skills" "${SKILLS_DIR}"