Closed (duplicate)
Project:
Drupal Canvas
Version:
1.x-dev
Component:
AI
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2025 at 10:59 UTC
Updated:
22 Apr 2026 at 06:58 UTC
Jump to comment: Most recent
Comments
Comment #2
akhil babuThis response is triggered from the following section of the component agent's prompt.
Within the prompt we are asking the agent to check if the variable `[canvas_ai:selected_component]` is null. But as [canvas_ai:selected_component] is a token, its value gets replaced before the prompt is sent to the agent. If the component name is 'hero_banner', then the instruction becomes
- **TERMINAL EDIT CHECK:** If the user's request is an instruction to **modify, edit, change, or update** a component and the context variable <em>hero_banner</em> is null, this is a **TERMINAL FAILURE**.Which does't make sense.
We should leverage the [canvas_ai:get_verbose_context_for_orchestrator] token here. If user is editing a componnet, then the tokens value becomes
User is now in the code component editor, viewing a code component with id hero_banner
So within the instructions of we can add an instruction like
'Validate the component data before attempting an edit. Only proceed if the user is currently in the code component editor, and ensure you use the exact id from the component data.'
then at the end of the prompt we can add
##Component data
[canvas_ai:get_verbose_context_for_orchestrator]
Comment #3
akhil babuComment #4
rakhimandhania commentedComment #5
rakhimandhania commentedComment #6
rakhimandhania commentedComment #7
akhil babuThis should get fixed once #3584136: Canvas AI - Not able to create the components lands. So closing as duplicate