Skip to content

Fix bank config API for multi-tenant schema isolation#417

Merged
nicoloboschi merged 2 commits intomainfrom
fix/bank-config-multi-tenant
Feb 20, 2026
Merged

Fix bank config API for multi-tenant schema isolation#417
nicoloboschi merged 2 commits intomainfrom
fix/bank-config-multi-tenant

Conversation

@cdbartholomew
Copy link
Contributor

Summary

  • Add _authenticate_tenant() calls to all 3 bank config API handlers (GET/PATCH/DELETE) so the _current_schema contextvar is set before database queries run
  • Use fq_table("banks") in config_resolver.py to generate schema-qualified table names (e.g., tenant_xxx.banks) instead of bare banks

Without these fixes, bank config operations in multi-tenant deployments query the wrong schema (public instead of tenant-specific), causing "column not found" errors.

Test plan

  • Verify bank config GET/PATCH/DELETE works in multi-tenant mode (hindsight-cloud with tenant schemas)
  • Verify bank config still works in single-tenant mode (no schema isolation)
  • Run existing tests: cd hindsight-api && uv run pytest tests/ -v

- Use fq_table() in config_resolver.py to schema-qualify bank table queries
- Add authenticate_and_resolve_schema() to bank config API handlers in http.py

Without these fixes, bank config operations in multi-tenant mode hit
public.banks instead of tenant_xxx.banks, causing "column config does
not exist" errors.
…hema

The MemoryEngine method is _authenticate_tenant(), not
authenticate_and_resolve_schema(). This was causing AttributeError
on all bank config API requests.
@nicoloboschi nicoloboschi merged commit b180b3a into main Feb 20, 2026
30 of 31 checks passed
r0gig0r pushed a commit to r0gig0r/hindsight that referenced this pull request Feb 23, 2026
…ptimization

Upstream changes (5 commits):
- vectorize-io#417: Fix bank config API for multi-tenant schema isolation
- vectorize-io#420: Add ZeroEntropy reranker provider support
- vectorize-io#421: Fix reflect based_on population and enforce full hierarchical retrieval
- vectorize-io#423: Improve memory footprint of recall (drop embedding from retrieval pipeline)
- vectorize-io#424: Include doc metadata in fact extraction prompts

Conflict resolution:
- fact_extraction.py: kept both our bank_mission and upstream's metadata params
- search/types.py: re-added optional embedding field for recall_exp diversity clustering
  (upstream removed it from standard recall path for memory savings)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants