Point Naldo_Bot's brain at the Mine Space
Browse files- voyager_runner.py +27 -3
voyager_runner.py
CHANGED
|
@@ -51,16 +51,40 @@ def main() -> None:
|
|
| 51 |
ckpt_dir = env("VOYAGER_CKPT_DIR", "/persist/minecraft-friends/voyager/ckpt-20260927-flat-y64-v1")
|
| 52 |
bot_username = env("MC_USERNAME", "Naldo_Bot")
|
| 53 |
brain_profile = env("VOYAGER_BRAIN_PROFILE", "")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
if bot_username == "Naldo_Bot":
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
elif bot_username == "Gemini_Bot":
|
| 57 |
expected = ("gemini-cli", "http://127.0.0.1:7863/v1", "gemini-3.5-flash-lite", "gemini-3.5-flash-lite")
|
| 58 |
else:
|
| 59 |
expected = None
|
| 60 |
-
if expected and (brain_profile, base_url, model, aux_model) != expected:
|
| 61 |
raise RuntimeError(
|
| 62 |
f"Brain lock rejected {bot_username}: profile={brain_profile!r}, base={base_url!r}, "
|
| 63 |
-
f"model={model!r}, aux={aux_model!r}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
)
|
| 65 |
ckpt = Path(ckpt_dir)
|
| 66 |
required_resume_defaults = {
|
|
|
|
| 51 |
ckpt_dir = env("VOYAGER_CKPT_DIR", "/persist/minecraft-friends/voyager/ckpt-20260927-flat-y64-v1")
|
| 52 |
bot_username = env("MC_USERNAME", "Naldo_Bot")
|
| 53 |
brain_profile = env("VOYAGER_BRAIN_PROFILE", "")
|
| 54 |
+
# Escape hatch. O lock derruba o processo quando a tupla não bate, e o
|
| 55 |
+
# watchdog reinicia em loop — um deploy ruim deixa o bot parado. Com
|
| 56 |
+
# VOYAGER_BRAIN_LOCK=off a checagem inteira é pulada, então dá para subir
|
| 57 |
+
# o bot mesmo com o cérebro remoto fora do ar.
|
| 58 |
+
brain_lock = env("VOYAGER_BRAIN_LOCK", "enforce") != "off"
|
| 59 |
if bot_username == "Naldo_Bot":
|
| 60 |
+
# O cérebro saiu deste Space: quem serve é o Space `Erinaldordso/Mine`.
|
| 61 |
+
# A URL precisa ser a pública, porque os dois Spaces não compartilham
|
| 62 |
+
# rede. O lock continua valendo para o caso de um deploy silenciosamente
|
| 63 |
+
# apontar para outro provedor.
|
| 64 |
+
#
|
| 65 |
+
# O modelo auxiliar (QA do curriculum e descrição de skill) também vem
|
| 66 |
+
# de lá — o Mine serve os dois, para que nenhum peso de modelo sobre no
|
| 67 |
+
# Space onde roda o jogo.
|
| 68 |
+
expected = (
|
| 69 |
+
"naldo-qwen3-coder",
|
| 70 |
+
"https://erinaldordso-mine.hf.space/v1",
|
| 71 |
+
"qwen3-coder-30b-a3b-instruct",
|
| 72 |
+
"granite-4.0-h-tiny",
|
| 73 |
+
)
|
| 74 |
elif bot_username == "Gemini_Bot":
|
| 75 |
expected = ("gemini-cli", "http://127.0.0.1:7863/v1", "gemini-3.5-flash-lite", "gemini-3.5-flash-lite")
|
| 76 |
else:
|
| 77 |
expected = None
|
| 78 |
+
if expected and brain_lock and (brain_profile, base_url, model, aux_model) != expected:
|
| 79 |
raise RuntimeError(
|
| 80 |
f"Brain lock rejected {bot_username}: profile={brain_profile!r}, base={base_url!r}, "
|
| 81 |
+
f"model={model!r}, aux={aux_model!r}; expected={expected!r}"
|
| 82 |
+
)
|
| 83 |
+
if expected and not brain_lock:
|
| 84 |
+
print(
|
| 85 |
+
f"[voyager] brain lock DESLIGADO (VOYAGER_BRAIN_LOCK=off); aceitando "
|
| 86 |
+
f"profile={brain_profile!r} base={base_url!r} model={model!r} aux={aux_model!r}",
|
| 87 |
+
flush=True,
|
| 88 |
)
|
| 89 |
ckpt = Path(ckpt_dir)
|
| 90 |
required_resume_defaults = {
|