fix(cli): status uses /memories?count=true instead of /export#667
fix(cli): status uses /memories?count=true instead of /export#667Taeyoung96 wants to merge 1 commit into
Conversation
Signed-off-by: Taeyoung96 <tyoung96@naver.com>
|
@Taeyoung96 is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR introduces two reusable metrics helper functions for validating and aggregating observation and memory counts from API responses, then integrates them into the CLI status command to replace direct array-length calculations and switches the API endpoint from ChangesMetrics Helpers and CLI Status Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
Summary
`agentmemory status` calls `/export` to derive the observation and memory
counts shown in the status footer. `/export` is unbounded — it serialises
every observation and memory in one iii invocation that hits the 30 s
engine timeout on any installation that has grown past the demo stage.
Result: the footer always shows `0 obs / 0 memories` for real users while
`memory_diagnose` returns all-green and the server is fully healthy.
`#648` added `/memories?count=true` exactly to fix this class of problem for
the viewer (`#544`). `runStatus()` was never updated to use it.
Fix
instead of the export payload — no extra round-trip needed.
`src/cli/status-metrics.ts`: two pure functions that normalise the
count-endpoint response and the sessions array, guarding against
non-finite / negative / NaN values so the display is always a
well-defined non-negative integer.
Diff
normal path, missing fields, NaN, negative, non-array input)
Validation
previously showed `0 obs`; now returns correct totals in <200 ms
Relation to prior work
Follow-up to #648 (#544). That PR added the count endpoint and updated
the viewer; this PR closes the same gap in the CLI status command.
Summary by CodeRabbit
Refactor
statuscommand.Tests