honcho/tests/routes
Rajat Ahuja 6aa6033a16
feat: defer embedding messages (#704)
* feat: defer embedding messages

* fix: rm gauges

* feat: embed messages immediately on create with reconciler fallback (#766)

Adds embed_messages_now background task so newly created messages are
searchable within seconds instead of waiting up to the reconciler
interval. Three-phase claim/lease → embed → persist never holds a DB
session across the embedding call; the reconciler remains the fallback
for failures and stragglers.

* fix: harden immediate-embed fast path and cover its error branches

Wrap embed_messages_now in a top-level try/except so a failure in the
claim or persist phase degrades to "reconciler will retry" instead of
escaping into the background-task runner; the rows stay pending+leased
and the reconciler heals them.

Add tests for the previously-uncovered branches: external-store-unavailable
persist path, the file-upload endpoint's embed scheduling, and direct unit
tests for the shared compute_chunk_positions / build_message_vector_record
helpers.

Document the semantic-search eventual-consistency window in search.mdx
(keyword matches are immediate; vector matches lag creation by seconds).

* fix: don't hold DB session across vector-store upserts

* fix: align semantic-search function to filter null rows

---------

Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
2026-06-11 10:31:04 -04:00
..
__init__.py [0.0.10] Release 2024-07-25 13:45:27 -04:00
test_conclusions.py feat: make session_name nullable for documents and update related SDKs (#347) 2026-01-26 13:33:11 -05:00
test_files.py fix(files): handle empty json uploads safely (#434) 2026-03-18 18:36:34 -04:00
test_keys.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00
test_messages.py feat: defer embedding messages (#704) 2026-06-11 10:31:04 -04:00
test_peers.py feat(api): restore reverse pagination (#685) 2026-05-21 13:40:47 -04:00
test_queue_status.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_scoped_api.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_sessions.py feat(api): restore reverse pagination (#685) 2026-05-21 13:40:47 -04:00
test_validation_api.py Align API contract with DB contract for IDs (#684) 2026-05-14 16:37:39 -04:00
test_webhooks.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00
test_workspaces.py feat(api): restore reverse pagination (#685) 2026-05-21 13:40:47 -04:00