Issues/3591884: Run component agnet with setlooped false.
Replaces the mocked canvas_dev_ai controller with the browser-driven hop loop: CanvasDevAiBuilder runs canvas_component_agent with setLooped(FALSE), serializes the paused agent to the tempstore under the turn's request_id, and returns should_continue plus the narration accumulated so far. AiWizardDev.tsx re-POSTs until the agent reports it is finished, applying each hop's layout changes before building the next request.
One request is one model decision, so a tool decided in hop N executes at the start of hop N+1 — after the browser has applied hop N's output.
Kernel coverage drives four whole turns through the controller against the ai module's echoai provider, one request per hop, using recorded fixtures. Playwright coverage of the browser loop is a followup.
Details, the response shape on the wire, and the review notes are on the issue: #3591884 (closed)
AI-Generated: Yes (Used Claude Code to write the controller, the wizard loop and the tests, reviewed and manually verified by a human).
Testing instructions
Requires a chat provider configured for the chat operation type.
- Install
canvas_dev_ai(drush en canvas_dev_ai) and clear caches. - Open a Canvas page, open the AI chat, and ask it to create a CTA card code component.
- With the browser Network tab open, confirm the component is built across several POSTs to
/admin/api/canvas/ai-dev, not one. Each response carriesshould_continue, and only the last one carriesmessage. - Confirm the narration renders in the chat while those requests run, its status row spinning until the last hop and then switching to the completed icon, and that the component is created and opened in the editor.
- Uninstall
canvas_dev_ai(drush pmu canvas_dev_ai), clear caches, reload the editor, and ask for the same component again. - Confirm the existing flow is unchanged: one POST to
/admin/api/canvas/ai, with the progress messages arriving from separate polling of/admin/api/canvas/ai-progress.
Known CI failure
CanvasComponentAgentEndToEndTest fails in CI on two ai_agents errors, both fixed after the 1.3.2 tag:
All four tests pass locally against ai_agents 1.3.x-dev. Canvas requires drupal/ai_agents: ^1.2, so a 1.3.3 release is installed by CI with no change to this MR, and the job goes green on the next pipeline run.
Closes #3591884 (closed)