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.

  • 0003 now carries the existing uuid forward before setData().
  • New 0006 restores a uuid on sites that already ran the original 0003.

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, then drush cex --diff; the uuid line of ai_agents.ai_agent.canvas_ai_orchestrator is unchanged.
  • On a site where the original 0003 already removed the uuid, run drush updb (runs 0006), then drush cex; a uuid is restored.
  • Run the kernel test: composer run phpunit -- modules/canvas_ai/tests/src/Kernel/CanvasAiAgentUuidPostUpdateTest.php.

Merge request reports

Loading