Repository navigation
feat(web): add health/stats view to the web UI - #416
Merged
EyJunge1 merged 6 commits intoOct 18, 2026
Merged
Conversation
Extend GET /api/stats with per-shard memory health (counts, newest/oldest ages, same-tag duplication proxy, file/registration mismatch), an active user-profile summary, and a 14-day activity series parsed from the plugin's structured logs (captures, skips, profile/compaction injections, errors bucketed by message). Add a Stats tab rendering it, with per-section degradation so the view keeps reporting during database incidents. Read-only: no new writes or capture/injection behavior changes.
The stats aggregation test creates two shards, inserts three vectors, and runs the full handleStats walk in one it(). On the windows-latest runner that exceeds bun's default 5s per-test timeout; the timeout runs afterEach cleanup while the walk is still in flight, so per-shard reads fail against the deleted temp dir and the orphaned assertions report total 0. Give the test the same 30s budget plugin-bundle-boundary uses.
Collaborator
|
cool feature |
Keep ownership probes cheap with ?probe=1, commit shard totals only after a full walk succeeds, hard-fail shard listing for explorer totals, and align the sim fixture total with memories.json.
EyJunge1
approved these changes
Oct 18, 2026
Screenshots in .github/pics are unnecessary; keep the Stats section as text.
5 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a read-only health/stats view to the web UI so memory-system health is visible day-to-day instead of requiring manual log/DB audits.
GET /api/stats(existingtotal/byScope/byTypeunchanged) with:Turso ready gate failed,listMemories)opencode-mem.log.old, multi-day live files) are handled/stats(sidebar entry, routing, translations for en/de/zh/ar/tr/nl) rendering overview cards, the 14-day activity table with expandable error buckets, and a shard diagnostics table with mismatch/missing-file warningsOPENCODE_MEM_SIM=1 bun run web:dev) now serves a representative stats fixture so the tab is developable without a live storeNo new writes anywhere; capture/injection behavior untouched.
Screenshots
Desktop viewport captures (1945 × 1650), using demo data.
Light theme
Expanded error bucket
The 63-error day is expanded to show its message buckets.
Test plan
Exercised the change locally
Noted any follow-up or known limitations
New
tests/stats-log-parsing.test.ts(parser fixtures, including real incident log signatures:Turso ready gate failedWAL short-reads,Failed to load skills for OpenCode registration,listMemories: error) andtests/stats-service.test.ts(temp fixture DBs: shard aggregation, duplicate-tag counting, zero-filled 14-day series, missing-profile degradation)bun run check(format + lint + typecheck) passes;bun run web:buildpasses (svelte-check 0 errors / 0 warnings)Full
bun test: 777 pass / 4 skip; the 3 failures reproduce on a cleanmaincheckout in this Linux environment before this change (Bun.build resolution inplugin-bundle-boundary, one macOS-shaped config default assertion, one profile-confidence scheduler test) — no new failures introducedVisual check of the Stats tab against the sim fixture: degradation states, count-mismatch and missing-file warnings, and error-bucket expansion all render
Known limitations: the same-tag count is a deliberately weak duplication proxy (a real near-duplicate rate needs an embedding similarity pass); log-based counters only cover days whose rotated log files still exist (rotation retains 30 days).
Checklist
mainbun testpasses (3 pre-existing failures onmainin this environment, noted above)bun run typecheckpassesbun run checkpasses (format + lint + typecheck)