fleet-memory/hindsight-api/hindsight_api
Chris Bartholomew f5f3fca4ad
Fix: Load extensions in server.py for multi-worker deployments (#155)
* Fix: Load extensions in server.py for multi-worker deployments

When running with multiple workers (--workers 2), uvicorn uses
`hindsight_api.server:app` import string instead of passing an app
object. The server.py module was not loading tenant/operation validator
extensions, causing authentication bypass in production.

This fix:
- Adds extension loading to server.py matching main.py behavior
- Sets extension context on tenant extension for schema provisioning
- Adds comprehensive unit tests for server.py extension loading

The tests specifically verify:
- TENANT extension is loaded when HINDSIGHT_API_TENANT_EXTENSION is set
- OPERATION_VALIDATOR is loaded when configured
- Extensions are passed to MemoryEngine constructor
- Extension context is set on tenant extension
- Server works correctly without extensions configured

* Add unit tests for main.py extension loading (single-worker path)
2026-01-13 17:55:33 +01:00
..
admin feat: run db migrations offline (optionally) (#114) 2026-01-07 15:49:51 +01:00
alembic fix: improve mpfp retrieval (#146) 2026-01-12 18:58:05 +01:00
api fix: improve mpfp retrieval (#146) 2026-01-12 18:58:05 +01:00
engine feat: support litellm gateway (#154) 2026-01-13 16:55:28 +01:00
extensions Fix embedding dimension for tenant schemas (#135) 2026-01-08 22:48:25 +01:00
__init__.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
banner.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
config.py feat: support litellm gateway (#154) 2026-01-13 16:55:28 +01:00
daemon.py feat: refactor hindsight-embed architecture (#66) 2025-12-22 22:02:40 +01:00
main.py feat: support custom url for openai embeddings & cohere (#150) 2026-01-13 14:01:44 +01:00
mcp_local.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
metrics.py feat: add tenant to metrics labels (#151) 2026-01-13 15:31:58 +01:00
migrations.py fix: batch queries on recall (#149) 2026-01-13 13:20:22 +01:00
models.py feat: configurable embedding dimensions + OpenAI Embeddings (#101) 2026-01-05 14:43:05 +01:00
pg0.py feat: backup/restore (#110) 2026-01-07 11:29:50 +01:00
server.py Fix: Load extensions in server.py for multi-worker deployments (#155) 2026-01-13 17:55:33 +01:00