Skip to content

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

fix(session_host): skip non-integration tools during rehydration

Steven Enamakelf0105e8b738b
diff --git a/crates/openhuman-core/src/agent/session_host/prelude_integrations.rs b/crates/openhuman-core/src/agent/session_host/prelude_integrations.rs
index 8f75362cef..258dcbffd4 100644
--- a/crates/openhuman-core/src/agent/session_host/prelude_integrations.rs
+++ b/crates/openhuman-core/src/agent/session_host/prelude_integrations.rs
@@ -90,7 +90,10 @@ impl OpenHumanTurnPrelude {
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner);
mutable.connected_integrations = connected;
- mutable.connected_integrations_initialized = true;
+ // A stale fallback is useful for announcements but cannot authorize
+ // restored executors. Leave hydration pending so a later turn retries
+ // the live lookup rather than pinning this session to the snapshot.
+ mutable.connected_integrations_initialized = authoritative;
mutable.connected_integrations_authoritative = authoritative;
mutable.announced_integrations = mutable
.connected_integrations
diff --git a/crates/openhuman-core/src/agent/session_host/recorded_tools.rs b/crates/openhuman-core/src/agent/session_host/recorded_tools.rs
index 37b0c4b43a..20d7c0de4f 100644
--- a/crates/openhuman-core/src/agent/session_host/recorded_tools.rs
+++ b/crates/openhuman-core/src/agent/session_host/recorded_tools.rs
@@ -68,6 +68,10 @@ pub(super) fn rehydrate_integration_actions(
let mut seen = HashSet::new();
recorded
.iter()
+ // Only Composio's upper-case `TOOLKIT_ACTION` declarations may be
+ // reconstructed. A recorded OpenHuman tool such as `web_fetch` is
+ // historical prompt state, not an integration action.
+ .filter(|spec| is_integration_action_name(&spec.name))
// Transcript declarations are historical state, never authorization.
// Do not make a deferred executor available until a current
// authoritative integration snapshot permits its toolkit and action.
diff --git a/crates/openhuman-core/src/agent/session_host/recorded_tools_tests.rs b/crates/openhuman-core/src/agent/session_host/recorded_tools_tests.rs
index f0a5e69c3b..c5bd47c9f4 100644
--- a/crates/openhuman-core/src/agent/session_host/recorded_tools_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/recorded_tools_tests.rs
@@ -56,6 +56,16 @@ fn unavailable_authorization_does_not_rebuild_recorded_actions() {
assert!(rebuilt.is_empty());
}
+#[test]
+fn non_integration_declarations_are_never_rehydrated() {
+ let recorded = vec![spec("web_fetch"), spec("GMAIL_SEND_EMAIL")];
+ let integrations = vec![integration("web", true, Vec::new()), integration("gmail", true, Vec::new())];
+
+ let rebuilt = rehydrate_integration_actions(&recorded, &[], &integrations, true);
+ let names: Vec<&str> = rebuilt.iter().map(|tool| tool.name()).collect();
+ assert_eq!(names, vec!["GMAIL_SEND_EMAIL"]);
+}
+
#[test]
fn a_live_action_is_not_rebuilt_from_the_record() {
let recorded = vec![spec("GMAIL_SEND_EMAIL"), spec("SLACK_SEND_MESSAGE")];