From 3896071632303426bd9b1b56a75925c869403206 Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Tue, 24 Nov 2026 13:05:29 -0500 Subject: [PATCH] fix(ai): keep the Compose seed helper off the connection selector The plugin's generateText runs while seeding field prompt instructions, which can happen during boot. Resolving a connection there calls getPayload, which would wait on the boot it is inside. Seeding is a one-off admin concern, so it stays on the env default. --- src/payload.config.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/payload.config.ts b/src/payload.config.ts index a604ca63..3a0f3e94 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -817,14 +817,12 @@ export default buildConfig({ return createTextStreamResponse({ textStream }); }, + // Deliberately does not follow the connection selector: the plugin + // calls this while seeding field prompt instructions, which can happen + // during boot, and resolving a connection boots Payload (deadlock). + // Seeding is a one-off admin concern; prose Compose is unaffected. generateText: async (prompt: string, system: string) => { - const connection = await resolveConnection(null, "compose"); - const { text } = await generatePlainText( - prompt, - system, - connection?.modelId || DEFAULT_MODEL, - { connection }, - ); + const { text } = await generatePlainText(prompt, system, DEFAULT_MODEL); return text; }, output: "text",