Files
StageAI/src
CTO (LegalAI) 1493b84787 fix: extract tenantId from session auth instead of request body/headers
AI routes now use requirePermission() + ctx.tenantId to get the tenant,
ensuring getModelForTenant() is always called with the correct tenant ID
so that stored API keys are used. Fixes norms/parse (was falling back to
getModel()) and analyses/structured (was trusting x-tenant-id header).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-09 14:55:20 +00:00
..