Skip to content

infer model run --gateway fails 'No callable tools remain' when modelRun:true + tools.allow has explicit entries (4.25) #73878

Description

@islandpreneur007

Upstream bug report DRAFT — pending Trent blind-pass

Target: github.com/openclaw/openclaw/issues
Status: DRAFT v0 — not filed. Needs Trent review of repro + RCA before submission.


Title

infer model run --gateway fails with "No callable tools remain" when modelRun:true + tools.allow has explicit entries (4.25 + 4.26)

Environment

  • Originally observed: OpenClaw 2026.4.25 (aa36ee6)
  • Confirmed still present in: OpenClaw 2026.4.26 (be8c246)
  • Install: npm-global at /home/openclawops/.npm-global/lib/node_modules/openclaw/openclaw.mjs (despite update status reporting "pnpm")
  • Verified: vanilla runtime (no local patches)
  • Not present in 4.24 (per source diff)

4.26 source locations

  • dist/selection-D9uTvvsw.js:3917buildEmptyExplicitToolAllowlistError
  • dist/selection-D9uTvvsw.js:6377 — guard invoked during tool allowlist resolution
  • dist/plugin-sdk/src/agents/tool-allowlist-guard.d.ts:9 — type declaration

The 4.26 CLI hang (filed separately as a different bug) is a SEPARATE surface, not a manifestation of this allowlist precheck — these are two distinct issues affecting CLI model probes.

Summary

In 4.25, openclaw infer model run --gateway sets modelRun: true which is intended to disable tools for one-shot model probes. However, the explicit-allowlist precheck (buildEmptyExplicitToolAllowlistError) still runs against tools.allow config and surfaces a fatal error before model invocation. This breaks any gateway-mode CLI model probe in environments where tools.allow has explicit entries.

Blast radius is wider than CLI: any embedded run that orphans a tool name in tools.alsoAllow (e.g. when a plugin is disabled but its tool registrations remain in peripheral config) hits the same precheck and times out the embedded path silently. Observed in production via the active-memory plugin disable cascade on 2026-04-28.

Reproduction

On 4.25 with tools.allow containing explicit entries (e.g. ["*", "lobster", "elevenlabs", ...]):

openclaw infer model run --gateway --model openai-codex/gpt-5.5 --prompt 'reply: ok'

Returns:

Error: No callable tools remain after resolving explicit tool allowlist
(tools.allow: *, lobster, elevenlabs, tavily, firecrawl, fal, runway, exa, voice-call, apify);
tools are disabled for this run.
Fix the allowlist or enable the plugin that registers the requested tool.

Without --gateway (local mode), the same probe succeeds:

openclaw infer model run --model openai-codex/gpt-5.5 --prompt 'reply: ok'
# returns model output normally

Root cause (per source diff)

The code path for infer model run --gateway:

  1. Sets modelRun: true flag
  2. modelRun: true intentionally suppresses tool registration (tools should be disabled for one-shot probes)
  3. BUT: code still runs buildEmptyExplicitToolAllowlistError precheck against tools.allow config
  4. Precheck sees explicit allowlist entries vs registered-tool-set (empty due to suppression)
  5. Concludes "no callable tools remain" and surfaces fatal error

Source location (4.25): runtime/openclaw-2026.4.25/dist/extensions/codex/...buildEmptyExplicitToolAllowlistError function. 4.24 source line ~151163 (per pre-cutover grep).

Suggested fix

Either:

  • Skip buildEmptyExplicitToolAllowlistError precheck entirely when modelRun: true, OR
  • Pass disableTools: true consistently so the precheck short-circuits to non-fatal

The first option is simpler; the second handles other code paths that may end up in the same suppression mode.

Related production impact (worth including in body)

On 2026-04-28, the active-memory plugin was disabled while its tool names (memory_get, memory_search) remained in tools.alsoAllow. The orphaned entries triggered this same precheck on EVERY embedded run — not just CLI gateway-mode. Production lane (Trent agent on Telegram) started failing silently with the same error fingerprint until tools.alsoAllow was emptied.

The bug isn't narrow to --gateway CLI usage. Any embedded run with orphan entries in tools.alsoAllow hits it. Recommend the fix considers both paths.

Workaround (current)

For one-shot model probes from CLI, omit --gateway flag. For embedded runs, ensure tools.alsoAllow only contains entries for currently-registered plugins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions