Skip to content

Commit 7e4a6d0

Browse files
committed
Resolve uv path for memory service launcher
1 parent 4c7b40c commit 7e4a6d0

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

scripts/memory/run-shared-memory-service.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -euo pipefail
55
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
77
AI_PROJECT_ROOT="${REPO_ROOT}/ai"
8+
UV_BIN="${UV_BIN:-$(command -v uv || true)}"
89

910
require_env() {
1011
local name="$1"
@@ -19,6 +20,24 @@ require_env HINDSIGHT_LOCAL_DB_PATH
1920
require_env LOCAL_MEMORY_ACTOR_TOKENS_JSON
2021
require_env LOCAL_MEMORY_ACTOR_POLICIES_JSON
2122

23+
if [[ -z "${UV_BIN}" ]]; then
24+
for candidate in \
25+
/home/linuxbrew/.linuxbrew/bin/uv \
26+
/usr/local/bin/uv \
27+
/usr/bin/uv
28+
do
29+
if [[ -x "${candidate}" ]]; then
30+
UV_BIN="${candidate}"
31+
break
32+
fi
33+
done
34+
fi
35+
36+
if [[ -z "${UV_BIN}" || ! -x "${UV_BIN}" ]]; then
37+
echo "Could not find an executable uv binary. Set UV_BIN explicitly." >&2
38+
exit 1
39+
fi
40+
2241
if [[ "${MEMORY_PROVIDER}" != "local_hindsight" ]]; then
2342
echo "MEMORY_PROVIDER must be local_hindsight, got: ${MEMORY_PROVIDER}" >&2
2443
exit 1
@@ -32,7 +51,7 @@ fi
3251

3352
export PYTHONPATH="${REPO_ROOT}:${PYTHONPATH:-}"
3453

35-
exec uv run --project "${AI_PROJECT_ROOT}" python -m uvicorn \
54+
exec "${UV_BIN}" run --project "${AI_PROJECT_ROOT}" python -m uvicorn \
3655
ai.api.mcp_server.memory_server:app \
3756
--host "${MEMORY_SERVER_HOST:-127.0.0.1}" \
3857
--port "${MEMORY_SERVER_PORT:-5003}"

0 commit comments

Comments
 (0)