Overview

It looks like the AI is still able to generate invalid prop configuration. I simply asked AI to display navigation links in my header component and it added bunch of invalid props to the component. This is critical because those invalid props are not displayed in the UI so I don't have a way to fix this via the UI.

Proposed resolution

User interface changes

CommentFileSizeAuthor
Screenshot 2025-10-12 at 10.26.04.png200.16 KBlauriii

Comments

lauriii created an issue. See original summary.

dinu r.’s picture

Assigned: Unassigned » dinu r.
wim leers’s picture

Yay!

Canvas' config validation reuses SDC's \Drupal\Core\Theme\Component\ComponentValidator::validateDefinition() , and that's where this validation error is coming from 🥳

wim leers’s picture

Title: AI can generate invalid prop configuration » AI can generate invalid prop configuration: props' names may reuse slots' names
wim leers’s picture

Actually, is this still relevant? This was apparently reported months ago.

lauriii’s picture

I don't think this has been addressed. Ideally we could run the validation as part of generating the code and iterate until it passes.

wim leers’s picture

💯 (That is how I expected this to work in the first place 😅)

wim leers’s picture

Title: AI can generate invalid prop configuration: props' names may reuse slots' names » AI can generate invalid code components: props' names may reuse slots' names
dinu r.’s picture

lauriii, is there a way to reproduce this?

lauriii’s picture

There's no way to reproduce this consistently because this is essentially an issue where AI doesn't follow the instructions provided for it. The likelihood of running into this also depends on the model. For example, after some testing, we are seeing that this is happening more often on Claude Sonnet 4.5 than on Claude Opus 4.5.

I don't think it's super relevant for us to be able to reproduce this with an LLM. We know that it's happening occasionally but not very often. The goal of this issue would be to introduce a deterministic validation for the cases where the LLM goes off track with the changes. This would allow us to reliably create several components without having to worry about invalid components it may have generated. Instead of trying to reproduce this with a LLM, we should be able to establish that kind of test case with a mock LLM response.

nagwani’s picture

Issue tags: +triaged
rakhimandhania’s picture

rakhimandhania’s picture

Issue tags: +AI Page Generation
akhil babu’s picture

Status: Active » Closed (duplicate)
Related issues: +#3584136: Canvas AI - Not able to create the components

This should get fixed once #3584136: Canvas AI - Not able to create the components lands. So closing as duplicate

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.