Skip to content

fix(viewer): count dashboard memory corpus#973

Open
snvtac wants to merge 1 commit into
rohitg00:mainfrom
snvtac:snvtac/951-dashboard-memory-corpus-count
Open

fix(viewer): count dashboard memory corpus#973
snvtac wants to merge 1 commit into
rohitg00:mainfrom
snvtac:snvtac/951-dashboard-memory-corpus-count

Conversation

@snvtac

@snvtac snvtac commented Jun 24, 2026

Copy link
Copy Markdown

Fixes #951

Summary

  • Use the existing count-only memories endpoint for the dashboard saved-memory count instead of fetching a capped latest-memory list.
  • Count the Memories tile from the loaded long-term corpus: saved memories, session summaries, semantic facts, and procedural knowledge.
  • Keep Lessons and Crystals on their own tiles so their capped dashboard payloads do not distort the Memories total.
  • Add regression coverage for the dashboard request and rendered Memories tile.

Verification

  • npx vitest run test/viewer-session-id.test.ts test/memories-pagination.test.ts
  • npm run skills:check
  • npm test
  • npm run build

Summary by CodeRabbit

  • New Features

    • The viewer dashboard now shows a unified Memories total that combines saved memories, session summaries, semantic facts, and procedural items.
    • A new descriptive sublabel explains which memory types are included in the total.
  • Bug Fixes

    • The Memories card now reflects the broader long-term corpus instead of only showing the latest saved versions, giving a more accurate dashboard count.

Signed-off-by: Haoqian Li <haoqian.li@finalroundai.com>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

@snvtac is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ca62f1d0-95c2-47ae-9ef4-39ee76c4d693

📥 Commits

Reviewing files that changed from the base of the PR and between f6f9e3c and 7949e83.

📒 Files selected for processing (3)
  • src/viewer/index.html
  • test/memories-pagination.test.ts
  • test/viewer-session-id.test.ts

📝 Walkthrough

Walkthrough

The viewer dashboard Memories tile is updated to display a composite count derived from persisted saved memories, session summaries, semantic facts, and procedural items. The memories fetch switches from a capped list endpoint to a count-only endpoint, state stores a numeric memoryCount instead of an array, and renderDashboard() computes and renders a dynamic sublabel describing which memory kinds contributed.

Changes

Unified Dashboard Memories Tile Count

Layer / File(s) Summary
Dashboard state shape and fetch endpoint
src/viewer/index.html
State field changes from dashboard.memories array to dashboard.memoryCount numeric; fetch changes from memories?latest=true&limit=500 to memories?latest=true&count=true; result stored as state.dashboard.memoryCount from results[2].latestCount.
renderDashboard() composite count and sublabel
src/viewer/index.html
Derives savedMemoryCount, summaryCount, semantic, and procedural sub-counts; builds memoryKinds list and memorySub string; Memories stat card renders the computed total and dynamic sublabel instead of d.memories.length with the fixed "latest versions" text.
Test updates
test/memories-pagination.test.ts, test/viewer-session-id.test.ts
Pagination test replaces limit=500 assertion with count=true assertion and absence check for limit=500; new test in viewer-session-id populates full dashboard state and asserts composite Memories value, sublabel string, and exclusion of fallback count.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • rohitg00/agentmemory#648: Introduced the /agentmemory/memories count=true query parameter behavior and viewer pagination updates that this PR's fetch-endpoint switch directly depends on.

Poem

🐇 No more counting just one lonely save,
The dashboard now tallies each memory brave —
Semantic and summaries, procedural too,
A count that reflects what your memories do!
The tile reads true now, hooray and hooray! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: counting the viewer dashboard memory corpus.
Linked Issues check ✅ Passed The PR matches #951 by switching the MEMORIES tile to a broader corpus count and adding regression tests.
Out of Scope Changes check ✅ Passed The code changes and tests stay focused on the dashboard memory count fix with no unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard MEMORIES tile counts only memory_save facts, not the semantic/summary corpus (reads "1" on a healthy install)

1 participant