diff --git a/jina-ai/src/patch-express.ts b/jina-ai/src/patch-express.ts index 5e516b2..f56ad15 100644 --- a/jina-ai/src/patch-express.ts +++ b/jina-ai/src/patch-express.ts @@ -211,6 +211,10 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction if (err.stack) { logger.error(err.stack); } + } finally { + if (ctx.promptContext) { + ctx.promptContext = null; + } } });