Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

test(gemini): pin the null-only type-array collapse arm

AkitaOnRailsc63bfd85aa27
diff --git a/crates/ai-memory-llm/src/gemini.rs b/crates/ai-memory-llm/src/gemini.rs
index faf92011..c3973dad 100644
--- a/crates/ai-memory-llm/src/gemini.rs
+++ b/crates/ai-memory-llm/src/gemini.rs
@@ -576,6 +576,15 @@ mod tests {
);
}
+ #[test]
+ fn prepare_schema_null_only_type_array_drops_type_keeps_nullable() {
+ let schema = json!({ "type": ["null"] });
+ let prepared = prepare_schema_for_gemini(schema).unwrap();
+ assert!(prepared.get("type").is_none());
+ assert!(prepared.get("anyOf").is_none());
+ assert_eq!(prepared.get("nullable").unwrap(), &json!(true));
+ }
+
#[test]
fn build_request_disables_default_thinking_for_25_flash() {
let provider =