From b62e4e717a20015af2169236fb5882c890c287fa Mon Sep 17 00:00:00 2001 From: buenosair Date: Fri, 4 Sep 2026 07:59:54 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20glm=20not=20found=20in=20dotfiles-less?= =?UTF-8?q?=20workers=20=E2=80=94=20bridge=20promotes=20models.json.fallba?= =?UTF-8?q?ck=20at=20startup=20(the=20fallback=20was=20never=20read=20by?= =?UTF-8?q?=20anything)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/bridge/index.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/bridge/index.mjs b/docker/bridge/index.mjs index 2838271..c562baf 100644 --- a/docker/bridge/index.mjs +++ b/docker/bridge/index.mjs @@ -3,7 +3,7 @@ // web prompts through pi.sendUserMessage. This process just hosts the session. // Global npm layout: resolve pi via absolute path (NODE_PATH does not apply to ESM). import { spawn } from "node:child_process"; -import { existsSync } from "node:fs"; +import { copyFileSync, existsSync } from "node:fs"; import { createAgentSession, ModelRuntime, @@ -61,6 +61,13 @@ process.on("unhandledRejection", (err) => { try { await runRepoSetup(); + // Dotfiles-less bakes ship only models.json.fallback: promote it so the + // registry always resolves the zai provider (glm) instead of "not found". + const piAgent = "/root/.pi/agent"; + if (!existsSync(`${piAgent}/models.json`) && existsSync(`${piAgent}/models.json.fallback`)) { + copyFileSync(`${piAgent}/models.json.fallback`, `${piAgent}/models.json`); + console.error("[lvmh-bridge] promoted models.json.fallback -> models.json"); + } // Optional initial model: LVMH_MODEL="provider/model-id" from the spawn // request. Resolved against the session's model registry; a bad value is // logged and falls back to the default model.