mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
feat: caller context cache invalidation endpoint
- CallerContextService: added invalidateCache(leadId) method - CallerResolutionController: POST /api/caller/invalidate-context endpoint — frontend calls after appointment mutations to bust stale AI context cache Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,13 @@ export class CallerContextService {
|
||||
return ctx;
|
||||
}
|
||||
|
||||
async invalidateCache(leadId: string): Promise<void> {
|
||||
if (!leadId) return;
|
||||
const cacheKey = `${CACHE_KEY_PREFIX}${leadId}`;
|
||||
await this.session.deleteCache(cacheKey).catch(() => {});
|
||||
this.logger.log(`[CALLER-CTX] Cache invalidated for ${leadId}`);
|
||||
}
|
||||
|
||||
// Fire-and-forget pre-warm — called from caller resolution
|
||||
// so the cache is hot when the AI stream fires seconds later.
|
||||
prewarm(leadId: string, patientId: string, auth: string): void {
|
||||
|
||||
Reference in New Issue
Block a user