Active
Project:
Drupal Canvas
Version:
1.x-dev
Component:
AI
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Oct 2025 at 19:57 UTC
Updated:
8 Feb 2026 at 17:07 UTC
Jump to comment: Most recent
Comments
Comment #2
narendrarThis polling behaviour is intentional. Polling begins as soon as a chat request is sent to
/admin/api/canvas/ai, in order to track the request status and retrieve information as soon as it's available. Currently, maxPolls is set to 500 (about 16 minutes), and we can make this configurable in the future.Comment #3
kunal.sachdev commentedThe main request (/admin/api/canvas/ai) is the long-running request which sends the prompt and waits for the final AI response where as the Polling request (/admin/api/canvas/ai-progress) is the short, repeating request providing the live UI updates while the main request is busy. So, I think the suggestion to "Wait to poll until the response is returned" won't work because if we waited for the main request to fully return before polling, the polling would never happen while the user is waiting, and we'd lose the live status updates entirely.
However I noticed one thing that the code currently accounts for this race condition by delaying the very first poll by 1 second in the startPolling function (around line 427 in AiWizard.tsx):
This 1-second delay is intended to give the main fetch request a head-start to reach the server and register the job. But It's possible 1 second isn't always enough, so we can certainly adjust this if it becomes a persistent problem.
Comment #4
rakhimandhania commentedComment #5
rakhimandhania commented