Skip to content

Persist OpenRouter model cache in SQLite#88851

Merged
steipete merged 1 commit into
mainfrom
codex/sqlite-openrouter-model-cache
Jun 1, 2026
Merged

Persist OpenRouter model cache in SQLite#88851
steipete merged 1 commit into
mainfrom
codex/sqlite-openrouter-model-cache

Conversation

@steipete

@steipete steipete commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move OpenRouter model capability persistence from state/cache/openrouter-models.json to the shared SQLite state DB via a core plugin-state namespace
  • keep the in-memory cache and one-shot OpenRouter fetch behavior, with no runtime JSON fallback
  • cover SQLite reuse across fresh module imports and retired JSON cache rebuild behavior

Verification

  • node scripts/run-vitest.mjs src/agents/embedded-agent-runner/openrouter-model-capabilities.test.ts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.agents.json --incremental --tsBuildInfoFile /tmp/openclaw-openrouter-cache-agents.tsbuildinfo
  • pnpm lint --threads=8
  • git diff --check origin/main...HEAD && git diff --check
  • /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode local -> clean, no accepted/actionable findings

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Persist OpenRouter model cache in SQLite This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

steipete commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Ready to land.

Exact head: a61323509e26361a75979412674771bf08329ec6

Local proof:

  • node scripts/run-vitest.mjs src/agents/embedded-agent-runner/openrouter-model-capabilities.test.ts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.agents.json --incremental --tsBuildInfoFile /tmp/openclaw-openrouter-cache-agents.tsbuildinfo
  • pnpm lint --threads=8
  • git diff --check origin/main...HEAD && git diff --check
  • /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode branch --base origin/main

GitHub proof:

  • Real behavior proof, dependency guard, actionlint, no-tabs, and label passed on this head.
  • CodeQL/OpenGrep/preflight/security-fast were still queued and non-blocking when checked.

Known gaps:

  • No live OpenRouter network call; behavior is covered with mocked fetch and SQLite-backed cache reuse.

@steipete steipete merged commit 1d4277b into main Jun 1, 2026
46 of 51 checks passed
@steipete steipete deleted the codex/sqlite-openrouter-model-cache branch June 1, 2026 01:12
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 1, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant