feat: opencode web at oc.commoninternet.net (one server, named sessions)
configuration.nix: - systemd.services.opencode-web: one shared opencode server on 127.0.0.1:4096, EnvironmentFile=/srv/cc-ci/.testenv (TINFOIL_API_KEY), ExecStartPre clears stale /tmp/opencode so restarts never fail on the EEXIST race. - services.nginx: reverse-proxy oc.commoninternet.net → localhost:4096, bound to tailscale IP 100.84.190.30 (tailnet-only, plain HTTP). DNS: A record oc.commoninternet.net → 100.84.190.30 (operator step). launch.sh + launch-upgrader.sh: - Drop per-session ports / OPENCODE_HOST; add OPENCODE_SERVER=http://127.0.0.1:4096. - opencode backend: agents use `opencode run --attach $OPENCODE_SERVER --title $session` so each shows up as a named session in the web UI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
a87d42f491
commit
e0e5bf6e64
@@ -36,8 +36,7 @@ UPGRADER_MODEL="${LOOP_MODEL:-${UPGRADER_MODEL:-sonnet}}"
|
||||
CLAUDE_BIN="${CLAUDE_BIN:-claude}"
|
||||
CLAUDE_FLAGS="${CLAUDE_FLAGS:---dangerously-skip-permissions}"
|
||||
OPENCODE_BIN="${OPENCODE_BIN:-/home/loops/.local/bin/opencode}"
|
||||
OPENCODE_HOST="${OPENCODE_HOST:-$(tailscale ip -4 2>/dev/null | head -1)}"
|
||||
OPENCODE_PORT="${OPENCODE_PORT:-4098}" # upgrader gets its own port offset
|
||||
OPENCODE_SERVER="${OPENCODE_SERVER:-http://127.0.0.1:4096}"
|
||||
REMOTE_CONTROL="${REMOTE_CONTROL:-1}" # 1 => --remote-control / opencode web
|
||||
LOG_DIR="${LOG_DIR:-/srv/cc-ci/.cc-ci-logs}"
|
||||
UPGRADER_ARGS="${UPGRADER_ARGS:-}"
|
||||
@@ -112,10 +111,9 @@ start() {
|
||||
"$CLAUDE_BIN $rc --model '$UPGRADER_MODEL' $CLAUDE_FLAGS \"\$(cat '$kf')\""
|
||||
;;
|
||||
opencode)
|
||||
local web_url="http://${OPENCODE_HOST}:${OPENCODE_PORT}"
|
||||
tmux new-session -d -s "$SESSION" -c "$WORKDIR" \
|
||||
"set -a; . /srv/cc-ci/.testenv; set +a; $OPENCODE_BIN --model '$UPGRADER_MODEL' --hostname '$OPENCODE_HOST' --port '$OPENCODE_PORT' run \"\$(cat '$kf')\""
|
||||
log "$SESSION web UI: $web_url (tailnet only)"
|
||||
"set -a; . /srv/cc-ci/.testenv; set +a; $OPENCODE_BIN --model '$UPGRADER_MODEL' run --attach '$OPENCODE_SERVER' --title '$SESSION' \"\$(cat '$kf')\""
|
||||
log "$SESSION visible in web UI at http://oc.commoninternet.net (tailnet only)"
|
||||
;;
|
||||
esac
|
||||
tmux pipe-pane -o -t "$SESSION" "cat >> '$LOG_DIR/$SESSION.log'"
|
||||
@@ -144,7 +142,7 @@ cc-ci upgrader launcher — one-shot weekly recipe-upgrade job agent (remote-con
|
||||
|
||||
Env: UPGRADER_BACKEND=$UPGRADER_BACKEND UPGRADER_MODEL=$UPGRADER_MODEL UPGRADER_ARGS='${UPGRADER_ARGS:-<none>}'
|
||||
claude: CLAUDE_BIN=$CLAUDE_BIN REMOTE_CONTROL=$REMOTE_CONTROL
|
||||
opencode: OPENCODE_BIN=$OPENCODE_BIN web=http://${OPENCODE_HOST}:${OPENCODE_PORT} (tailnet only)
|
||||
opencode: OPENCODE_BIN=$OPENCODE_BIN OPENCODE_SERVER=$OPENCODE_SERVER web=http://oc.commoninternet.net
|
||||
(LOOP_BACKEND / LOOP_MODEL override UPGRADER_BACKEND / UPGRADER_MODEL for unified control)
|
||||
The agent runs /upgrade-all (DEFAULT mode) to completion, then STOPS and stays idle (viewable in the
|
||||
web UI). It does NOT self-terminate; the next weekly `start` clears the idle session and runs fresh.
|
||||
|
||||
Reference in New Issue
Block a user