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(mcp): announce a supervisor outage only in the workspace it belongs to\n\nBoth Codex findings on d0dd1d142.\n\n**P1 — the live path was still unrouted.** Routing the store by the event's\nworkspace fixed persistence but not the broadcast: `core::socketio`'s bridge\nemits `core_notification` to every connected client with no per-client routing\n(its own comment says so), and the banner prints the server's qualified name\nand its error. An outage from a workspace the user had switched away from\nwould therefore name that account's server inside the one they are in.\n\n`should_announce` gates the broadcast on the live workspace. The signal it\nreads is `config::active_workspace_dir`, added here: it goes through the same\nresolver `Config::load_or_init` uses — `OPENHUMAN_WORKSPACE`, then\n`active_user.toml`, then the workspace marker, then pre-login — so a caller\ncannot disagree with the loader about which workspace is active. It is\ndeliberately uncached, because a switch is a change to an on-disk marker and\nanything pinned at construction goes stale exactly when it matters.\n\nThis also corrects something I asserted on two review threads: I said there was\nno live active-workspace signal. There is — it is a marker read, not a cached\nvalue, which is why it is paid per *decision* rather than per event. Events that\nname no workspace return on the first line and never reach it, so the cost is\nthe handful of events a supervisor tick produces.\n\nIt fails OPEN: an unresolvable workspace still announces. A banner from the\nwrong workspace is a visible annoyance; a swallowed "your MCP tools are down"\nis the failure #5931 exists to end.\n\n**P2 — a slow cycle left no gap.** `MissedTickBehavior::Delay` stops the burst\nof catch-up ticks but schedules the next deadline one interval after the overdue\ntick *returns* — i.e. from when the cycle starts, not when it ends. A cycle\nconsistently slower than its interval would find the next tick already due and\nprobe continuously, which is the opposite of what the comment claimed. An\n`interval.reset()` after the workspace loop paces from the end of the cycle,\nwhich is what `tinymcp::Supervisor::run` does and what this loop stands in for.\n\n
Shanua3088a1a8bff
diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.mdindex 2f7856cd21..63878f6b82 100644--- a/docs/TEST-COVERAGE-MATRIX.md+++ b/docs/TEST-COVERAGE-MATRIX.md@@ -485,7 +485,7 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an| 11.1.13 | MCP HTTP-remote auth (token / Bearer / OAuth) + redirect resolution | RU/VU | `src/openhuman/mcp/registry/connections.rs` (`build_http_auth*`, `resolve_final_url`), `src/openhuman/mcp/registry/oauth.rs` (PKCE/token/bundle/callback port), `app/src/components/channels/mcp/ConnectAuthModal.test.tsx` (#3495) | ✅ | Bearer/raw scheme + custom headers; redirect-final-URL resolved before auth; OAuth dynamic client registration + PKCE + refresh; tokens MERGED into stored env; credentials stored encrypted locally, never sent to backend || 11.1.14 | MCP "Help & configure" assistant | VU/RU | `app/src/components/channels/mcp/ConfigAssistantPanel.test.tsx`, `app/src/components/channels/mcp/ConfigHelpModal.test.tsx`, `src/openhuman/mcp/registry/ops.rs` (`invoke_config_assist_agent`) (#3495) | ✅ | Server-specific prompt offered as a one-click "Get step-by-step setup help" action (on-demand, no longer auto-run on open — #4272), running an agentic turn scoped to web_search_tool/web_fetch/curl only; markdown-rendered reply; per-MCP chat persisted while on the detail page || 11.1.15 | Agent uses connected MCP servers in chat | RU | `src/openhuman/agent/registry/agents/loader.rs` (`orchestrator_subagents_include_mcp_agent`, `mcp_agent_drives_connected_servers_without_install_or_shell`, `planner_has_readonly_mcp_discovery_not_execute`), `src/openhuman/agent/registry/agents/orchestrator/prompt.rs` (`connected_mcp_block_*`), `src/openhuman/agent/harness/session/turn_tests.rs` (`mcp_announcement_fires_once_for_new_server`), `src/openhuman/mcp/registry/{tools,connections}.rs` (#3495) | ✅ | `use_mcp_server` delegate → `mcp_agent` worker (discover→list→call); `mcp_registry_list_tools` read-only discovery; orchestrator `## Connected MCP Servers` prompt block + mid-session connect announcement on the user turn; planner read-only MCP discovery (no `tool_call`) |-| 11.1.16 | MCP supervisor observability (Event Log + notifications) | RU | `src/openhuman/mcp/registry/supervisor_events_tests.rs`, `src/core/events_tests.rs` (`mcp_supervisor_events_*`, `mcp_lifecycle_events_*`), `src/openhuman/desktop/notifications/bus_tests_2_tests.rs` (`mcp_*`, `*_workspace*`, `an_outage_is_filed_under_its_own_workspace_not_the_bridge_s`), `app/src/components/settings/panels/__tests__/EventLogPanel.test.tsx` (detail line + filter), `vendor/tinymcp/crates/tinymcp/src/registry/supervisor/test.rs` ("The report" section) (#5931) | ✅ | `tinymcp::Supervisor::tick` returns a `TickReport`; the host maps it to `McpServer{ProbeTimedOut,TransportDropped,Reconnected,ReconnectFailed,Parked}` domain events (Event Log, `mcp_client` domain, server name in the agent column, failure reason via `DomainEvent::log_detail`) and the notification bridge notifies only on the first failed reconnect of an episode, on recovery after failures, and on a parked server — filing each under the workspace the event names, since one process supervises every workspace it has opened and the bridge's own binding may be the stale half after a switch |+| 11.1.16 | MCP supervisor observability (Event Log + notifications) | RU | `src/openhuman/mcp/registry/supervisor_events_tests.rs`, `src/core/events_tests.rs` (`mcp_supervisor_events_*`, `mcp_lifecycle_events_*`), `src/openhuman/desktop/notifications/bus_tests_2_tests.rs` (`mcp_*`, `*_workspace*`, `an_outage_is_filed_under_its_own_workspace_not_the_bridge_s`, `*_announced`), `app/src/components/settings/panels/__tests__/EventLogPanel.test.tsx` (detail line + filter), `vendor/tinymcp/crates/tinymcp/src/registry/supervisor/test.rs` ("The report" section) (#5931) | ✅ | `tinymcp::Supervisor::tick` returns a `TickReport`; the host maps it to `McpServer{ProbeTimedOut,TransportDropped,Reconnected,ReconnectFailed,Parked}` domain events (Event Log, `mcp_client` domain, server name in the agent column, failure reason via `DomainEvent::log_detail`) and the notification bridge notifies only on the first failed reconnect of an episode, on recovery after failures, and on a parked server — filing each under the workspace the event names and announcing it only when that workspace is live, since one process supervises every workspace it has opened and the bridge's own binding may be the stale half after a switch |<!-- 11.1.9 Vault Markdown Writes — removed: Knowledge Vaults dropped (vault domain + VaultPanel deleted). -->diff --git a/src/openhuman/config/mod.rs b/src/openhuman/config/mod.rsindex 485e6b088a..d58dcb96d4 100644--- a/src/openhuman/config/mod.rs+++ b/src/openhuman/config/mod.rs@@ -25,9 +25,10 @@ pub use ops as rpc;pub use ops::*;pub use schema::{- action_dir_env_override, active_user_marker_path, clear_active_user, default_action_dir,- default_projects_dir, default_root_openhuman_dir, pre_login_user_dir, read_active_user_id,- resolve_action_dir, user_openhuman_dir, write_active_user_id, PRE_LOGIN_USER_ID,+ action_dir_env_override, active_user_marker_path, active_workspace_dir, clear_active_user,+ default_action_dir, default_projects_dir, default_root_openhuman_dir, pre_login_user_dir,+ read_active_user_id, resolve_action_dir, user_openhuman_dir, write_active_user_id,+ PRE_LOGIN_USER_ID,};// Crate-internal: workspace→config-dir resolver reused by the cloud embedder.pub(crate) use schema::resolve_config_dir_for_workspace;diff --git a/src/openhuman/config/schema/load/dirs.rs b/src/openhuman/config/schema/load/dirs.rsindex 605fd229e7..ff06a434bf 100644--- a/src/openhuman/config/schema/load/dirs.rs+++ b/src/openhuman/config/schema/load/dirs.rs@@ -298,6 +298,31 @@ pub(crate) async fn resolve_runtime_config_dirs(.await}+/// The workspace this process is serving *right now*.+///+/// Resolved through the same path [`Config::load_or_init`] takes — the+/// `OPENHUMAN_WORKSPACE` override, then `active_user.toml`, then the+/// workspace marker, then the pre-login directory — so a caller cannot+/// disagree with the loader about which workspace is active.+///+/// This is deliberately not cached. One process serves more than one+/// workspace over its life and the switch is a change to an on-disk marker,+/// so anything a subscriber pinned at boot goes stale exactly when it+/// matters. The cost is one small marker read, which is why callers should+/// reach for this per *decision*, not per event: `desktop::notifications`+/// asks only for the handful of workspace-bound events a supervisor tick+/// produces, and returns before calling it for everything else.+pub async fn active_workspace_dir() -> Result<PathBuf> {+ let (default_openhuman_dir, default_workspace_dir) = default_config_and_workspace_dirs()?;+ let (_, workspace_dir, source) =+ resolve_runtime_config_dirs(&default_openhuman_dir, &default_workspace_dir).await?;+ tracing::trace!(+ source = source.as_str(),+ "active workspace resolved for a workspace-bound decision"+ );+ Ok(workspace_dir)+}+/// Env-injectable variant of [`resolve_runtime_config_dirs`]. Accepts any/// [`EnvLookup`] so unit tests can exercise the `OPENHUMAN_WORKSPACE`/// override path without mutating the process environment.diff --git a/src/openhuman/config/schema/load/mod.rs b/src/openhuman/config/schema/load/mod.rsindex 1a932ceb08..391bc8fd3a 100644--- a/src/openhuman/config/schema/load/mod.rs+++ b/src/openhuman/config/schema/load/mod.rs@@ -8,9 +8,10 @@ mod migrate;mod secrets;pub use dirs::{- action_dir_env_override, active_user_marker_path, clear_active_user, default_action_dir,- default_projects_dir, default_root_openhuman_dir, pre_login_user_dir, read_active_user_id,- resolve_action_dir, user_openhuman_dir, write_active_user_id, PRE_LOGIN_USER_ID,+ action_dir_env_override, active_user_marker_path, active_workspace_dir, clear_active_user,+ default_action_dir, default_projects_dir, default_root_openhuman_dir, pre_login_user_dir,+ read_active_user_id, resolve_action_dir, user_openhuman_dir, write_active_user_id,+ PRE_LOGIN_USER_ID,};// redact_url_for_log is pub(super) for the schema module; tests inside loaddiff --git a/src/openhuman/config/schema/mod.rs b/src/openhuman/config/schema/mod.rsindex b15220ac7f..1a7bb1f35a 100644--- a/src/openhuman/config/schema/mod.rs+++ b/src/openhuman/config/schema/mod.rs@@ -33,9 +33,10 @@ mod identity_cost;mod learning;mod load;pub use load::{- action_dir_env_override, active_user_marker_path, clear_active_user, default_action_dir,- default_projects_dir, default_root_openhuman_dir, pre_login_user_dir, read_active_user_id,- resolve_action_dir, user_openhuman_dir, write_active_user_id, PRE_LOGIN_USER_ID,+ action_dir_env_override, active_user_marker_path, active_workspace_dir, clear_active_user,+ default_action_dir, default_projects_dir, default_root_openhuman_dir, pre_login_user_dir,+ read_active_user_id, resolve_action_dir, user_openhuman_dir, write_active_user_id,+ PRE_LOGIN_USER_ID,};// Crate-internal: the workspace→config-dir resolver, reused by the cloud// embedder's keyless credential-scope resolution (mirrors `config::load`).diff --git a/src/openhuman/desktop/notifications/bus.rs b/src/openhuman/desktop/notifications/bus.rsindex c87791ec99..736e065d95 100644--- a/src/openhuman/desktop/notifications/bus.rs+++ b/src/openhuman/desktop/notifications/bus.rs@@ -107,6 +107,52 @@ impl NotificationBridgeSubscriber {_ => Cow::Borrowed(config),}}++ /// Whether a notification should reach connected clients.+ ///+ /// Storing an event under its own workspace is only half the answer. The+ /// live path has no per-client routing at all — `core::socketio`'s bridge+ /// emits `core_notification` to *every* connected client, and the banner+ /// prints the server's qualified name and its error — so a supervisor+ /// event from a workspace the user has switched away from would show one+ /// account's server, and its failure text, inside the account they are+ /// actually in (#5931).+ ///+ /// Only workspace-bound events are gated, and the active workspace is+ /// resolved through `config::active_workspace_dir`, the same resolver the+ /// config loader uses — deliberately not a value pinned at construction,+ /// which is exactly what goes stale across a switch. It costs one small+ /// marker read, paid only for the handful of events a supervisor tick+ /// produces: everything else returns on the first line.+ ///+ /// **Fails open.** If the workspace cannot be resolved the notification is+ /// announced anyway. A banner from the wrong workspace is a visible+ /// annoyance the user can dismiss; a silently swallowed "your MCP tools+ /// are down" is the exact failure #5931 exists to end.+ async fn should_announce(&self, event: &DomainEvent) -> bool {+ let Some(event_workspace) = workspace_of(event) else {+ return true;+ };+ match crate::openhuman::config::active_workspace_dir().await {+ Ok(active) if active == event_workspace => true,+ Ok(active) => {+ log::debug!(+ "{LOG_PREFIX} not announcing {} from an inactive workspace event_ws={} active_ws={}",+ event.variant_name(),+ event_workspace.display(),+ active.display()+ );+ false+ }+ Err(error) => {+ log::warn!(+ "{LOG_PREFIX} could not resolve the active workspace ({error}); announcing {} anyway",+ event.variant_name()+ );+ true+ }+ }+ }}/// The workspace an event belongs to, for the variants that name one.@@ -366,7 +412,11 @@ impl EventHandler<DomainEvent> for NotificationBridgeSubscriber {),}}- publish_core_notification(notification);+ // Persisted above under the workspace it belongs to; announced+ // only if that workspace is the one the user is in (#5931).+ if self.should_announce(event).await {+ publish_core_notification(notification);+ }}}}diff --git a/src/openhuman/desktop/notifications/bus_tests_2_tests.rs b/src/openhuman/desktop/notifications/bus_tests_2_tests.rsindex 4d5009fd59..3d9c1f281b 100644--- a/src/openhuman/desktop/notifications/bus_tests_2_tests.rs+++ b/src/openhuman/desktop/notifications/bus_tests_2_tests.rs@@ -448,3 +448,103 @@ async fn an_outage_is_filed_under_its_own_workspace_not_the_bridge_s() {1);}++// ── Live announcement gating (#5931) ────────────────────────────────────────+//+// Routing the *store* by the event's workspace is only half the answer: the+// live path has no per-client routing at all (`core::socketio` emits+// `core_notification` to every connected client), so an outage from a+// workspace the user has switched away from would raise a banner naming that+// workspace's server and its error inside the account they are in.++/// RAII guard for `OPENHUMAN_WORKSPACE`, which is the first thing+/// `config::active_workspace_dir` consults — so it is how a test says which+/// workspace is the active one. Mirrors the guard in+/// `config::workspace::ops_tests`; must be held with `TEST_ENV_LOCK`.+struct ActiveWorkspaceEnvGuard;++impl ActiveWorkspaceEnvGuard {+ fn set(path: &std::path::Path) -> Self {+ // SAFETY: caller holds `TEST_ENV_LOCK`, so no other thread in this+ // process is reading or mutating this env var.+ unsafe {+ std::env::set_var("OPENHUMAN_WORKSPACE", path);+ }+ Self+ }+}++impl Drop for ActiveWorkspaceEnvGuard {+ fn drop(&mut self) {+ // SAFETY: same contract as `set` — the lock is held for the whole test.+ unsafe {+ std::env::remove_var("OPENHUMAN_WORKSPACE");+ }+ }+}++#[tokio::test]+async fn the_active_workspace_s_outage_is_announced() {+ let lock = crate::openhuman::config::TEST_ENV_LOCK+ .lock()+ .unwrap_or_else(|poisoned| poisoned.into_inner());+ let active = tempfile::TempDir::new().unwrap();+ let _guard = ActiveWorkspaceEnvGuard::set(active.path());++ // Ask the resolver what it made of the override rather than assuming:+ // `OPENHUMAN_WORKSPACE` names a *config* root, and which subdirectory of+ // it is the workspace is the loader's rule, not this test's.+ let resolved = crate::openhuman::config::active_workspace_dir()+ .await+ .expect("the override resolves");+ let bridge = bridge_for(&resolved);+ assert!(+ bridge.should_announce(&parked_in(&resolved)).await,+ "the workspace the user is in must still hear about its own outage"+ );+ drop(lock);+}++#[tokio::test]+async fn a_switched_away_workspace_s_outage_is_not_announced() {+ let lock = crate::openhuman::config::TEST_ENV_LOCK+ .lock()+ .unwrap_or_else(|poisoned| poisoned.into_inner());+ let active = tempfile::TempDir::new().unwrap();+ let switched_away = tempfile::TempDir::new().unwrap();+ let _guard = ActiveWorkspaceEnvGuard::set(active.path());++ let resolved = crate::openhuman::config::active_workspace_dir()+ .await+ .expect("the override resolves");+ assert_ne!(resolved, switched_away.path(), "the fixture must differ");++ // The bridge's own binding is deliberately the stale one here — the gate+ // must key off the *live* workspace, not off what the bridge was built+ // with, or it would reproduce the staleness it exists to avoid.+ let bridge = bridge_for(switched_away.path());+ assert!(+ !bridge+ .should_announce(&parked_in(switched_away.path()))+ .await,+ "another workspace's server name and error must not reach this one"+ );+ drop(lock);+}++#[tokio::test]+async fn a_process_wide_event_is_announced_without_consulting_the_workspace() {+ // No env guard and no lock: an event that names no workspace returns on+ // the first line, before any resolution, so it cannot be affected by+ // whichever workspace happens to be active.+ let bridge = bridge_for(std::path::Path::new("/tmp/openhuman-ws-a"));+ assert!(+ bridge+ .should_announce(&DomainEvent::CronJobCompleted {+ job_id: "job-1".into(),+ success: true,+ output: "done".into(),+ })+ .await+ );+}diff --git a/src/openhuman/mcp/registry/README.md b/src/openhuman/mcp/registry/README.mdindex dd4c028277..bb3e354bcf 100644--- a/src/openhuman/mcp/registry/README.md+++ b/src/openhuman/mcp/registry/README.md@@ -29,7 +29,7 @@ The transport primitives themselves (stdio + HTTP MCP clients) live in the sibli| `src/openhuman/mcp/registry/connections.rs` | Global in-process connection registry; `connect`/`disconnect`/`call_tool`/`all_status`/`all_connected_tools`; dispatches stdio vs HTTP via `ActiveClient`. || `src/openhuman/mcp/registry/boot.rs` | `spawn_installed_servers` — boot-time connect of all installs; per-server failures logged, never fatal. || `src/openhuman/mcp/registry/mod.rs` (`supervisor`) | Background reconnect loop (#3312): every 60s drives `tinymcp::Supervisor::tick` for every open workspace host — probes each connected transport and reconnects dropped / never-connected enabled servers with per-server exponential backoff (the cycle itself lives in `tinymcp`). Missed ticks are delayed, not burst. Hands each tick's `TickReport` to `supervisor_events`. |-| `src/openhuman/mcp/registry/supervisor_events.rs` | Translates a `tinymcp::TickReport` into this domain's events (#5931): `McpServerProbeTimedOut`, `McpServerTransportDropped`, `McpServerReconnected`, `McpServerReconnectFailed`, `McpServerParked`. Every event is stamped with the workspace whose host was ticked — one process supervises every workspace it has opened, so the notification bridge files one under the workspace it names rather than under whichever one the bridge was registered with. The developer Event Log streams them (with a one-line `DomainEvent::log_detail` summary, since the envelope carries no payload); the notification bridge turns stays-down / restored / parked into user notifications. An answered probe is deliberately not an event. |+| `src/openhuman/mcp/registry/supervisor_events.rs` | Translates a `tinymcp::TickReport` into this domain's events (#5931): `McpServerProbeTimedOut`, `McpServerTransportDropped`, `McpServerReconnected`, `McpServerReconnectFailed`, `McpServerParked`. Every event is stamped with the workspace whose host was ticked — one process supervises every workspace it has opened, so the notification bridge files one under the workspace it names rather than under whichever one the bridge was registered with, and announces it to connected clients only when that workspace is the active one (the socket bridge has no per-client routing). The developer Event Log streams them (with a one-line `DomainEvent::log_detail` summary, since the envelope carries no payload); the notification bridge turns stays-down / restored / parked into user notifications. An answered probe is deliberately not an event. || `src/openhuman/mcp/registry/ops.rs` | `mcp_clients_*` RPC handler implementations + `resolve_command` + `config_assist` inference call. || `src/openhuman/mcp/registry/setup.rs` | Opaque secret-ref machinery (`SecretRef`, mint/fulfill/await/resolve/consume/gc) for the setup agent. || `src/openhuman/mcp/registry/setup_ops.rs` | `mcp_setup_*` RPC handlers (search/get/request_secret/submit_secret/test_connection/install_and_connect) + connection `pick_connection`. |diff --git a/src/openhuman/mcp/registry/mod.rs b/src/openhuman/mcp/registry/mod.rsindex 4fa1541f6e..e22f64e233 100644--- a/src/openhuman/mcp/registry/mod.rs+++ b/src/openhuman/mcp/registry/mod.rs@@ -425,9 +425,16 @@ pub mod supervisor {// A tick walks every open workspace's installs in sequence and each// probe can take the whole probe window, so a tick can outlast its// own interval. The default behaviour would then fire the missed- // ticks back to back, re-probing servers that were just probed. Pace- // from when the cycle finished instead — `tinymcp::Supervisor::run`- // does the same, and this loop is what stands in for it.+ // ticks back to back, re-probing servers that were just probed.+ //+ // `Delay` stops that burst but does not on its own leave a gap: it+ // schedules the next deadline one interval after the overdue tick+ // *returns*, which is when the cycle starts, not when it ends. A+ // cycle that consistently outlasts its interval would therefore find+ // the next tick already due and run back to back anyway. The+ // `interval.reset()` at the end of the loop body is what actually+ // paces from when the cycle finished — which is what+ // `tinymcp::Supervisor::run` does, and this loop stands in for it.interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay);tracing::info!(@@ -464,6 +471,11 @@ pub mod supervisor {// switched-away workspace's outage for its own.super::supervisor_events::publish(&workspace, &report);}++ // Pace from the end of the cycle, not its start: a cycle slower+ // than the interval leaves the next tick already due, and without+ // this the supervisor would probe continuously.+ interval.reset();}}}