#Bug Report: Spurious empty tool calls after gateway restarts

1 messages · Page 1 of 1 (latest)

frail shore
#

ersion: 2026.4.21 (f788c88)
Environment: Hostinger VPS, Docker container, Control UI via browser (webchat)

Issue 1: Empty tool calls firing after gateway restarts
After one or more gateway restarts in a session, the model begins generating spurious empty tool calls between real ones. Example error:
Validation failed for tool "write": content: must have required property 'content'
Validation failed for tool "exec": command: must have required property 'command'
The calls fire with empty parameters — not missing values I forgot to provide, but genuinely empty calls generated autonomously between intentional tool calls. Persists across browser refreshes and new browser sessions. Only way to partially resolve is to stop working and wait, but it returns. Has happened multiple times tonight across 3-4 gateway restarts.

Issue 2: NEXOS_API_KEY env var overrides model config
NEXOS_API_KEY is injected at the Docker container level as an environment variable. Despite setting agents.defaults.model.primary = "anthropic/claude-sonnet-4-5" in openclaw.json, and even after removing the Nexos provider from config and explicitly disabling the Nexos plugin, the gateway continues routing through Nexos. The env var appears to be picked up before plugin config is applied.

Result: Anthropic API key goes unused, Nexos tokens consumed instead.

Workaround needed: How to permanently override an env-var-injected API key via config, without SSH access to modify the Docker environment directly.

Impact: Both issues together make sustained build sessions unreliable — tool failures interrupt long HTML builds, and the cost routing is wrong.

coarse magnetBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

rustic hearthBOT
#

This looks like two separate problems, and neither sounds like “you forgot a parameter.”

For Issue 1: the empty write {} / exec {} calls after restarts smells like bad/replayed session state after an interrupted stream or gateway restart. Immediate workaround:

  1. Stop the current run.
  2. Send /new or /reset as a standalone message in that WebChat session.
  3. Start the task again from a short summary, not the long broken transcript.

Docs note /new and /reset start a fresh session for the chat: https://docs.openclaw.ai/start/openclaw#sessions-and-memory

If it happens again on 2026.4.21, I’d treat that as a bug worth filing: https://github.com/openclaw/openclaw/issues. The useful evidence is: version, provider actually used, logs around the gateway restart, and the redacted validation errors. If you can run it, openclaw status --all is the safe pasteable report: https://docs.openclaw.ai/help/faq#first-60-seconds-if-something-is-broken

For Issue 2: config cannot override a Docker/process env var. OpenClaw’s env precedence is “never override existing values”: process env wins, then .env, then global .env, then config env, and config only applies if missing. So there isn’t a config setting that can make NEXOS_API_KEY disappear if Docker injected it. Docs: https://docs.openclaw.ai/help/environment#precedence-highest--lowest

Best permanent fix is to remove/unset NEXOS_API_KEY in Hostinger’s container environment panel and restart the container/gateway.

If you truly can’t change Docker env, the best config-side containment is to make Nexos impossible to select/fall back to:

#
{
  agents: {
    defaults: {
      model: {
        primary: "anthropic/claude-sonnet-4-5",
        fallbacks: []
      },
      models: {
        "anthropic/claude-sonnet-4-5": {}
      }
    }
  }
}

Then start a fresh session with /new and check /model status / /model list. agents.defaults.models acts as an allowlist for model selection/overrides, so if Nexos still routes after that, that’s a routing bug, not expected config behavior: https://docs.openclaw.ai/help/faq-models#why-do-i-see-model--is-not-allowed-and-then-no-reply

#

Also check whether the current session has a sticky /model override set to Nexos; config changes won’t necessarily fix an already-running session until you /new or switch with /model anthropic/claude-sonnet-4-5.

frail shore
#

-+Thank you! Great response and helpful. Followup question: Why does my agent say 'model override not allowed' and revert to Nexos after every restart? How do I change the model to Anthropic permanently?

rustic hearthBOT
#

That specific combo usually means two things are happening:

  1. You have an agents.defaults.models allowlist, and Anthropic is not in it.
    So when you do /model anthropic/claude-sonnet-4-5, OpenClaw rejects it as “model override not allowed.”

  2. Your persisted/default model is still Nexos somewhere, so after restart/session reload it falls back to the allowed/default Nexos model.

To make Anthropic permanent, you need both: allow Anthropic and make it primary.

In ~/.openclaw/openclaw.json, set/merge something like:

{
  agents: {
    defaults: {
      model: {
#
        primary: "anthropic/claude-sonnet-4-5",
        fallbacks: []
      },
      models: {
        "anthropic/claude-sonnet-4-5": { alias: "sonnet" }
      }
    }
  }
}

Important details:

  • If agents.defaults.models already exists, it acts as an allowlist. Either add the Anthropic model to it, or remove that whole models allowlist if you don’t want restrictions.
  • If Nexos is listed under agents.defaults.model.fallbacks, remove it, or OpenClaw may route there on provider/auth failures.
  • Make sure Anthropic auth is available to the gateway process — usually ANTHROPIC_API_KEY in ~/.openclaw/.env or an Anthropic auth profile.