Skip to content

2026.6.1: agent_model_catalogs / model_capability_cache tables defined but never written; models list takes 25–53s #90368

@xdemocle

Description

@xdemocle

Summary

In 2026.6.1, two new SQLite tables (agent_model_catalogs, model_capability_cache) are created by the state-db migration but no producer code in the shipped dist/ build ever writes to them. As a result openclaw models list falls back to live per-provider fetches on every call.

Measured on Linux, 2026.6.1 (2e08f0f), warm gateway:

command time
openclaw models status 2.9 s (baseline: CLI + config load)
openclaw models list (configured providers only) 25.7 s
openclaw models list --all 53.0 s

Repeated calls don't speed up — there's no persisted catalog cache.

Evidence

Schema is present:

$ grep -nE "agent_model_catalogs|model_capability_cache" dist/openclaw-state-db-*.js
536:CREATE TABLE IF NOT EXISTS model_capability_cache (
554:CREATE INDEX IF NOT EXISTS idx_model_capability_cache_provider_updated ON model_capability_cache(...)
557:CREATE TABLE IF NOT EXISTS agent_model_catalogs (
564:CREATE INDEX IF NOT EXISTS idx_agent_model_catalogs_agent_dir ON agent_model_catalogs(...)

No producer anywhere in dist/:

$ grep -rnE 'INSERT INTO (agent_model_catalogs|model_capability_cache)' dist/
(no matches)
$ grep -rnE '"agent_model_catalogs"|'\''agent_model_catalogs'\''|`agent_model_catalogs`' dist/
(no matches)
$ grep -rnE '"model_capability_cache"|'\''model_capability_cache'\''|`model_capability_cache`' dist/
(no matches)

Both tables stay at 0 rows across restarts, after openclaw plugins registry --refresh, and after invoking models list --all.

(The OpenRouter capability cache under plugin_state_entries / core:openrouter-model-capabilities namespace models.v3 is wired correctly via createCorePluginStateSyncKeyedStore in provider-stream-*.js. That's a different, working path. The two new tables look like a separate planned cache whose writer didn't ship.)

Repro

  1. Fresh-start gateway on 2026.6.1.
  2. sqlite3 ~/.openclaw/state/openclaw.sqlite "SELECT COUNT(*) FROM agent_model_catalogs; SELECT COUNT(*) FROM model_capability_cache;" → both 0.
  3. time openclaw models list --all → ~50 s on first call.
  4. Re-run step 2 → still both 0.
  5. Re-run step 3 → still ~50 s; no caching benefit.

Expected

After the first models list --all, subsequent calls should hit the new SQLite tables and complete in well under 1 s.

Environment

  • OpenClaw 2026.6.1 (2e08f0f)
  • Linux (kernel 5.15)
  • Node 24.15.0
  • Providers configured: minimax, anthropic, mistral (no OpenRouter)

Notes

Also noticed (likely separate, happy to file separately if useful):

  • [state-migrations] Legacy state migration warnings: Left plugin install index in place because shared SQLite state has conflicting plugin install metadata for: acpx, brave, diffs, memory-lancedb
    Triggered by version drift between ~/.openclaw/plugins/installs.json (legacy) and installed_plugin_index in ~/.openclaw/state/openclaw.sqlite. openclaw plugins registry --refresh only rebuilds SQLite, leaving the legacy file out of sync — so the warning fires on every restart until the legacy file is removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    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