Skip to content

fix(memory): include final day for date-only time_to - #5818

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
TejasS1233:fix-3524-date-only-time-to
Oct 26, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
TejasS1233:fix-3524-date-only-time-to

Conversation

@TejasS1233

Copy link
Copy Markdown
Contributor

Date-only time_to values now include the whole final day. Before this change, recall(time_to="2025-03-31") and search_past_conversations(time_to="2025-03-31") silently dropped everything stored after midnight on March 31, so a normal "through March 31" query returned a confidently incomplete answer.

A bare YYYY-MM-DD upper bound is now normalized once at each tool boundary to T23:59:59.999999. time_from is unchanged: a date-only lower bound already includes the full first day, so normalizing it would create the mirror bug.

Fixes #3524.

Test plan

  • pytest tests/unit/test_memory_mixin.py -k time_to_date_includes_boundary_day
  • pytest tests/unit/test_memory_mixin.py tests/unit/test_memory_store.py
  • python util/lint.py --black --isort --pylint --flake8

A date-only time_to was compared lexically against full ISO timestamps, so everything stored after midnight on the final day was silently excluded. Normalize a bare date upper bound to the end of that day at the recall and conversation-search tool boundaries. time_from is intentionally unchanged because a date-only lower bound already includes the full first day.

Fixes amd#3524.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 08:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions github-actions Bot added tests Test changes agents labels Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

Asking memory for anything "through March 31" now includes everything from March 31, not just what was saved at midnight. The fix covers both memory recall and past-conversation search, and adds a test for each path. I found no blocking issues.

Real-world evidence

N/A: no evidence bundle was produced for this run. The change sits behind agent tool calls (recall, search_past_conversations) rather than a CLI, REST or UI surface, so this verdict rests on static review and the new unit tests. The tests were not run in this review job.

🔍 Technical details

Issues found

🟢 Same-day range has no test (tests/unit/test_memory_mixin.py). time_from="2025-03-31", time_to="2025-03-31" is the case users hit most, and before this fix it only matched items stored exactly at midnight. One test asserting that a 15:00 item from that day comes back would lock in the change.

Checked and fine

  • Comparisons are lexical ISO string comparisons. Stored values like …T15:00:00-07:00, …T23:59:59-07:00 and …T23:59:59+00:00 all sort below …T23:59:59.999999, because - and + sort before .. The new bound includes the whole day for any offset or fraction format the store writes.
  • Normalizing once at the tool entry (memory.py:4798, memory.py:5107) reaches every downstream filter: _hybrid_search, the SQL created_at <= ?, and the in-Python BM25 and conversation filters.
  • Input that isn't a bare valid date, or an impossible date like 2025-02-30, passes through unchanged. The regex plus strptime pair is the strict check, since strptime alone would accept 2025-3-1.
  • Leaving time_from alone is correct. A date-only lower bound already includes the start of the day.
  • _hybrid_search called directly as a Python API still takes the raw bound. That is fine: it is an internal method, and its callers pass full timestamps.

Strengths

  • The tests pin _now_iso to a mid-afternoon timestamp with a UTC offset. That is the exact shape that used to be dropped, and the tests cover the query, browse and conversation-search paths.
  • The helper is small and only changes a value it fully recognizes as a date.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 26, 2026
Merged via the queue into amd:main with commit e44fd39 Oct 26, 2026
35 checks passed
@kovtcharov-amd kovtcharov-amd mentioned this pull request Oct 26, 2026
5 of 9 tasks
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 26, 2026
## Why this matters

v0.25.2 is a bug-fix release on top of v0.25.1: setup and install no
longer stop at the first failed step, shell and file access handle
Windows paths and text encodings, the Agent UI and desktop app stop
showing misleading states, and document search, email and skills each
lose a handful of rough edges. 55 commits since v0.25.1; notes are in
`docs/releases/v0.25.2.mdx` and credit 15 outside contributors.

## Test plan

- [x] `python util/validate_release_notes.py docs/releases/v0.25.2.mdx
--tag v0.25.2` passes
- [x] `mintlify validate` (from `docs/`) passes
- [x] `python util/check_doc_links.py --internal-only`, `python
util/check_doc_versions.py` and `node
installer/version/bump-ui-version.mjs --check` pass
- [x] `python util/check_component_core_api.py --release-version 0.25.2`
passes
- [x] `pytest tests/unit/test_docs_json_release.py
tests/unit/test_check_component_core_api.py
tests/unit/test_release_tag.py
tests/unit/test_hub_core_version_gate.py`: 156 passed
- [ ] CI green on the merge commit
- [ ] `release_train_dryrun.yml` passes on that commit before the RC tag

## Evals to re-run on the RC tag

LLM-affecting PRs merged without per-PR evals; run these on
`v0.25.2-rc1`:

- `gaia_shell` and shell/safety (amd#5794, amd#5751, amd#5768)
- `gaia_honesty` (amd#5753)
- `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5422, amd#5755)
- `rag_retrieval` and `rag_quality` (amd#5742, amd#5754, amd#5761, amd#5817, amd#5812)
- email scenarios (amd#5767, amd#5811)
- `tool_selection` and `error_recovery` (amd#5732)
- Claude provider thinking replay (amd#5072)
- memory categories (amd#5818 merged; amd#5756 has not)

## Release checklist

- [ ] Freeze main, wait for green CI on the exact commit, pass
`release_train_dryrun.yml`, then push `v0.25.2-rc1`
- [ ] Extend the changelog if main gains commits before the tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(memory): a date-only time_to drops the whole final day from recall

3 participants