Skip to content

Commit 97bb81e

Browse files
committed
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
1 parent 1ae1abf commit 97bb81e

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

‎src/crates/assembly/core/src/agentic/tools/implementations/openbitfun_control_tool.rs‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ impl Tool for OpenBitFunControlTool {
380380
},
381381
"value_null": {
382382
"type": "boolean",
383-
"enum": [true],
384383
"description": "Set a nullable option to null; pass true."
385384
},
386385
"cursor": {
@@ -848,9 +847,25 @@ mod tests {
848847
let schema = OpenBitFunControlTool::new().input_schema();
849848
assert_eq!(schema["properties"]["value_boolean"]["type"], "boolean");
850849
assert_eq!(schema["properties"]["value_integer"]["type"], "integer");
850+
assert_eq!(schema["properties"]["value_null"]["type"], "boolean");
851+
assert!(schema["properties"]["value_null"].get("enum").is_none());
851852
assert!(schema["properties"].get("value").is_none());
852853
}
853854

855+
#[test]
856+
fn null_value_requires_true() {
857+
assert_eq!(
858+
OpenBitFunControlTool::configure_value(&json!({ "value_null": true })),
859+
Ok(Some(Value::Null))
860+
);
861+
for value in [json!(false), json!(null), json!("true"), json!(1)] {
862+
assert_eq!(
863+
OpenBitFunControlTool::configure_value(&json!({ "value_null": value })),
864+
Err("value_null must be true when used".to_string())
865+
);
866+
}
867+
}
868+
854869
#[tokio::test]
855870
async fn validates_the_discover_then_execute_contract() {
856871
let tool = OpenBitFunControlTool::new();

0 commit comments

Comments
 (0)