Per-integration public AI prompt + session attribution

FeatureAIService
Shipped
July 16, 2026 at 2:42 AM UTC
Author
Kamo
Commit
e3bf921

Upgrade the public-chat system-prompt waterfall from per-org to per-integration: PublicAiChatController now reads the X-Public-Chat-Key-Hash header (nullable) forwarded by APIService and passes it to **************** which resolves the WebChatIntegration by hash and prefers its aiSystemPrompt over the AiOrgSettings default, falling back to the generic prompt. The resolved AiChatSession is also stamped with webChatIntegrationId for stable attribution that survives key rotation. Extracted the waterfall into a static, unit-tested resolvePrompt helper (integration-wins / org-fallback / generic-fallback / blank handling).

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing