launch-upgrader: default model to sonnet (UPGRADER_MODEL)

Adds UPGRADER_MODEL env var (default: sonnet) passed as --model to the
claude invocation. The cron runs the upgrader on Sonnet so it doesn't
consume Opus weekly credits. Override with UPGRADER_MODEL=opus if needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
autonomic-bot
2026-05-31 13:24:53 +00:00
parent 21e7a79f50
commit 25fd7407fd

View File

@ -29,6 +29,7 @@ SESSION="${UPGRADER_SESSION:-cc-ci-upgrader}" # tmux session name == remo
WORKDIR="${UPGRADER_DIR:-/srv/cc-ci}" # cwd: where .claude/skills/ + .testenv live
CLAUDE_BIN="${CLAUDE_BIN:-claude}"
CLAUDE_FLAGS="${CLAUDE_FLAGS:---dangerously-skip-permissions}"
UPGRADER_MODEL="${UPGRADER_MODEL:-sonnet}" # model for the upgrader agent (sonnet = default)
REMOTE_CONTROL="${REMOTE_CONTROL:-1}" # 1 => --remote-control (viewable at claude.ai/code)
LOG_DIR="${LOG_DIR:-/srv/cc-ci/.cc-ci-logs}"
UPGRADER_ARGS="${UPGRADER_ARGS:-}"
@ -90,9 +91,9 @@ start() {
local kf rc=""
kf="$(write_kickoff)"
[[ "$REMOTE_CONTROL" == "1" ]] && rc="--remote-control '$SESSION'"
log "starting $SESSION (cwd=$WORKDIR, rc=$REMOTE_CONTROL, args='${UPGRADER_ARGS:-<none>}')"
log "starting $SESSION (cwd=$WORKDIR, rc=$REMOTE_CONTROL, model=$UPGRADER_MODEL, args='${UPGRADER_ARGS:-<none>}')"
tmux new-session -d -s "$SESSION" -c "$WORKDIR" \
"$CLAUDE_BIN $rc $CLAUDE_FLAGS \"\$(cat '$kf')\""
"$CLAUDE_BIN $rc --model '$UPGRADER_MODEL' $CLAUDE_FLAGS \"\$(cat '$kf')\""
tmux pipe-pane -o -t "$SESSION" "cat >> '$LOG_DIR/$SESSION.log'"
log "started. status: $0 status | attach: tmux attach -t $SESSION | log: $LOG_DIR/$SESSION.log"
}
@ -117,7 +118,7 @@ cc-ci upgrader launcher — one-shot weekly recipe-upgrade job agent (remote-con
$0 attach tmux attach to the session
$0 stop kill the session
Env: SESSION=$SESSION WORKDIR=$WORKDIR REMOTE_CONTROL=$REMOTE_CONTROL UPGRADER_ARGS='${UPGRADER_ARGS:-<none>}'
Env: SESSION=$SESSION WORKDIR=$WORKDIR REMOTE_CONTROL=$REMOTE_CONTROL UPGRADER_MODEL=$UPGRADER_MODEL UPGRADER_ARGS='${UPGRADER_ARGS:-<none>}'
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.
EOF