Skip to content

fix(backend): correct API route order for stale-embeddings-count - #30

Merged
comppaz merged 1 commit into
mainfrom
fix/stale-embeddings-route-order
Dec 15, 2025
Merged

fix(backend): correct API route order for stale-embeddings-count#30
comppaz merged 1 commit into
mainfrom
fix/stale-embeddings-route-order

Conversation

@comppaz

@comppaz comppaz commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed 422 error when calling /api/memories/stale-embeddings-count
  • Moved the static route before the dynamic {memory_id} route so FastAPI matches it correctly

Root Cause

FastAPI matches routes in definition order. The dynamic route /memories/{memory_id} was catching /memories/stale-embeddings-count and trying to parse the string as an integer.

Test plan

  • Verify /api/memories/stale-embeddings-count returns a valid count response
  • Verify /api/memories/{id} still works for fetching individual memories

Move the /memories/stale-embeddings-count route before the dynamic
/memories/{memory_id} route to prevent FastAPI from incorrectly
matching it as an integer memory_id parameter.
@comppaz
comppaz merged commit 97ff418 into main Dec 15, 2025
@comppaz
comppaz deleted the fix/stale-embeddings-route-order branch December 15, 2025 08:07
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.

1 participant