-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreset.sh
More file actions
executable file
·63 lines (51 loc) · 1.92 KB
/
reset.sh
File metadata and controls
executable file
·63 lines (51 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
set -euo pipefail
FACTORY_RESET=false
STATE_DIR_NAME="locomo-bench"
STATE_DIR_ROOT="$PWD"
STATE_DIR="${STATE_DIR_ROOT%/}/${STATE_DIR_NAME}"
BENCH_CONFIG_PATH="${STATE_DIR}/openclaw.json"
ENV_FILE="${STATE_DIR}/openclaw.env"
WORKSPACE_SHADOW_PLUGIN_DIR="${STATE_DIR}/workspace/.openclaw/extensions/memory-lancedb"
GLOBAL_STATE_DIR="${HOME}/.openclaw"
GLOBAL_CONFIG_PATH="${GLOBAL_STATE_DIR}/openclaw.json"
echo "Reset: stopping gateway if it is running..."
openclaw gateway stop >/dev/null 2>&1 || true
echo "Reset: clearing any process still listening on port 18789..."
PORT_PIDS="$(lsof -ti tcp:18789 || true)"
if [[ -n "${PORT_PIDS}" ]]; then
kill ${PORT_PIDS} >/dev/null 2>&1 || true
fi
echo "Reset: removing benchmark-local state..."
rm -rf "${STATE_DIR}"
rm -rf "${WORKSPACE_SHADOW_PLUGIN_DIR}"
rm -f "${BENCH_CONFIG_PATH}"
rm -f "${ENV_FILE}"
if [[ "${FACTORY_RESET}" == "true" ]]; then
echo "Reset: performing factory reset of global OpenClaw config..."
if [[ -f "${GLOBAL_CONFIG_PATH}" ]]; then
BACKUP_PATH="${GLOBAL_CONFIG_PATH}.bak.$(date +%Y%m%d-%H%M%S)"
mv "${GLOBAL_CONFIG_PATH}" "${BACKUP_PATH}"
fi
openclaw onboard
else
echo "Reset: restoring global config to memory-core baseline..."
openclaw config unset plugins.entries.memory-lancedb >/dev/null 2>&1 || true
openclaw config unset plugins.allow >/dev/null 2>&1 || true
openclaw config set plugins.slots.memory memory-core >/dev/null
fi
cat <<EOF
OpenClaw benchmark reset complete.
Removed benchmark state:
${STATE_DIR}
Removed old workspace shadow plugin copy:
${WORKSPACE_SHADOW_PLUGIN_DIR}
Removed benchmark-local config, if present:
${BENCH_CONFIG_PATH}
Removed benchmark env file, if present:
${ENV_FILE}
Current reset mode:
FACTORY_RESET=${FACTORY_RESET}
If FACTORY_RESET=false, the global config was kept and reset to memory-core.
If FACTORY_RESET=true, the global config was moved aside and OpenClaw was re-onboarded.
EOF