Skip to content

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

chore: remove split composio test files and consolidate into new test modules

Steven Enamakel4dafe7ff23fa
diff --git a/crates/openhuman-core/src/integrations/composio/ops_tests_part_04_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_direct_mode_and_error_classification_tests.rs
similarity index 100%
rename from crates/openhuman-core/src/integrations/composio/ops_tests_part_04_tests.rs
rename to crates/openhuman-core/src/integrations/composio/ops_direct_mode_and_error_classification_tests.rs
diff --git a/crates/openhuman-core/src/integrations/composio/ops_tests_part_03_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_fetch_integrations_and_triggers_tests.rs
similarity index 100%
rename from crates/openhuman-core/src/integrations/composio/ops_tests_part_03_tests.rs
rename to crates/openhuman-core/src/integrations/composio/ops_fetch_integrations_and_triggers_tests.rs
diff --git a/crates/openhuman-core/src/integrations/composio/ops_tests_part_01_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
similarity index 100%
rename from crates/openhuman-core/src/integrations/composio/ops_tests_part_01_tests.rs
rename to crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
diff --git a/crates/openhuman-core/src/integrations/composio/ops_tests_part_02_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_profile_tools_execute_mock_tests.rs
similarity index 100%
rename from crates/openhuman-core/src/integrations/composio/ops_tests_part_02_tests.rs
rename to crates/openhuman-core/src/integrations/composio/ops_profile_tools_execute_mock_tests.rs
diff --git a/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs b/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs
index ca52855606..ff683b1140 100644
--- a/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs
+++ b/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs
@@ -80,22 +80,22 @@ impl Default for RecordingProvider {
}
}
-/// A [`GuardPolicy`](super::GuardPolicy) over an embedded driver with default
+/// A [`GuardPolicy`](super::super::GuardPolicy) over an embedded driver with default
/// budgets — the shipped configuration.
-pub fn embedded_policy() -> super::GuardPolicy {
- super::GuardPolicy::new(
+pub fn embedded_policy() -> super::super::GuardPolicy {
+ super::super::GuardPolicy::new(
"recording",
crate::core::subsystem::DriverClass::Embedded,
crate::config::schema::MemoryHooksConfig::default(),
- super::policy::TRUSTED,
+ super::super::policy::TRUSTED,
)
}
/// A policy over an *external* driver. No such driver can bind today
/// (`binding::admit` refuses them), so this is the only way to reach the class
/// branches that land for real in M6.
-pub fn external_policy(trust_state: &str) -> super::GuardPolicy {
- super::GuardPolicy::new(
+pub fn external_policy(trust_state: &str) -> super::super::GuardPolicy {
+ super::super::GuardPolicy::new(
"supermemory",
crate::core::subsystem::DriverClass::External,
crate::config::schema::MemoryHooksConfig::default(),
@@ -115,17 +115,17 @@ pub fn export_record(taint: MemoryTaint) -> ExportRecord {
}
/// A guard over a fresh recording provider, plus a handle on that provider.
-pub fn guarded(policy: super::GuardPolicy) -> (Arc<RecordingProvider>, super::MemoryGuard) {
+pub fn guarded(policy: super::super::GuardPolicy) -> (Arc<RecordingProvider>, super::super::MemoryGuard) {
guarded_with(RecordingProvider::new(), policy)
}
/// As [`guarded`], over a caller-configured provider.
pub fn guarded_with(
provider: RecordingProvider,
- policy: super::GuardPolicy,
-) -> (Arc<RecordingProvider>, super::MemoryGuard) {
+ policy: super::super::GuardPolicy,
+) -> (Arc<RecordingProvider>, super::super::MemoryGuard) {
let provider = Arc::new(provider);
- let guard = super::MemoryGuard::new(
+ let guard = super::super::MemoryGuard::new(
Arc::clone(&provider) as Arc<dyn MemoryProvider>,
Arc::new(policy),
);
diff --git a/crates/openhuman-core/src/web3/wallet/execution/quotes.rs b/crates/openhuman-core/src/web3/wallet/execution/quotes.rs
index 3dabaf5c1b..cacffb15b6 100644
--- a/crates/openhuman-core/src/web3/wallet/execution/quotes.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution/quotes.rs
@@ -67,6 +67,23 @@ pub(super) fn store_quote(quote: PreparedTransaction) -> PreparedTransaction {
quote
}
+pub(super) fn get_quote(quote_id: &str) -> Result<PreparedTransaction, String> {
+ let store = QUOTE_STORE.lock();
+ let now = now_ms();
+ let quote = store
+ .iter()
+ .find(|q| q.quote_id == quote_id)
+ .cloned()
+ .ok_or_else(|| format!("quote '{quote_id}' not found"))?;
+ if quote.status == PreparedStatus::Consumed {
+ return Err(format!("quote '{quote_id}' already executed"));
+ }
+ if quote.expires_at_ms <= now {
+ return Err(format!("quote '{quote_id}' expired"));
+ }
+ Ok(quote)
+}
+
/// Remove a quote from the store and return it to the caller, if and only if
/// the caller's chat-thread owner matches the prepare-time owner.
///