Skip to content

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

feat(security): add fallback key lookup to profile removal

Steven Enamakel7cd0c363ef19
diff --git a/Cargo.lock b/Cargo.lock
index eb282e5a0b..993af040da 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4938,7 +4938,7 @@ dependencies = [
[[package]]
name = "rand_chacha"
-version = "0.8.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
diff --git a/src/core/jsonrpc.rs b/src/core/jsonrpc.rs
index 2df27b67bb..32b55c68b3 100644
--- a/src/core/jsonrpc.rs
+++ b/src/core/jsonrpc.rs
@@ -1965,7 +1965,7 @@ fn group_first_time(group: crate::core::all::DomainGroup) -> bool {
group_first_time_when_bus_ready(
DONE.get_or_init(|| Mutex::new(HashSet::new())),
group,
- crate::core::event_bus::global().is_some(),
+ crate::core::bus::BUS.get().is_some(),
)
}
@@ -1995,7 +1995,7 @@ fn learning_first_time() -> bool {
static DONE: std::sync::OnceLock<std::sync::Mutex<bool>> = std::sync::OnceLock::new();
learning_first_time_when_bus_ready(
DONE.get_or_init(|| std::sync::Mutex::new(false)),
- crate::core::event_bus::global().is_some(),
+ crate::core::bus::BUS.get().is_some(),
)
}
diff --git a/src/openhuman/agent/tinyagents/middleware_part_02.rs b/src/openhuman/agent/tinyagents/middleware_part_02.rs
index f507e275dc..b02eab8048 100644
--- a/src/openhuman/agent/tinyagents/middleware_part_02.rs
+++ b/src/openhuman/agent/tinyagents/middleware_part_02.rs
@@ -760,17 +760,4 @@ impl ToolPolicyMiddleware {
None
}
- fn generated_context(
- &self,
- name: &str,
- args: &serde_json::Value,
- ) -> Option<crate::openhuman::agent::tool_policy::GeneratedToolRuntimeContext> {
- self.tool_sets
- .iter()
- .flat_map(|set| set.iter())
- .find(|t| t.name() == name)
- .and_then(|t| {
- crate::openhuman::tools::traits::generated_runtime_context(t.as_ref(), args)
- })
- }
}
diff --git a/src/openhuman/agent/tinyagents/middleware_part_06.rs b/src/openhuman/agent/tinyagents/middleware_part_06.rs
index 77dc4bd91f..0d9377905a 100644
--- a/src/openhuman/agent/tinyagents/middleware_part_06.rs
+++ b/src/openhuman/agent/tinyagents/middleware_part_06.rs
@@ -7,6 +7,22 @@
// ── FinalCallWrapUpMiddleware (issue #6014) ──────────────────────────────────
+impl ToolPolicyMiddleware {
+ fn generated_context(
+ &self,
+ name: &str,
+ args: &serde_json::Value,
+ ) -> Option<crate::openhuman::agent::tool_policy::GeneratedToolRuntimeContext> {
+ self.tool_sets
+ .iter()
+ .flat_map(|set| set.iter())
+ .find(|t| t.name() == name)
+ .and_then(|t| {
+ crate::openhuman::tools::traits::generated_runtime_context(t.as_ref(), args)
+ })
+ }
+}
+
/// Turns the **last permitted model call of a capped turn** into the turn's
/// conclusion, in the loop, instead of leaving the answer to an extra call
/// made after the loop has already exited.
diff --git a/src/openhuman/security/credentials/core.rs b/src/openhuman/security/credentials/core.rs
index 9721c13588..3b6dc77d2a 100644
--- a/src/openhuman/security/credentials/core.rs
+++ b/src/openhuman/security/credentials/core.rs
@@ -71,6 +71,11 @@ impl AuthService {
Ok(profile_id)
}
+ /// Removes the requested profile, trying the bare key before its
+ /// `provider:`-namespaced legacy equivalent.
+ ///
+ /// The bare key wins when both forms exist; the namespaced key is only a
+ /// fallback for profiles written by older callers.
pub fn remove_profile(&self, provider: &str, requested_profile: &str) -> Result<bool> {
let provider = normalize_provider(provider)?;
let profile_id = resolve_requested_profile_id(&provider, requested_profile);