fix: use GLM 5.3 Flash for weekly agents
This commit is contained in:
@@ -26,7 +26,7 @@ WORKDIR = os.environ.get("REPORT_DIR", "/srv/cc-ci")
|
||||
LOG_DIR = os.environ.get("LOG_DIR", "/srv/cc-ci/.cc-ci-logs")
|
||||
BACKEND = os.environ.get("REPORT_BACKEND", "opencode")
|
||||
TIER = os.environ.get("LOOP_TIER", os.environ.get("REPORT_TIER", "go"))
|
||||
_TIER_MODEL = {"go": "opencode-go/glm-5.2", "zen": "opencode/glm-5.2"}
|
||||
_TIER_MODEL = {"go": "opencode-go/glm-5.3-flash", "zen": "opencode/glm-5.2"}
|
||||
_DEFAULT_MODEL = _TIER_MODEL.get(TIER, _TIER_MODEL["go"]) if BACKEND == "opencode" else "opus"
|
||||
MODEL = os.environ.get("REPORT_MODEL", _DEFAULT_MODEL)
|
||||
CLAUDE_BIN = os.environ.get("CLAUDE_BIN", "claude")
|
||||
@@ -127,7 +127,7 @@ def start(mode, date):
|
||||
if BACKEND == "opencode":
|
||||
if OPENCODE_SHARE:
|
||||
log(f" attached to {OPENCODE_SERVER} → https://oc.ci.commoninternet.net +public --share link")
|
||||
# Watchdog for the report too: it runs on glm-5.2 sharing the same opencode-go budget the
|
||||
# Watchdog for the report too: it runs on glm-5.3-flash sharing the same opencode-go budget the
|
||||
# upgrade run just drained, so a 429 stall is likely. Reuse launch-upgrader.py's watchdog,
|
||||
# pointed at THIS (cc-ci-report) session with a report-specific marker + resume prompt. It
|
||||
# runs under the tmux server (survives the systemd oneshot like the run sessions).
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
cc-ci weekly-run SUPERVISOR — hourly glm-5.2 orchestrator wake-up.
|
||||
cc-ci weekly-run SUPERVISOR — hourly glm-5.3-flash orchestrator wake-up.
|
||||
|
||||
Fired hourly by a systemd timer. It is a CHEAP deterministic GATE first: if this week's
|
||||
/upgrade-all run is already complete, or is actively progressing, it does NOTHING and spends
|
||||
ZERO model tokens. Only when the run has STALLED or died before completing — e.g. the host
|
||||
disk-full crash on 2026-07-03 that the log-idle/429 watchdog does NOT cover — does it launch a
|
||||
short-lived glm-5.2 opencode agent that DIAGNOSES the blockage (disk, wedged deploy, dead
|
||||
short-lived glm-5.3-flash opencode agent that DIAGNOSES the blockage (disk, wedged deploy, dead
|
||||
session, a stuck recipe) and DRIVES the run to completion (resume the upgrader, ensure the
|
||||
summary + public report land). One-shot per fire; the next hour re-checks and no-ops if healthy.
|
||||
|
||||
@@ -34,7 +34,7 @@ lu = importlib.util.module_from_spec(_spec); _spec.loader.exec_module(lu)
|
||||
SUP_SESSION = os.environ.get("SUPERVISOR_SESSION", "cc-ci-supervisor")
|
||||
WORKDIR = os.environ.get("UPGRADER_DIR", "/srv/cc-ci")
|
||||
LOG_DIR = os.environ.get("LOG_DIR", "/srv/cc-ci/.cc-ci-logs")
|
||||
MODEL = os.environ.get("SUPERVISOR_MODEL", "opencode-go/glm-5.2")
|
||||
MODEL = os.environ.get("SUPERVISOR_MODEL", "opencode-go/glm-5.3-flash")
|
||||
OPENCODE_BIN = lu.OPENCODE_BIN
|
||||
OPENCODE_SERVER = lu.OPENCODE_SERVER
|
||||
OPENCODE_SHARE = os.environ.get("OPENCODE_SHARE", "1") == "1"
|
||||
@@ -63,7 +63,7 @@ def _sup_kill(): _sh(["tmux", "kill-session", "-t", SUP_SESSION])
|
||||
# ── the supervisor agent ─────────────────────────────────────────────────────────────────────────
|
||||
def build_kickoff(sid, reason):
|
||||
return f"""\
|
||||
*** cc-ci WEEKLY-RUN SUPERVISOR — one-shot, glm-5.2 ***
|
||||
*** cc-ci WEEKLY-RUN SUPERVISOR — one-shot, glm-5.3-flash ***
|
||||
You are the hourly SUPERVISOR for the weekly cc-ci /upgrade-all run. A gate has determined the run
|
||||
is INCOMPLETE and not currently progressing ({reason}). Your job: get this week's run to a clean
|
||||
DONE — published report + summary — then STOP. You are NOT a perpetual loop.
|
||||
@@ -111,7 +111,7 @@ def spawn_supervisor(sid, reason):
|
||||
f"--attach '{OPENCODE_SERVER}' --title '{SUP_SESSION}' --dir {WORKDIR} \"$(cat '{kf}')\"")
|
||||
_sh(["tmux", "new-session", "-d", "-s", SUP_SESSION, "-c", WORKDIR, cmd])
|
||||
_sh(["tmux", "pipe-pane", "-o", "-t", SUP_SESSION, f"cat >> '{LOG_DIR}/{SUP_SESSION}.log'"])
|
||||
log(f"launched glm-5.2 supervisor (tmux '{SUP_SESSION}', model={MODEL}) — {reason}")
|
||||
log(f"launched glm-5.3-flash supervisor (tmux '{SUP_SESSION}', model={MODEL}) — {reason}")
|
||||
|
||||
# ── gate ─────────────────────────────────────────────────────────────────────────────────────────
|
||||
def _gate():
|
||||
|
||||
@@ -52,7 +52,7 @@ LOG_DIR = os.environ.get("LOG_DIR", "/srv/cc-ci/.cc-ci-logs")
|
||||
BACKEND = os.environ.get("LOOP_BACKEND", os.environ.get("UPGRADER_BACKEND", "opencode"))
|
||||
TIER = os.environ.get("LOOP_TIER", os.environ.get("UPGRADER_TIER", "go"))
|
||||
_TIER_CFG = {
|
||||
"go": {"model": "opencode-go/glm-5.2", "endpoint": "https://opencode.ai/zen/go/v1/chat/completions",
|
||||
"go": {"model": "opencode-go/glm-5.3-flash", "endpoint": "https://opencode.ai/zen/go/v1/chat/completions",
|
||||
"auth": "opencode-go", "label": "OpenCode Go"},
|
||||
"zen": {"model": "opencode/glm-5.2", "endpoint": "https://opencode.ai/zen/v1/chat/completions",
|
||||
"auth": "opencode", "label": "OpenCode ZEN"},
|
||||
@@ -406,7 +406,7 @@ def _limit_retry_after():
|
||||
key = _limit_key()
|
||||
if not key:
|
||||
return 0
|
||||
body = _json.dumps({"model": (MODEL or "").split("/")[-1] or "glm-5.2", "max_tokens": 8,
|
||||
body = _json.dumps({"model": (MODEL or "").split("/")[-1] or "glm-5.3-flash", "max_tokens": 8,
|
||||
"messages": [{"role": "user", "content": "hi"}]}).encode()
|
||||
req = _ureq.Request(LIMIT_ENDPOINT, data=body, method="POST",
|
||||
headers={"Authorization": "Bearer " + key, "content-type": "application/json"})
|
||||
|
||||
Reference in New Issue
Block a user