From c5036ccc75a4a44a0326a90bdf16f54a1f58ff9a Mon Sep 17 00:00:00 2001 From: xubinrui <1462311339@qq.com> Date: Tue, 23 Jun 2026 18:01:25 +0800 Subject: [PATCH] add proxy cache root --- .gitignore | 3 ++- codex-chat-router/README.md | 2 +- scripts/start_codex_deepseek_proxy.sh | 15 +++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 21eb7f4..46cd475 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ app_config.json starter.yaml CLAUDE.md .codex +.cache_codex/ .superpowers/ ui/.pnp.* ui/.yarn/ @@ -32,4 +33,4 @@ codex-runner/dist/ docs/superpowers *_api_key.* codex_home/ -.loopai \ No newline at end of file +.loopai diff --git a/codex-chat-router/README.md b/codex-chat-router/README.md index b331e66..4ce17b1 100644 --- a/codex-chat-router/README.md +++ b/codex-chat-router/README.md @@ -10,4 +10,4 @@ The conversion, streaming, and history modules under `src/ccswitch/` are vendore LOOPAI_CODEX_PROXY_UPSTREAM_API_KEY=... ./scripts/start_codex_deepseek_proxy.sh ``` -The local Responses base URL is `http://127.0.0.1:15721/v1` by default. Build artifacts are directed to `/data/xuebinrui/cargo-target/loopai-codex-chat-router` by the startup script. +The local Responses base URL is `http://127.0.0.1:15721/v1` by default. Build artifacts and temporary files are directed to the project-local `.cache_codex/` directory by the startup script. diff --git a/scripts/start_codex_deepseek_proxy.sh b/scripts/start_codex_deepseek_proxy.sh index c6a7160..9a89b97 100755 --- a/scripts/start_codex_deepseek_proxy.sh +++ b/scripts/start_codex_deepseek_proxy.sh @@ -3,15 +3,22 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ROUTER_DIR="${ROOT_DIR}/codex-chat-router" +CACHE_DIR="${ROOT_DIR}/.cache_codex" + +mkdir -p \ + "${CACHE_DIR}/cargo" \ + "${CACHE_DIR}/rustup" \ + "${CACHE_DIR}/target" \ + "${CACHE_DIR}/tmp" export LOOPAI_CODEX_PROXY_UPSTREAM_BASE_URL="${LOOPAI_CODEX_PROXY_UPSTREAM_BASE_URL:-${DEEPSEEK_BASE_URL:-https://api.deepseek.com}}" export LOOPAI_CODEX_PROXY_MODEL="${LOOPAI_CODEX_PROXY_MODEL:-${DEEPSEEK_MODEL:-deepseek-chat}}" export LOOPAI_CODEX_PROXY_HOST="${LOOPAI_CODEX_PROXY_HOST:-127.0.0.1}" export LOOPAI_CODEX_PROXY_PORT="${LOOPAI_CODEX_PROXY_PORT:-15721}" -export CARGO_HOME="${CARGO_HOME:-/home/xuebinrui/.cargo}" -export RUSTUP_HOME="${RUSTUP_HOME:-/home/xuebinrui/.rustup}" -export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-/data/xuebinrui/cargo-target/loopai-codex-chat-router}" -export TMPDIR="${TMPDIR:-/data/xuebinrui/tmp}" +export CARGO_HOME="${CARGO_HOME:-${CACHE_DIR}/cargo}" +export RUSTUP_HOME="${RUSTUP_HOME:-${CACHE_DIR}/rustup}" +export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-${CACHE_DIR}/target/codex-chat-router}" +export TMPDIR="${TMPDIR:-${CACHE_DIR}/tmp}" export PATH="${CARGO_HOME}/bin:${PATH}" if [[ -z "${LOOPAI_CODEX_PROXY_UPSTREAM_API_KEY:-${DEEPSEEK_API_KEY:-}}" ]]; then