m64_42b53e1f9463 / start.sh
39 lines, 1.8 KBraw
1#!/usr/bin/env bash2# openclaw-mimopro-openrouter-gb10 entrypoint. Runs inside the container; takes no arguments.3# Three processes, all in this container:4# 127.0.0.1:9000 llm_relay.py OpenAI-compatible; forces the model, goes out via the gate5# 127.0.0.1:4096 cli_shim.py runs `openclaw agent --local` once per prompt6# 0.0.0.0:$M64_PORT agent_gateway.py the agent.session API m64's front proxies to7set -eu89echo '{"phase":"loading","detail":"starting openclaw"}' >> "$M64_STATUS"1011export HOME=/scratch/home12export WORK_DIR=/scratch/work13export SHIM_HOMES=/scratch/homes14mkdir -p "$HOME" "$WORK_DIR/sessions" "$SHIM_HOMES"1516export AGENT_HARNESS=openclaw17export AGENT_HARNESS_TITLE="OpenClaw 2026.9.2"18export AGENT_MODEL=mimo-v2.6-pro # the name the harness uses19export UPSTREAM_MODEL=xiaomi/mimo-v2.6-pro # what the relay sends to OpenRouter20export AGENT_CONTEXT=1048576 # Xiaomi MiMo V2.6 Pro: 1M context21export AGENT_VISION=122export LLM_BASE_URL=http://127.0.0.1:9000/v123# Node (the harness) sends its own web requests through HTTP(S)_PROXY, the m64 gate (as gx10 does).24export NODE_USE_ENV_PROXY=125export RELAY_TITLE="m64 openclaw-mimopro-openrouter-gb10"2627python3 -u /capsule/llm_relay.py &28RELAY_PID=$!29python3 -u /capsule/cli_shim.py &30SHIM_PID=$!3132# If the relay or the shim dies, take the container down so m64 reports the error ($$ is33# the gateway after the exec below). A dead child lingers as a zombie: test its state.34alive() { [ -r "/proc/$1/stat" ] && [ "$(cut -d')' -f2 "/proc/$1/stat" | cut -d' ' -f2)" != Z ]; }35( while alive "$RELAY_PID" && alive "$SHIM_PID"; do sleep 5; done36 echo '{"phase":"error","detail":"the LLM relay or the openclaw shim exited"}' >> "$M64_STATUS"37 kill -TERM $$ ) &3839exec /opt/gateway/bin/python /capsule/agent_gateway.py