launch-orchestrator: persisted .orch-model file (ORCH_MODEL > LOOP_MODEL > file)
Operator switching models near weekly limits: loops -> sonnet, orchestrator -> opus. Dotfiles updated (.loop-model/.loop-model-adv=sonnet, .orch-model=opus) so watchdog restarts keep the choice.
This commit is contained in:
@@ -42,7 +42,20 @@ WORKDIR = os.environ.get("ORCH_DIR", "/srv/cc-ci-orch")
|
|||||||
LOG_DIR = os.environ.get("LOG_DIR", "/srv/cc-ci/.cc-ci-logs")
|
LOG_DIR = os.environ.get("LOG_DIR", "/srv/cc-ci/.cc-ci-logs")
|
||||||
|
|
||||||
BACKEND = os.environ.get("LOOP_BACKEND", "claude")
|
BACKEND = os.environ.get("LOOP_BACKEND", "claude")
|
||||||
LOOP_MODEL = os.environ.get("LOOP_MODEL", "")
|
|
||||||
|
# Orchestrator model: ORCH_MODEL env wins, then LOOP_MODEL, then a persisted file written
|
||||||
|
# when the operator changes the model (so watchdog-triggered restarts keep it).
|
||||||
|
_ORCH_MODEL_FILE = f"{LOG_DIR}/.orch-model"
|
||||||
|
|
||||||
|
def _read_file_default(path, default):
|
||||||
|
try:
|
||||||
|
v = open(path).read().strip()
|
||||||
|
return v or default
|
||||||
|
except FileNotFoundError:
|
||||||
|
return default
|
||||||
|
|
||||||
|
LOOP_MODEL = (os.environ.get("ORCH_MODEL") or os.environ.get("LOOP_MODEL")
|
||||||
|
or _read_file_default(_ORCH_MODEL_FILE, ""))
|
||||||
|
|
||||||
# claude-specific
|
# claude-specific
|
||||||
CLAUDE_BIN = os.environ.get("CLAUDE_BIN", "claude")
|
CLAUDE_BIN = os.environ.get("CLAUDE_BIN", "claude")
|
||||||
|
|||||||
Reference in New Issue
Block a user