Skip to content

Runtime LLM allowlist diagnostics can double-prefix provider-qualified model refs #84887

@100yenadmin

Description

@100yenadmin

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

OpenClaw runtime LLM policy reports a denied plugin model override as openrouter/openrouter/gpt-5.4-mini when Lossless passes an OpenRouter-shaped model ref. The canonical provider-precedence bug that caused Lossless to select OpenRouter in this incident is tracked upstream in Lossless: Martian-Engineering/lossless-claw#738

Steps to reproduce

  1. Have a plugin call api.runtime.llm.complete with a model selection that resolves to provider openrouter and model id openrouter/gpt-5.4-mini.
  2. Configure the plugin runtime LLM allowlist with the expected short ref, e.g. openrouter/gpt-5.4-mini.
  3. Trigger the runtime LLM policy check.
  4. Observe the host policy error use a double-prefixed ref.

Expected behavior

OpenClaw should normalize provider/model refs consistently for runtime LLM policy checks and diagnostics. It should not report openrouter/openrouter/... when the actionable model ref is openrouter/....

Actual behavior

Local 2026.5.19 logs showed:

[lcm] runtime.llm.complete error: Plugin LLM completion model override "openrouter/openrouter/gpt-5.4-mini" is not allowlisted for plugin "lossless-claw".

Lossless had requested/reported:

Requested model: openrouter/gpt-5.4-mini

The doubled provider in the host error made the remediation confusing.

OpenClaw version

2026.5.19

Operating system

macOS 26 / Darwin arm64

Install method

Global OpenClaw gateway managed by launchd (ai.openclaw.gateway)

Model

Observed host-normalized ref: openrouter/openrouter/gpt-5.4-mini

Actionable/plugin-facing ref: openrouter/gpt-5.4-mini

Provider / routing chain

Plugin runtime LLM call -> OpenClaw api.runtime.llm.complete -> runtime model override policy

Additional provider/model setup details

This issue is intentionally narrowed to OpenClaw host normalization/diagnostics.

The broader incident was not intended to use OpenRouter. Lossless was configured for openai-codex/gpt-5.4-mini, but a bare LCM_SUMMARY_MODEL=gpt-5.4-mini env override caused Lossless to lose the configured provider and resolve through the active runtime/fallback context. That is tracked in Lossless upstream:

Logs, screenshots, and evidence

Source paths on upstream/main:
- src/plugins/runtime/runtime-llm.runtime.ts:220 normalizeAllowedModelRef(raw)
- src/plugins/runtime/runtime-llm.runtime.ts:237-238 returns `${normalized.provider}/${normalized.model}`
- src/plugins/runtime/runtime-llm.runtime.ts:401-406 builds resolvedModelRef from normalizeModelRef(selection.provider, selection.modelId)
- src/plugins/runtime/runtime-llm.runtime.ts:407-412 checks the allowlist
- extensions/openrouter/openclaw.plugin.json:8-12 sets openrouter prefixWhenBare=openrouter
flowchart TD
  A[Plugin request model openrouter/gpt-5.4-mini] --> B[OpenClaw runtime.llm.complete]
  B --> C[selection provider=openrouter]
  C --> D[selection modelId=openrouter/gpt-5.4-mini]
  D --> E[host resolvedModelRef]
  E --> F[openrouter/openrouter/gpt-5.4-mini]
  F --> G[policy denial / confusing diagnostic]

  classDef bad fill:#ffd6d6,stroke:#cc3333,color:#111;
  class F,G bad;
Loading

Impact and severity

Affected: plugin authors/users debugging runtime LLM allowlist failures for provider/model refs that already include a provider segment.
Severity: Medium as a host issue by itself; it becomes high-severity only when combined with the Lossless provider-precedence bug in #738.
Frequency: Reproduced in local logs during a 99% context incident.
Consequence: diagnostics point to a malformed model ref and can lead users to add the wrong allowlist entries.

Additional information

Suggested OpenClaw fix shape: normalize runtime LLM model refs with a helper that strips only duplicated provider prefixes after normalizeModelRef(), and add a regression where provider="openrouter", modelId="openrouter/gpt-5.4-mini", and allowedModels=["openrouter/gpt-5.4-mini"] does not produce openrouter/openrouter/... in the check/error path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions