Skip to content

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

fix(security): handle missing credential in tool execution

Steven Enamakelb07d8d6b7531
diff --git a/crates/openhuman-core/src/security/credentials/tools.rs b/crates/openhuman-core/src/security/credentials/tools.rs
index 08e07af7dd..b0d188fc06 100644
--- a/crates/openhuman-core/src/security/credentials/tools.rs
+++ b/crates/openhuman-core/src/security/credentials/tools.rs
@@ -95,39 +95,6 @@ impl Tool for SessionStateTool {
}
}
-/// Current user profile.
-pub struct SessionGetUserTool {
- config: Arc<Config>,
-}
-impl SessionGetUserTool {
- pub fn new(config: Arc<Config>) -> Self {
- Self { config }
- }
-}
-#[async_trait]
-impl Tool for SessionGetUserTool {
- fn name(&self) -> &str {
- "session_get_user"
- }
- fn description(&self) -> &str {
- "Return the current signed-in user's profile (name/email/plan). Does not \
- expose the session token."
- }
- fn parameters_schema(&self) -> serde_json::Value {
- json!({ "type": "object", "properties": {} })
- }
- async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<ToolResult> {
- log::debug!("[tool][credentials] get_user invoked");
- emit!(
- credentials::auth_get_me(&self.config).await,
- "session_get_user"
- )
- }
- fn is_concurrency_safe(&self, _args: &serde_json::Value) -> bool {
- true
- }
-}
-
/// OAuth authorize URL for a provider.
pub struct OAuthConnectUrlTool {
config: Arc<Config>,
diff --git a/crates/openhuman-core/src/tools/ops.rs b/crates/openhuman-core/src/tools/ops.rs
index fb9a4eb505..15807b298e 100644
--- a/crates/openhuman-core/src/tools/ops.rs
+++ b/crates/openhuman-core/src/tools/ops.rs
@@ -639,7 +639,6 @@ pub fn all_tools_with_runtime(
// non-secret reads.
Box::new(CredentialListTool::new(config.clone())),
Box::new(SessionStateTool::new(config.clone())),
- Box::new(SessionGetUserTool::new(config.clone())),
Box::new(OAuthConnectUrlTool::new(config.clone())),
Box::new(OAuthListTool::new(config.clone())),
// MCP registry and workspace persona. Observe/connect/call tools