fix: #3586044 Apply forced tool argument values at execution time
Summary
force_value tool usage limits, especially combined with hide_property, were only applied to the tool schema built in getFunctions(), never to the tool instance that actually executes. A hidden forced argument therefore reached the tool as null and failed validation (This value should not be null). The limits are now applied in executeTool(), so the forced value is present both on a normal agent run and on a resumed serialized run.
Also persists the "One value, no line breaks" (not_break) setting, which the agent form previously dropped on save.
Steps to reproduce
- Create an AI agent that uses the ai_search:rag_search tool
- In the agent's tool usage limits, set the index parameter to force_value with a specific index name and enable hide_property
- Trigger the agent and check the AI log
Expected behavior: The forced index value is silently injected server-side when the tool executes.
Actual behavior: The parameter is hidden from the LLM (correctly omitted from chat_tools) but the forced value is never applied at execution time, so the tool receives a null index and fails validation. The AI log shows tool_settings: { }.
Workaround: Uncheck hide_property for the forced parameter, allowing the LLM to see and populate it.
Tests
ForceValueHidePropertyExecutionKernelTest covers: the hidden forced argument is removed from the model schema, a visible forced argument is retained, and the forced value is applied at execution on both a normal agent run and a resumed serialized run.
Closes #3586044 (closed)
AI-Generated: Yes (Used Claude Code to diagnose the execution paths, implement the fix, and write the kernel tests.)