fix: NULL raw_id crash, feedback bloat, and runtime metrics#336
Merged
CalebisGross merged 1 commit intomainfrom Mar 21, 2026
Merged
fix: NULL raw_id crash, feedback bloat, and runtime metrics#336CalebisGross merged 1 commit intomainfrom
CalebisGross merged 1 commit intomainfrom
Conversation
…, #334) #334 — Fix scanMemoryFrom crash on NULL raw_id: - Use sql.NullString for raw_id in scanMemoryFrom (same pattern as all other nullable columns). Prevents "converting NULL to string" crash when memories have NULL raw_id from consolidation merges or imports. - Add raw_id fallback in backup import: set raw_id = id if empty. #333 — Fix retrieval_feedback table bloat: - Null out traversed_assocs and access_snapshot after feedback is applied in HandleFeedback. These fields are only needed for Hebbian adjustment and are never read again after. - Add PruneOldFeedback store method (30-day TTL) called during consolidation Step 10. Prevents unbounded table growth. #332 — Add runtime resource metrics to health API: - HealthResponse now includes heap_alloc_mb, heap_sys_mb, goroutines, gc_pause_total_ms, uptime_seconds, db_size_mb. - Periodic disk HealthReport includes heap_alloc_mb, goroutines, db_size_mb. - ServerDeps gains StartTime for uptime calculation. Closes #332, closes #333, closes #334. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Fixes three issues discovered during the dashboard work session:
scanMemoryFromcrashes on NULLraw_idwithsql: Scan error converting NULL to string. Root cause:raw_idscanned into plainstringinstead ofsql.NullString. Also addsraw_id = idfallback during backup import.retrieval_feedbackstores full traversal paths (300-600KB per row at scale) forever. Fix: null out traversal data after feedback is applied + 30-day TTL cleanup during consolidation./api/v1/healthnow returnsheap_alloc_mb,heap_sys_mb,goroutines,gc_pause_total_ms,uptime_seconds,db_size_mb. Periodic disk health report gets the same.Test plan
make build && make testpass/api/v1/memoriescurl /api/v1/healthshows heap, goroutines, uptime, DB sizeCloses #332, closes #333, closes #334.