From 14e591f482e21692b33daeeb072cba0c790ef79a Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 16 Nov 2026 11:46:37 +0000 Subject: [PATCH 1/4] fix(browser): keep admitted egress alias across config refreshes TinyBus rejects callback-bound refreshes whose config bytes differ from the load, so an edited or rotated upstream_proxies list would fail every browser call until restart. Refreshes now reuse the alias admitted at load and warn when the config has drifted, with the edit taking effect at the next core start. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .../src/modules/browser_egress_host.rs | 47 ++++++++++++++++++- .../src/modules/browser_egress_host_tests.rs | 28 +++++++++++ crates/openhuman-core/src/modules/ops.rs | 2 +- .../about_app/catalog_workflows_automation.rs | 4 +- 4 files changed, 77 insertions(+), 4 deletions(-) diff --git a/crates/openhuman-core/src/modules/browser_egress_host.rs b/crates/openhuman-core/src/modules/browser_egress_host.rs index 6e56402777a..d280a2c11d1 100644 --- a/crates/openhuman-core/src/modules/browser_egress_host.rs +++ b/crates/openhuman-core/src/modules/browser_egress_host.rs @@ -61,11 +61,56 @@ pub(crate) fn browser_dial_alias(config: &crate::config::Config) -> Value { alias } +/// The `browser.egress` section TinyComputer's callback-bound load admitted. +/// TinyBus refuses that module any later config with different bytes +/// ("scoped callback configuration is immutable"), so an edited or rotated +/// `[browser] upstream_proxies` must not reach a refresh: it would fail every +/// browser call until restart. Refreshes reuse what was admitted instead, and +/// the edit takes effect at the next load. +fn admitted_alias() -> &'static parking_lot::Mutex> { + static ADMITTED: std::sync::OnceLock>> = + std::sync::OnceLock::new(); + ADMITTED.get_or_init(|| parking_lot::Mutex::new(None)) +} + +/// Build the alias for a callback-bound load and record it as admitted. +pub(crate) fn admit_browser_dial_alias(config: &crate::config::Config) -> Value { + admit_in(admitted_alias(), config) +} + +fn admit_in(slot: &parking_lot::Mutex>, config: &crate::config::Config) -> Value { + let alias = browser_dial_alias(config); + *slot.lock() = Some(alias.clone()); + alias +} + +/// The alias a refresh pushes: the admitted one when a load recorded it, so a +/// changed proxy list never makes TinyBus refuse the refresh. +fn refresh_alias_in( + slot: &parking_lot::Mutex>, + config: &crate::config::Config, +) -> Value { + let current = browser_dial_alias(config); + match slot.lock().as_ref() { + Some(admitted) => { + if *admitted != current { + // Never the URLs: they carry credentials. + tracing::warn!( + "[computer] [browser] upstream_proxies changed since TinyComputer loaded; \ + the change takes effect at the next core start" + ); + } + admitted.clone() + } + None => current, + } +} + /// Make sure the browser's destination-only policy is registered for this /// host context, then return the stable alias for TinyComputer config. pub(crate) async fn browser_dial_config(config: &crate::config::Config) -> Result { current_browser_policy(config).await?; - Ok(browser_dial_alias(config)) + Ok(refresh_alias_in(admitted_alias(), config)) } /// The id and generation of the current browser policy, registering a new one diff --git a/crates/openhuman-core/src/modules/browser_egress_host_tests.rs b/crates/openhuman-core/src/modules/browser_egress_host_tests.rs index edae5c8ec3f..3e1a8456a5b 100644 --- a/crates/openhuman-core/src/modules/browser_egress_host_tests.rs +++ b/crates/openhuman-core/src/modules/browser_egress_host_tests.rs @@ -180,6 +180,34 @@ fn the_config_names_a_stable_alias_not_the_rotating_policy() { assert_eq!(alias.as_object().unwrap().len(), 2); } +#[test] +fn a_refresh_keeps_the_upstream_proxies_admitted_at_load() { + // TinyBus refuses a callback-bound refresh whose bytes differ from the + // load's, so an edited or rotated proxy list must wait for the next load. + let slot = parking_lot::Mutex::new(None); + let mut loaded = crate::config::Config::default(); + loaded.browser.upstream_proxies = vec![crate::config::schema::BrowserUpstreamProxy { + domains: vec!["reddit.com".into()], + url: "http://resi:old@gate.example:7000".into(), + }]; + let admitted = admit_in(&slot, &loaded); + + let mut edited = loaded.clone(); + edited.browser.upstream_proxies[0].url = "http://resi:rotated@gate.example:7000".into(); + assert_eq!(refresh_alias_in(&slot, &edited), admitted); + let mut removed = loaded.clone(); + removed.browser.upstream_proxies.clear(); + assert_eq!(refresh_alias_in(&slot, &removed), admitted); + assert_eq!(refresh_alias_in(&slot, &loaded), admitted); + + // Before any load, a refresh builds from the current config. + let empty = parking_lot::Mutex::new(None); + assert_eq!(refresh_alias_in(&empty, &edited), browser_dial_alias(&edited)); + // The next load admits the edit. + assert_eq!(admit_in(&slot, &edited), browser_dial_alias(&edited)); + assert_eq!(refresh_alias_in(&slot, &edited), browser_dial_alias(&edited)); +} + #[test] fn configured_upstream_proxies_ride_in_the_private_egress_section() { let mut config = crate::config::Config::default(); diff --git a/crates/openhuman-core/src/modules/ops.rs b/crates/openhuman-core/src/modules/ops.rs index 0e00c1beb3d..4acc81e40ef 100644 --- a/crates/openhuman-core/src/modules/ops.rs +++ b/crates/openhuman-core/src/modules/ops.rs @@ -391,7 +391,7 @@ pub(super) async fn computer_callback_config( let mut module_config = module_config(config, id).await; super::desktop::inject_security_browser_config( &mut module_config, - super::browser_egress_host::browser_dial_alias(config), + super::browser_egress_host::admit_browser_dial_alias(config), callback_destination, ); module_config diff --git a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs index f660118594d..8d7ce216957 100644 --- a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs +++ b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs @@ -96,13 +96,13 @@ Capability { name: "Browser Automation", domain: "workflows", category: CapabilityCategory::Workflows, - description: "Inspect pages and run bounded browser tasks in Chrome through TinyComputer, with a rescue model for failed steps. A finished task's plan and the page elements it found are kept per site in the core's workspace, so the next task there starts sooner. Switched off by [components] computer = false, which unregisters the browser tools and answers the browser RPCs with COMPONENT_DISABLED:computer.", + description: "Inspect pages and run bounded browser tasks in Chrome through TinyComputer, with a rescue model for failed steps. A finished task's plan and the page elements it found are kept per site in the core's workspace, so the next task there starts sooner. An operator can route chosen domains through an upstream HTTP proxy ([browser] upstream_proxies) for sites that block this machine’s own address; TinySecurity still authorizes every routed page and the proxy itself. Switched off by [components] computer = false, which unregisters the browser tools and answers the browser RPCs with COMPONENT_DISABLED:computer.", how_to: "Connections > Computer > Browser, then ask the assistant to use the browser; What tasks learn turns learning off or forgets learned sites", status: CapabilityStatus::Beta, privacy: Some(CapabilityPrivacy { leaves_device: true, data_kind: PrivacyDataKind::Raw, - destinations: &["Visited websites", "OpenRouter, OpenHuman backend, OpenJev or Sage for task decisions", "TypeSafe or Surplus Intelligence for captcha images, only when the captcha solver is on (captcha_provider)"], + destinations: &["Visited websites", "OpenRouter, OpenHuman backend, OpenJev or Sage for task decisions", "TypeSafe or Surplus Intelligence for captcha images, only when the captcha solver is on (captcha_provider)", "The operator’s upstream HTTP proxy, for the domains in [browser] upstream_proxies, only when set"], }), }, Capability { From a38039f6717573dc4aa84aaf94dfc723a82015ba Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 16 Nov 2026 11:48:54 +0000 Subject: [PATCH 2/4] test(browser): cover upstream proxy disclosure and tidy assertions Add a catalog test asserting that browser automation discloses the optional upstream proxy in its description and privacy destinations, and reformat two existing egress host assertions to satisfy line width limits. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .../src/modules/browser_egress_host_tests.rs | 10 ++++++++-- .../src/platform/about_app/catalog_tests.rs | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/crates/openhuman-core/src/modules/browser_egress_host_tests.rs b/crates/openhuman-core/src/modules/browser_egress_host_tests.rs index 3e1a8456a5b..5a3e8f3fe74 100644 --- a/crates/openhuman-core/src/modules/browser_egress_host_tests.rs +++ b/crates/openhuman-core/src/modules/browser_egress_host_tests.rs @@ -202,10 +202,16 @@ fn a_refresh_keeps_the_upstream_proxies_admitted_at_load() { // Before any load, a refresh builds from the current config. let empty = parking_lot::Mutex::new(None); - assert_eq!(refresh_alias_in(&empty, &edited), browser_dial_alias(&edited)); + assert_eq!( + refresh_alias_in(&empty, &edited), + browser_dial_alias(&edited) + ); // The next load admits the edit. assert_eq!(admit_in(&slot, &edited), browser_dial_alias(&edited)); - assert_eq!(refresh_alias_in(&slot, &edited), browser_dial_alias(&edited)); + assert_eq!( + refresh_alias_in(&slot, &edited), + browser_dial_alias(&edited) + ); } #[test] diff --git a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs index 4f4d9609c1c..18fd0a6d30d 100644 --- a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs +++ b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs @@ -573,3 +573,18 @@ fn computer_capabilities_disclose_the_components_ceiling() { ); } } + +#[test] +fn browser_automation_discloses_the_optional_upstream_proxy() { + let capability = + lookup("workflows.computer_browser_automation").expect("browser automation is listed"); + assert!(capability + .description + .contains("[browser] upstream_proxies")); + let privacy = capability.privacy.expect("browser automation has privacy"); + assert!(privacy + .destinations + .iter() + .any(|destination| destination.contains("upstream HTTP proxy") + && destination.contains("[browser] upstream_proxies"))); +} From 8291a4f57d07bd0b91cac4423ecd344c570372e9 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 16 Nov 2026 12:31:18 +0000 Subject: [PATCH 3/4] chore(ci): register browser egress host static in process statics Adds an entry for the browser egress host's process-wide admitted config to the CI static registry, documenting that it holds operator upstream proxy settings rather than tenant data and pointing at the test that verifies a refresh preserves them. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- scripts/ci/process-statics.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/ci/process-statics.json b/scripts/ci/process-statics.json index 8bccf108dbf..1f9620ceade 100644 --- a/scripts/ci/process-statics.json +++ b/scripts/ci/process-statics.json @@ -958,5 +958,15 @@ "category": "B", "reason": "Prepared program quotes are partitioned by QuoteBinding (workspace path, a hash of the encrypted phrase, account index and Solana endpoint). A take is refused, and the quote stays in the map, unless all four match the context that takes it.", "verification": "web3/wallet/program/ops_tests.rs: a_quote_is_taken_only_in_the_context_it_was_prepared_in" + }, + { + "file": "crates/openhuman-core/src/modules/browser_egress_host.rs", + "scope": "", + "name": "ADMITTED", + "type": "std::sync::OnceLock>>", + "count": 1, + "category": "A", + "reason": "The browser.egress section TinyComputer's callback-bound load admitted. TinyComputer is one module per process with one host config, and TinyBus refuses a refresh that differs from what was loaded, so this mirrors the module's own process-wide config. It holds the operator's [browser] upstream_proxies (process configuration), never tenant data.", + "verification": "modules/browser_egress_host_tests.rs: a_refresh_keeps_the_upstream_proxies_admitted_at_load" } ] From 83bcca26032cb4b3454b44342a82787aad2467be Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 16 Nov 2026 12:33:39 +0000 Subject: [PATCH 4/4] fix(about_app): note that upstream proxy changes apply at next core start The browser automation privacy disclosure now states that adding, changing or removing the upstream HTTP proxy takes effect at the next core start, and the catalog test asserts this wording so the guidance stays covered. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- crates/openhuman-core/src/platform/about_app/catalog_tests.rs | 3 ++- .../src/platform/about_app/catalog_workflows_automation.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs index 18fd0a6d30d..992cd528978 100644 --- a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs +++ b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs @@ -586,5 +586,6 @@ fn browser_automation_discloses_the_optional_upstream_proxy() { .destinations .iter() .any(|destination| destination.contains("upstream HTTP proxy") - && destination.contains("[browser] upstream_proxies"))); + && destination.contains("[browser] upstream_proxies") + && destination.contains("next core start"))); } diff --git a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs index 8d7ce216957..3d5c3442b0c 100644 --- a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs +++ b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs @@ -102,7 +102,7 @@ Capability { privacy: Some(CapabilityPrivacy { leaves_device: true, data_kind: PrivacyDataKind::Raw, - destinations: &["Visited websites", "OpenRouter, OpenHuman backend, OpenJev or Sage for task decisions", "TypeSafe or Surplus Intelligence for captcha images, only when the captcha solver is on (captcha_provider)", "The operator’s upstream HTTP proxy, for the domains in [browser] upstream_proxies, only when set"], + destinations: &["Visited websites", "OpenRouter, OpenHuman backend, OpenJev or Sage for task decisions", "TypeSafe or Surplus Intelligence for captcha images, only when the captcha solver is on (captcha_provider)", "The operator’s upstream HTTP proxy, for the domains in [browser] upstream_proxies, only when set; adding, changing or removing it takes effect at the next core start"], }), }, Capability {