fix: #3586045 persist force_value tool restrictions saved from the agent form
Summary
AiAgentForm::save() referenced an undefined $restrictions variable while building tool_usage_limits, so a force_value restriction was stored without its action, values, hide_property and not_break. The forced value was then ignored at runtime regardless of whether hide_property was enabled.
Fix
Build each restriction from the submitted $values and store the processed array.
Test
Adds ForceValueFormPersistenceTest (functional): as the root user it enables the ai_agent:list_config_entities tool, submits a force_value restriction on entity_type through the real agent form — for both the visible and hidden cases — and asserts the persisted tool_usage_limits. The test errors on the undefined $restrictions variable before this fix and passes after it.
The existing ForceValueHidePropertyExecutionKernelTest verifies enforcement given correct config; this closes the loop by verifying the form produces that config.
Closes #3586045 (closed)
Generated with AI assistance.