From cd6dfee3f3b11e20430049e5aa899dba2630a2ed Mon Sep 17 00:00:00 2001 From: wsp Date: Sat, 10 Oct 2026 14:34:31 +0800 Subject: [PATCH] fix(tools): Remove boolean enum from value_null Remove the boolean enum that causes Gemini to reject tool schemas. Keep true-only runtime validation and add schema and null-value regression coverage. Fixes #3332 --- .../implementations/openbitfun_control_tool.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/crates/assembly/core/src/agentic/tools/implementations/openbitfun_control_tool.rs b/src/crates/assembly/core/src/agentic/tools/implementations/openbitfun_control_tool.rs index 82506541eb..1d4538cd4b 100644 --- a/src/crates/assembly/core/src/agentic/tools/implementations/openbitfun_control_tool.rs +++ b/src/crates/assembly/core/src/agentic/tools/implementations/openbitfun_control_tool.rs @@ -380,7 +380,6 @@ impl Tool for OpenBitFunControlTool { }, "value_null": { "type": "boolean", - "enum": [true], "description": "Set a nullable option to null; pass true." }, "cursor": { @@ -848,9 +847,25 @@ mod tests { let schema = OpenBitFunControlTool::new().input_schema(); assert_eq!(schema["properties"]["value_boolean"]["type"], "boolean"); assert_eq!(schema["properties"]["value_integer"]["type"], "integer"); + assert_eq!(schema["properties"]["value_null"]["type"], "boolean"); + assert!(schema["properties"]["value_null"].get("enum").is_none()); assert!(schema["properties"].get("value").is_none()); } + #[test] + fn null_value_requires_true() { + assert_eq!( + OpenBitFunControlTool::configure_value(&json!({ "value_null": true })), + Ok(Some(Value::Null)) + ); + for value in [json!(false), json!(null), json!("true"), json!(1)] { + assert_eq!( + OpenBitFunControlTool::configure_value(&json!({ "value_null": value })), + Err("value_null must be true when used".to_string()) + ); + } + } + #[tokio::test] async fn validates_the_discover_then_execute_contract() { let tool = OpenBitFunControlTool::new();