fix(memory): accept time_window_days alias in query_global#2350
Conversation
The consolidated memory_tree tool schema advertises `time_window_days` (consistent with query_source/query_topic), but QueryGlobalRequest only accepted `window_days`. LLMs following the consolidated schema fail with "missing field window_days" even when a lookback value was supplied as time_window_days. Add #[serde(alias = "time_window_days")] so both field names deserialize correctly. Adds a unit test pinning both paths. Closes tinyhumansai#2252 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthrough
ChangesField deserialization alias
🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested labels: Suggested reviewers:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
graycyrus
left a comment
There was a problem hiding this comment.
Looks good, nice work!
Summary
Fixes a schema mismatch between the consolidated
memory_treetool and the standalonequery_globalsub-tool. The consolidated schema advertisestime_window_days(consistent withquery_source/query_topic), butQueryGlobalRequestonly acceptedwindow_days— causing LLMs that follow the consolidated schema to fail withmissing field window_days.Fix
One-line change: add
#[serde(alias = "time_window_days")]toQueryGlobalRequest.window_daysso both field names deserialize correctly.Changes
src/openhuman/memory/tree/retrieval/rpc.rsTest plan
cargo fmt --all -- --check— cleancargo test -p openhuman "query_global"— 2/2 pass (1 new)window_daysandtime_window_daysdeserialization pathsCredit to @DeadlySilent for the well-documented bug report (#2252) with exact file paths and reproduction steps.
Closes #2252
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests