Skip to content

fix(server): wire 'at' time-travel param into /room/recall - #1085

Merged
ajianaz merged 2 commits into
developfrom
fix/room-recall-at-param
Aug 24, 2026
Merged

ajianaz merged 2 commits into
developfrom
fix/room-recall-at-param

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

What

POST /room/recall now honors the at (time-travel) parameter instead of silently dropping it.

Why

RoomRecallRequest had no at field, so serde ignored it and results were identical with and without at — callers relying on room time-travel got silently incorrect data. Closes #1082.

Changes

  • RoomRecallRequest gains at: Option<String> (bug: room/recall silently ignores 'at' (time-travel) parameter — RoomRecallRequest missing field #1082)
  • Handler parses & validates at up front — invalid RFC3339 → 400 (loud, not silent)
  • Both paths apply point-in-time filtering with the same temporal rules as core recall_at_time: created_at <= at, valid_from <= at, valid_until > at, not deprecated:
    • chronological (no-query) path: post-filter preserving order
    • semantic path: post-filter + truncate to limit
  • docs/api-reference.md regenerated (docgen)

Testing

  • cargo test -p uteke-server: 8 passed, 0 failed (5 new)
  • New tests: future/invalidated/not-yet-valid/deprecated exclusion, inclusive created_at boundary, order preservation, at deserialization regression (field recognized + omitted → None)
  • cargo clippy -p uteke-server --all-features: clean

RoomRecallRequest now accepts 'at' (RFC3339). Invalid timestamps
return 400 instead of being silently dropped. Both recall paths
(chronological fallback + semantic) apply point-in-time filtering
using the same temporal rules as core recall_at_time: created_at <= at,
valid_from <= at, valid_until > at, not deprecated.
…ogical path

Cora MAJOR on #1085: SQL LIMIT truncated candidates before the
point-in-time post-filter, returning fewer results than requested.
Fetch 3x (min limit+10) when 'at' is set, then truncate after filtering.
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

❌ Blocked — critical issues found.

🔴 Error (1)

  • crates/uteke-server/src/handlers.rs:2322 — memory_exists_at rejects any memory with deprecated == true regardless of when it was deprecated. A memory that was valid at pit but deprecated later will be incorrectly excluded from time-travel results, defeating the purpose of recalling past state. The Memory struct has updated_at, but there is no deprecation timestamp available here; without one, the current behavior silently misrepresents historical state. At minimum this limitation should be documented, or the deprecation time should be tracked and compared against pit.

Review powered by cora-code · BYOK · MIT

}
if let Some(valid_until) = memory.valid_until {
if valid_until <= pit {
return false;
@ajianaz
ajianaz merged commit 0ef1854 into develop Aug 24, 2026
13 of 14 checks passed
@ajianaz
ajianaz deleted the fix/room-recall-at-param branch August 24, 2026 00:52
ajianaz added a commit that referenced this pull request Aug 24, 2026
)

Cora review on #1085 flagged that deprecated memories are excluded
from time-travel regardless of when they were deprecated. The schema
lacks a deprecation timestamp, so this cannot be fixed without a
schema migration (tracked in #1086). Document the limitation at the
predicate until then.

Co-authored-by: ajianaz <[email protected]>
ajianaz added a commit that referenced this pull request Sep 6, 2026