hide_property skips data-type conversion for forced values, breaking non-scalar context types (entity, list, JSON, YAML)
Discovered while testing https://git.drupalcode.org/project/ai_agents/-/work_items/3555863
When a tool property has both force_value and hide_property enabled, the forced value reaches the tool as a raw scalar instead of being converted to its proper data type. This breaks any property whose context expects a non-scalar value (entity:\*, list, JSON, YAML, …).
- Edit `AiAgentEntityWrapper::applyToolUsageLimitsToContext `and add the line $property_name = str_replace('\_\_**colon_\_**', ':', $property_name); above this condition (See the fix in MR !269 )
```
if (!array_key_exists($property_name, $context_definitions)) {
continue;
}
```
- Create or pick an AI agent that has the Save content item tool enabled (action_plugin:entity:save_action:node).
- On that tool's entity__colon__node property, set force_value with Values = node:2 (any existing node id).
- Leave hide_property unchecked. Run the agent — it correctly saves node 2.
- Re-open the tool restriction, check hide_property, save the agent. Run the agent again.
- Observe the crash: Error: Call to a member function isNew() on string in EntityChangedConstraintValidator-\>validate()
issue