Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(config): preserve legacy default for omitted presentation field

Steven Enamakelf7637db631ab
diff --git a/crates/openhuman-core/src/config/schema/tools/search_migrate.rs b/crates/openhuman-core/src/config/schema/tools/search_migrate.rs
index 8c4a25f64a..35eac4fd7f 100644
--- a/crates/openhuman-core/src/config/schema/tools/search_migrate.rs
+++ b/crates/openhuman-core/src/config/schema/tools/search_migrate.rs
@@ -183,6 +183,12 @@ impl SearchConfig {
{
self.presentation_provider = None;
}
+ // `roles` did not exist in the legacy presentation vocabulary; its
+ // serde default means the old file omitted the field. Preserve the
+ // legacy default while fresh configs use Roles.
+ if self.presentation == super::SearchPresentation::Roles {
+ self.presentation = super::SearchPresentation::AllTools;
+ }
self.engine = None;
self.parallel_route = None;
self.gemini_route = None;
diff --git a/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs b/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
index 5025967760..e4277c779d 100644
--- a/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
+++ b/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
@@ -27,6 +27,13 @@ fn fresh_defaults_are_managed_exa_and_gemini_with_roles_presentation() {
assert!(cfg.roles.is_empty());
}
+#[test]
+fn legacy_omitted_presentation_keeps_all_tools_default() {
+ let mut cfg = legacy("engine = \"managed\"\n");
+ cfg.migrate_legacy(LegacySearchInputs::default());
+ assert_eq!(cfg.presentation, SearchPresentation::AllTools);
+}
+
#[test]
fn http_request_defaults_to_allow_all() {
// Web research works out of the box: the default allowlist is the