From 76e541490dfb339e3c20d66465782a9bb524995c Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Tue, 30 Jun 2026 12:59:11 -0700 Subject: [PATCH] fix(sandbox): honor model override in reconcile and log guard-chain warning to file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two regressions from #5874: 1. reconcile_agent_model_with_provider ran after apply_model_override and overwrote agents.defaults.model.primary with an inference/-prefixed variant because qualify() unconditionally adds the prefix. Guard with an early return when NEMOCLAW_MODEL_OVERRIDE is set — the comment at the call site already documented this intent but the implementation didn't enforce it. 2. restore_openclaw_runtime_guard_chain wrote its warning only to stderr. The new host-mediated recovery path (docker exec nemoclaw-gateway-control recover) runs inside PID 1, not inside a fresh sandbox exec, so stderr never reached /tmp/gateway.log. Mirror the warning to the gateway log file using the same pattern as the watchdog (_NEMOCLAW_GATEWAY_LOG seam for tests). Signed-off-by: Preksha Vijayvargiya --- scripts/nemoclaw-start.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/nemoclaw-start.sh b/scripts/nemoclaw-start.sh index 8a969b4daad..d5cb5687799 100755 --- a/scripts/nemoclaw-start.sh +++ b/scripts/nemoclaw-start.sh @@ -1065,6 +1065,10 @@ PYOVERRIDE # Ref: https://github.com/NVIDIA/NemoClaw/issues/3175 reconcile_agent_model_with_provider() { + # apply_model_override already won; reconciling against the gateway would + # overwrite the user's explicit choice with an inference/-prefixed variant. + [ -z "${NEMOCLAW_MODEL_OVERRIDE:-}" ] || return 0 + if [ "$(id -u)" -ne 0 ]; then return 0 fi @@ -4464,7 +4468,9 @@ openclaw_runtime_guard_chain_complete() { restore_openclaw_runtime_guard_chain() { if ! openclaw_runtime_guard_chain_complete; then - echo "[gateway-recovery] WARNING: /tmp guard chain missing or unsafe - restoring library guards from packaged preloads (#2478/#2701)" >&2 + local _guard_warn="[gateway-recovery] WARNING: /tmp guard chain missing or unsafe - restoring library guards from packaged preloads (#2478/#2701)" + echo "$_guard_warn" >&2 + echo "$_guard_warn" >>"${_NEMOCLAW_GATEWAY_LOG:-/tmp/gateway.log}" 2>/dev/null || true fi # Preserve startup ordering: immutable core preloads first, then the