Issue #3591660: Preserve agent UUID in canvas_ai post_update 0003 and repair affected sites
Fixes the orchestrator agent UUID being stripped by canvas_ai_post_update_0003_reimport_orchestrator_agent().
The hook reimported ai_agents.ai_agent.canvas_ai_orchestrator from config/install with ->setData($data)->save(TRUE). The install file has no uuid key, so setData() replaced the whole record and dropped the uuid from active config. This shipped in 1.5.0 and 1.5.1.
0003now carries the existing uuid forward beforesetData().- New
0006restores a uuid on sites that already ran the original0003.
Closes #3591660
AI-Generated: Yes (Used Claude Code to diagnose the bug and draft the fix and kernel test).
Testing instructions
- On an existing site with the orchestrator agent installed, run
drush updb, thendrush cex --diff; theuuidline ofai_agents.ai_agent.canvas_ai_orchestratoris unchanged. - On a site where the original
0003already removed the uuid, rundrush updb(runs0006), thendrush cex; a uuid is restored. - Run the kernel test:
composer run phpunit -- modules/canvas_ai/tests/src/Kernel/CanvasAiAgentUuidPostUpdateTest.php.