Skip to content

fix(api): honor namespace filter on GET /room/memories (#1288) - #1290

Merged
ajianaz merged 2 commits into
developfrom
fix/1288-room-memories-namespace-filter
Sep 28, 2026
Merged

ajianaz merged 2 commits into
developfrom
fix/1288-room-memories-namespace-filter

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

What

  • GET /room/memories now honors the namespace query param: parse it in the handler and pass it through to a new Uteke::recall_room_scoped(room_id, author, namespace, limit).
  • Core: Store::recall_room becomes a compatibility wrapper delegating to recall_room_scoped (additive, no caller breakage); the duplicate 4-variant SQL collapses into one dynamically composed WHERE clause — literal fragments stay in SQL text, every value is bound as a parameter (same owned Box<dyn ToSql> pattern as bulk.rs).
  • Usage string (uteke-serve endpoint listing) and /tools API-registry description updated; docs/api-reference.md regenerated via docgen.
  • Tests: core-level multi-namespace room test (scoped filter, combined author+namespace, legacy signature unchanged, nonexistent namespace → empty) and an HTTP-level server test through route().

Why

#1288: the endpoint parsed only room_id, limit, and author; any namespace query param was silently ignored, so a caller asking for its own namespace in a cross-namespace room got a 200 with the full unfiltered list (issue repro: 72 entries returned instead of 19). Filtering at the SQL level (inside the same LIMIT) also avoids the fetch-then-post-filter trap where LIMIT applies before filtering.

Testing

  • cargo fmt --all -- --check ✅
  • cargo clippy --workspace --all-targets -- -D warnings ✅
  • cargo test --workspace — EXIT=0, no failures ✅
  • Feature matrix: check -p uteke-core --no-default-features --features vecq / onnx,vecq, build -p uteke-server --no-default-features --features vecq ✅
  • cargo run -p docgen fresh (no stale-docs failure) ✅
  • Pre-commit hooks: fmt + clippy + cora review (No issues found) ✅

Closes #1288

GET /room/memories parsed only room_id, limit, and author; any
namespace query param was silently ignored, so callers asking for
their own namespace in a cross-namespace room got a 200 with the
full unfiltered list (issue reports a 6-namespace room returning
72 entries instead of 19).

Core: recall_room becomes a compatibility wrapper delegating to a
new recall_room_scoped(room_id, author, namespace, limit). The
duplicate 4-variant SQL collapses into one dynamically composed
WHERE clause — literal fragments stay in SQL text, every value is
bound as a parameter (same owned Box<dyn ToSql> pattern as
bulk.rs), so no string interpolation of inputs.

Server: parse the namespace query param and pass it through;
usage string and /tools endpoint-registry description updated
(docs regenerated).

Tests: core multi-namespace room test (scoped, combined
author+namespace, legacy signature unchanged, nonexistent ns
yields empty) and an HTTP-level server test. Validation: cargo
fmt --check, clippy -D warnings, full workspace tests EXIT=0,
feature-matrix checks, docgen fresh.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 8e138ad into develop Sep 28, 2026
15 checks passed
@ajianaz
ajianaz deleted the fix/1288-room-memories-namespace-filter branch September 28, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api: GET /room/memories silently ignores namespace param (no filter, no 400)

1 participant