The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(doctor): honor check selectors for unusable default config
Steven Enamakeleed89f231029
diff --git a/crates/openhuman-core/src/agent/tools/wait_tests.rs b/crates/openhuman-core/src/agent/tools/wait_tests.rsindex 434bb81f08..a3647ea903 100644--- a/crates/openhuman-core/src/agent/tools/wait_tests.rs+++ b/crates/openhuman-core/src/agent/tools/wait_tests.rs@@ -98,6 +98,15 @@ async fn wait_execute_returns_callback_message() {assert!(res.output().contains("time to check"));}+#[test]+fn delayed_wait_tools_are_available_to_read_only_turns() {+ assert_eq!(WaitTool::new().permission_level(), tinytools::PermissionLevel::None);+ assert_eq!(+ WaitLoopTool::new().permission_level(),+ tinytools::PermissionLevel::None+ );+}+/// Wire shape is a contract with prompts and recorded transcripts: names and/// schemas must stay byte-identical across moves.#[test]diff --git a/crates/openhuman-core/src/doctor/ops.rs b/crates/openhuman-core/src/doctor/ops.rsindex eeb33304ea..e7b5007312 100644--- a/crates/openhuman-core/src/doctor/ops.rs+++ b/crates/openhuman-core/src/doctor/ops.rs@@ -2,6 +2,7 @@//!//! Resolve the selected profile and run the native doctor check registry.+use std::collections::HashSet;use std::path::Path;use super::contract::DoctorProfileStatus;@@ -25,7 +26,7 @@ pub async fn doctor_report_with_options(mut options: DoctorOptions,) -> Result<Outcome<DoctorReport>, String> {if options.profile.is_none() {- if let Some(outcome) = unusable_default_config_outcome(config, options.tier) {+ if let Some(outcome) = unusable_default_config_outcome(config, &options)? {return Ok(outcome);}}@@ -185,7 +186,7 @@ pub async fn doctor_report_for_desktop_selection(selection: DesktopProfileSelection,options: DoctorOptions,) -> Result<Outcome<DoctorReport>, String> {- if let Some(outcome) = unusable_default_config_outcome(&selection.config, options.tier) {+ if let Some(outcome) = unusable_default_config_outcome(&selection.config, &options)? {return Ok(outcome);}let components = ComponentSet::from_config(&selection.config.components);@@ -237,15 +238,38 @@ pub(crate) fn config_parse_finding(config: &Config) -> Option<Finding> {fn unusable_default_config_outcome(config: &Config,- tier: DoctorTier,-) -> Option<Outcome<DoctorReport>> {+ options: &DoctorOptions,+) -> Result<Option<Outcome<DoctorReport>>, String> {if config.load_diagnostics().fallback!= crate::config::schema::load::ConfigLoadFallback::Defaults{- return None;+ return Ok(None);+ }+ let ctx = DoctorCtx::from_config(config.clone());+ let check_ids = super::registry::registered_checks_for(&ctx)?+ .iter()+ .map(|check| check.id().to_owned())+ .collect::<HashSet<_>>();+ let only = options.only.iter().cloned().collect::<HashSet<_>>();+ let skip = options.skip.iter().cloned().collect::<HashSet<_>>();+ let parse_selected = (only.is_empty() || only.contains("config/parse"))+ && !skip.contains("config/parse");+ let mut findings = if parse_selected {+ config_parse_finding(config).into_iter().collect::<Vec<_>>()+ } else {+ Vec::new()+ };+ let has_unknown_selector = only+ .iter()+ .chain(skip.iter())+ .any(|id| !check_ids.contains(id));+ if has_unknown_selector {+ findings.push(Finding::error(+ "doctor/selection",+ "One or more selected check ids are not registered.",+ "Use a registered exact check id from the doctor report.",+ ));}- let finding = config_parse_finding(config)?;- let findings = vec![finding];let (layout_version, resolution_source) = config.doctor_profile_metadata();let report = DoctorReport {schema_version: 2,@@ -256,14 +280,18 @@ fn unusable_default_config_outcome(crate::config::schema::profile_layout::LayoutVersion::V2 => 2,}),config_resolution_source: resolution_source,- tier,- checks_run: vec!["config/parse".into()],+ tier: options.tier,+ checks_run: if parse_selected {+ vec!["config/parse".into()]+ } else {+ Vec::new()+ },checks_skipped: Vec::new(),summary: DoctorSummary::from_findings(&findings),findings,ok: false,};- Some(Outcome::single_log(report, "doctor config parse failed"))+ Ok(Some(Outcome::single_log(report, "doctor config parse failed")))}async fn report_with_context(diff --git a/crates/openhuman-core/src/doctor/ops_tests.rs b/crates/openhuman-core/src/doctor/ops_tests.rsindex aafc293743..2a43a92c46 100644--- a/crates/openhuman-core/src/doctor/ops_tests.rs+++ b/crates/openhuman-core/src/doctor/ops_tests.rs@@ -11,6 +11,65 @@ use crate::memory::engine_registry::{ReadOnlyHealthProbe,};+#[tokio::test]+async fn malformed_config_fallback_honors_exact_doctor_selectors() {+ let directory = tempfile::tempdir().expect("temporary config directory");+ let config_path = directory.path().join("config.toml");+ let workspace = directory.path().join("workspace");+ std::fs::create_dir_all(&workspace).expect("create workspace");+ std::fs::write(&config_path, "[broken\n")+ .expect("write malformed config");+ let config = Config::load_from_config_path(&config_path, &workspace)+ .await+ .expect("load default fallback");++ let skipped = doctor_report_with_options(+ &config,+ DoctorOptions {+ skip: vec!["config/parse".into()],+ ..DoctorOptions::default()+ },+ )+ .await+ .expect("skip parse diagnostic")+ .value;+ assert!(skipped.findings.is_empty());+ assert!(skipped.checks_run.is_empty());++ let selected_elsewhere = doctor_report_with_options(+ &config,+ DoctorOptions {+ only: vec!["workspace/layout".into()],+ ..DoctorOptions::default()+ },+ )+ .await+ .expect("select a different check")+ .value;+ assert!(selected_elsewhere.findings.is_empty());+ assert!(selected_elsewhere.checks_run.is_empty());++ let unknown = doctor_report_with_options(+ &config,+ DoctorOptions {+ only: vec!["unknown/check".into()],+ ..DoctorOptions::default()+ },+ )+ .await+ .expect("report unknown selector")+ .value;+ assert_eq!(unknown.findings.len(), 1);+ assert_eq!(unknown.findings[0].check_id, "doctor/selection");++ let unfiltered = doctor_report_with_options(&config, DoctorOptions::default())+ .await+ .expect("report malformed config")+ .value;+ assert_eq!(unfiltered.findings.len(), 1);+ assert_eq!(unfiltered.findings[0].check_id, "config/parse");+}+#[tokio::test]async fn a_legacy_memory_selector_does_not_resolve_the_normal_engine() {let fixture = tempfile::tempdir().expect("doctor config fixture");