Skip to content

[Bug]: guard missing model.input in model list/scan paths #35416

@mcaxtr

Description

@mcaxtr

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Model list/scan paths still assume model.input exists; when custom provider models omit it, OpenClaw can throw runtime TypeError in current main.

Steps to reproduce

  1. Configure/use a custom provider model entry that omits input.
  2. Run model list/scan paths (for example model listing and OpenRouter probing).
  3. Observe errors from .join or .includes on undefined.

Expected behavior

If input is missing, list/scan paths should fall back safely (for example text) and not throw.

Actual behavior

upstream/main still has direct dereferences:

  • src/commands/models/list.registry.ts:147 uses model.input.join("+")
  • src/agents/model-scan.ts:329 and src/agents/model-scan.ts:475 use model.input.includes(...)

OpenClaw version

main branch (checked on March 5, 2026)

Operating system

Cross-platform code path (repro not OS-specific)

Install method

Source checkout / main branch verification

Logs, screenshots, and evidence

Code evidence on main:
- src/commands/models/list.registry.ts:147
- src/agents/model-scan.ts:329
- src/agents/model-scan.ts:475

Related PR with fix: #12191
Previous issue that was closed stale: #12165

Impact and severity

Affected: Users with custom provider model metadata lacking input.
Severity: Medium to High depending on workflow; can block list/scan usage.
Frequency: Deterministic when input is absent.
Consequence: Runtime exceptions in model inspection/scanning paths.

Additional information

This intentionally supersedes #12165 (closed not planned) because the underlying behavior is still present in main as of March 5, 2026.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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