Skip to content

Fix #2380: [Bug] Overview/health model slots misreport "Not called yet" once the slot's new - #2381

Open
Memtensor-AI wants to merge 2 commits into
MemTensor:dev-v2.0.30from
Memtensor-AI:bugfix/autodev-2380-20260916205231777
Open

Memtensor-AI wants to merge 2 commits into
MemTensor:dev-v2.0.30from
Memtensor-AI:bugfix/autodev-2380-20260916205231777

Conversation

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Description

Fixed #2380: findLatestPersistedModelStatus() in core/pipeline/memory-core.ts previously scanned the newest 500 api_logs rows in JS for a matching role/provider/model triple. On busy installs the 500-row window fills with llm/embedding entries, silently dropping lower-frequency slots (skillEvolver) and causing Overview cards to misreport "Not called yet". Fix: added findLatestModelStatus(role, provider, model) to the api_logs repo using json_extract() SQL filtering with no window, and updated the caller to use it. Added regression test seeding 600 llm rows after one skillEvolver row to pin the fix. All 76 pipeline unit tests pass including the new #2380 regression test.

Related Issue (Required): Fixes #2380

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Not run; documentation-only change.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@whipser030, @hijzy please review this PR.

Reviewer Checklist

…MemTensor#2380)

findLatestPersistedModelStatus() previously fetched the newest 500
api_logs rows and post-filtered in JS for role/provider/model. On busy
installs the target slot (e.g. skillEvolver) is pushed >500 positions
below the head by high-frequency llm/embedding writes, causing the
lookup to silently return null and the Overview card to show 'Not called
yet' even when historical rows exist.

Fix: add findLatestModelStatus(role, provider, model) to the api_logs
repo. It uses json_extract() to filter at SQL level with no window,
returning the single newest matching row. Update
findLatestPersistedModelStatus() to delegate to this method instead.

Regression test seeds 600 llm rows after one skillEvolver row (putting
the target 600 positions out of the old window) and asserts health()
returns the correct lastOkAt timestamp.
@Memtensor-AI

Memtensor-AI commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Open Code Review

Target: PR #2381
Task: 7b8cf69e1d0cd9bd
Base: dev-v2.0.30
Head: bugfix/autodev-2380-20260916205231777
Head SHA: 7ce4811ed3a34778a3d8139ab14c04ab870954e1

OpenCodeReview: Review complete: 0 finding(s) across 5 selected item(s).

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator Author

🔧 Open Code Review requested Agent fix

Open Code Review found 1 issue(s). I have resumed the development Agent to fix them.

  • Task: 7b8cf69e1d0cd9bd
  • Fix attempt: 1/2
  • Finding delta: 0 repeated / 1 new / 0 likely resolved

The Agent will push a new commit to this PR branch. OCR will recheck after the commit is pushed.

Follow-up to MemTensor#2380 addressing OCR review feedback: the json_extract()
predicates in findLatestModelStatus() had no supporting index, so the
lookup was a full-table scan on every /health poll (api_logs holds up
to ~10k rows on busy installs).

Add migration 013 with a partial functional index that covers
tool_name='system_model_status' and matches the query's filter +
ORDER BY shape. SQLite's planner picks it up and turns the scan into
an index seek. Migration 013 uses tableExists('api_logs') so the
partial-schema test path in migrator.test.ts continues to pass.

Regression-test the property that the /health lookup is index-driven
(EXPLAIN QUERY PLAN sees `USING INDEX idx_api_logs_model_status`) so
future changes can't quietly regress it.
@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:generated Generated or modified by AI | 由 AI 生成或修改 area:plugin OpenClaw & Hermes status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants