Skip to content

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

fix(composio): correct catalog description field name

Steven Enamakelf5b417508424
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
index 9434ec42b3..95050cd741 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
@@ -355,20 +355,6 @@ pub(super) fn assemble_turn_harness(
harness.push_middleware(mw.clone());
}
- // Memory protocol (issue #4116): observe the read → dedupe → write →
- // update-index cycle and append a corrective note when a write skips the
- // dedupe read or leaves the index stale. Pushed ahead of every other
- // result-rewriting middleware so its `after_tool` runs *after* the byte-cap
- // truncation, keeping the note.
- // Dedupe guidance stays active; only the closing-step reminder depends on
- // whether this turn can call the index-update tool.
- let can_update_index = allowed
- .as_ref()
- .is_none_or(|names| names.contains("update_memory_md"));
- harness.push_middleware(Arc::new(middleware::memory_protocol_middleware(
- can_update_index,
- )));
-
// Repeated-failure circuit breaker: pause the run when a tool returns the same
// error `REPEATED_TOOL_FAILURE_THRESHOLD` times in a row, so a deterministic
// security/approval denial or terminal tool error surfaces its root cause
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
index cadb311565..b6be95d83e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
@@ -22,7 +22,6 @@ use crate::agent::tinyagents::tools::{CanonicalSharedToolAdapter, EarlyExitHook}
use crate::agent::tinyagents::turn_policy::is_subagent_spawn_or_delegate_tool;
use crate::agent::tinyagents::use_skill_dispatch::UseSkillDispatch;
use crate::agent::tools::{DelegateToolDispatch, TodoToolDispatch};
-use crate::memory::agent::CallMemoryAgentDispatch;
use tinyagents_harness::tool::packs::USE_SKILL;
/// Typed-dispatch selection shared by the direct per-turn registration below
@@ -56,7 +55,6 @@ pub(crate) fn typed_dispatch_for(
"delegate_graph" => Arc::new(DelegateGraphDispatch::new(adapter)),
"delegate" => Arc::new(DelegateToolDispatch::new(adapter)),
"todo" => Arc::new(TodoToolDispatch::new(adapter)),
- "call_memory_agent" => Arc::new(CallMemoryAgentDispatch::new(adapter)),
_ => {
return DelegationDispatch::for_tool(adapter).map(|dispatch| {
Arc::new(dispatch) as Arc<dyn ToolDispatch<(), OpenHumanRunContext>>
diff --git a/crates/openhuman-core/src/integrations/composio/contract/catalogs/descriptions.rs b/crates/openhuman-core/src/integrations/composio/contract/catalogs/descriptions.rs
index 9bda6ff2c0..676743f834 100644
--- a/crates/openhuman-core/src/integrations/composio/contract/catalogs/descriptions.rs
+++ b/crates/openhuman-core/src/integrations/composio/contract/catalogs/descriptions.rs
@@ -65,56 +65,6 @@ pub fn toolkit_description(slug: &str) -> &'static str {
}
}
-/// What a toolkit's actions hand back, and which field feeds which follow-up
-/// action. `None` for a toolkit we have not established this for.
-///
-/// [`toolkit_description`] answers "what can this service do", which is an
-/// **input**-side question — and so is everything else the model reads before
-/// calling: the tool catalogue, the parameter schema. Nothing tells it what
-/// comes back. So a list action returns records keyed by id, the model has no
-/// statement that the id is the handle for the detail it actually wanted, and it
-/// re-issues the same list call. That was observed live against Gmail.
-///
-/// The rule for adding an entry: name only action slugs this crate's curated
-/// catalogues carry, and say only what a caller has established by observing
-/// those actions. A toolkit nobody has checked gets no entry — a guess about a
-/// response is worse here than silence, because the model will act on it.
-///
-/// **Do not describe field-by-field record shapes here.** A note may say what a
-/// result *contains* and what to do with it, not how it is serialized. Composio
-/// dispatch prefers the backend's rendered `markdownFormatted` body and falls
-/// back to the JSON envelope only when that is absent, so a note reciting JSON
-/// keys is true on one of two renderings. An earlier revision of this text made
-/// exactly that mistake and told the model every Gmail read action answers with
-/// a markdown body, when only `GMAIL_FETCH_EMAILS` carries one.
-pub fn toolkit_result_notes(slug: &str) -> Option<&'static str> {
- match slug {
- // Slugs: `gmail::GMAIL_CURATED`.
- //
- // The thread/message distinction is the whole point of this entry. Live,
- // a sub-agent searched with GMAIL_LIST_THREADS, got no message body back,
- // and reported that mail which does exist could not be found.
- "gmail" => Some(
- "GMAIL_LIST_THREADS answers with thread ids, a one-line snippet, and a message \
- count — never a message body, so a thread whose snippet looks right still has \
- to be read. Pass a thread id to GMAIL_FETCH_MESSAGE_BY_THREAD_ID, or a message \
- id to GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID, to get the body; GMAIL_FETCH_EMAILS \
- carries one already. Bodies are the backend's rendered text, not the raw \
- message, and attachments arrive as a filename and type that GMAIL_GET_ATTACHMENT \
- fetches. Repeating a search returns the same snippets, so read the thread \
- instead of searching again.",
- ),
- // Slugs: `messaging::SLACK_CURATED`.
- "slack" => Some(
- "SLACK_LIST_CONVERSATIONS answers with a channel id per channel, and that id is \
- the channel argument SLACK_FETCH_CONVERSATION_HISTORY and the post actions take. \
- History entries identify their author by Slack user id, not display name, so \
- resolve it with SLACK_FIND_USERS before quoting a name, and identify themselves \
- by a ts timestamp, which is what threads and reactions key on.",
- ),
- _ => None,
- }
-}
#[cfg(test)]
#[path = "descriptions_tests.rs"]
diff --git a/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs b/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs
index a48edc865f..3e35c78d1d 100644
--- a/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs
+++ b/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod.rs
@@ -26,106 +26,16 @@ use super::scopes::{
classify_unknown, find_curated, toolkit_from_slug, CuratedTool, ToolScope, UserScopePref,
};
-pub use descriptions::{toolkit_description, toolkit_result_notes};
+pub use descriptions::toolkit_description;
-/// Every toolkit the capability surface reports on, in display order.
-pub const CAPABILITY_TOOLKITS: &[&str] = &[
- "gmail",
- "notion",
- "slack",
- "clickup",
- "github",
- "discord",
- "googlecalendar",
- "googledrive",
- "googledocs",
- "googlesheets",
- "outlook",
- "microsoft_teams",
- "linear",
- "jira",
- "trello",
- "asana",
- "dropbox",
- "twitter",
- "spotify",
- "telegram",
- "whatsapp",
- "shopify",
- "stripe",
- "hubspot",
- "salesforce",
- "airtable",
- "figma",
- "youtube",
- "one_drive",
- "excel",
- "todoist",
-];
+/// Toolkits the connector module can sync into memory (`tinyconnectors-sync`'s
+/// provider tree).
+pub const NATIVE_PROVIDERS: &[&str] = &["gmail", "notion", "slack", "clickup", "github", "linear"];
-/// Toolkits with a native `ComposioProvider` in the engine, and the
-/// compile-time default periodic-sync interval each one ships.
-///
-/// The provider impls are the engine's, but *which* toolkits have one and how
-/// often they run are facts a host reports in its capability surface, so the
-/// table is contract data. Each provider still calls its own
-/// `resolve_sync_interval_secs` with the same default, and
-/// `native_provider_sync_interval_secs` below resolves the identical env
-/// override — so the two cannot disagree without this table being edited.
-pub const NATIVE_PROVIDERS: &[(&str, u64)] = &[
- ("gmail", 15 * 60),
- ("notion", 30 * 60),
- ("slack", 15 * 60),
- ("clickup", 30 * 60),
- ("github", 30 * 60),
- ("linear", 30 * 60),
-];
-
-/// Does `toolkit` have a native provider implementation?
+/// Does `toolkit` have a native sync provider?
#[must_use]
pub fn has_native_provider(toolkit: &str) -> bool {
- NATIVE_PROVIDERS.iter().any(|(slug, _)| *slug == toolkit)
-}
-
-/// The env var read to override a toolkit's periodic sync interval.
-///
-/// Exposed so tests and `.env.example` stay in lockstep with the runtime
-/// lookup without re-implementing the casing.
-#[must_use]
-pub fn sync_interval_env_var(toolkit: &str) -> String {
- format!(
- "OPENHUMAN_COMPOSIO_{}_SYNC_INTERVAL_SECS",
- toolkit.to_ascii_uppercase()
- )
-}
-
-/// Apply a raw env-var override to a default interval.
-///
-/// Split out from the env read so both sides can share the rule and differ on
-/// what they do about a bad value: a provider warns once, an observability read
-/// stays silent. `0` is never honoured — it would burn the scheduler in a tight
-/// loop — so a non-positive or unparseable value yields `None` and the caller
-/// keeps its default.
-#[must_use]
-pub fn parse_sync_interval_override(raw: &str) -> Option<u64> {
- raw.trim().parse::<u64>().ok().filter(|n| *n >= 1)
-}
-
-/// The effective periodic sync interval for a native provider, honouring the
-/// `OPENHUMAN_COMPOSIO_<TOOLKIT>_SYNC_INTERVAL_SECS` override.
-///
-/// `None` for a toolkit with no native provider.
-#[must_use]
-pub fn native_provider_sync_interval_secs(toolkit: &str) -> Option<u64> {
- let default_secs = NATIVE_PROVIDERS
- .iter()
- .find(|(slug, _)| *slug == toolkit)
- .map(|(_, secs)| *secs)?;
- let resolved = std::env::var(sync_interval_env_var(toolkit))
- .ok()
- .and_then(|raw| parse_sync_interval_override(&raw))
- .unwrap_or(default_secs);
- Some(resolved)
+ NATIVE_PROVIDERS.contains(&toolkit)
}
/// Static toolkit → curated catalog map.
@@ -217,15 +127,6 @@ pub fn curated_scope_for(slug: &str) -> Option<ToolScope> {
find_curated(catalog, slug).map(|c| c.scope)
}
-/// Does any curated action for `toolkit` require `scope`?
-///
-/// Useful whenever the question is "would flipping the {scope} bit unlock
-/// anything here?" — a UI hint that greys out a toggle with no effect.
-#[must_use]
-pub fn toolkit_has_scope(toolkit: &str, scope: ToolScope) -> bool {
- catalog_for_toolkit(toolkit).is_some_and(|cat| cat.iter().any(|t| t.scope == scope))
-}
-
#[cfg(test)]
#[path = "mod_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod_tests.rs b/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod_tests.rs
index 619c6e475d..0a7f69e460 100644
--- a/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/contract/catalogs/mod_tests.rs
@@ -3,6 +3,42 @@
use super::*;
+/// Every toolkit with a curated catalog, in display order.
+const CAPABILITY_TOOLKITS: &[&str] = &[
+ "gmail",
+ "notion",
+ "slack",
+ "clickup",
+ "github",
+ "discord",
+ "googlecalendar",
+ "googledrive",
+ "googledocs",
+ "googlesheets",
+ "outlook",
+ "microsoft_teams",
+ "linear",
+ "jira",
+ "trello",
+ "asana",
+ "dropbox",
+ "twitter",
+ "spotify",
+ "telegram",
+ "whatsapp",
+ "shopify",
+ "stripe",
+ "hubspot",
+ "salesforce",
+ "airtable",
+ "figma",
+ "youtube",
+ "one_drive",
+ "excel",
+ "todoist",
+];
+
+
#[test]
fn catalog_for_toolkit_resolves_every_capability_toolkit() {
// Every toolkit the capability surface reports on must have a catalog —
@@ -44,73 +80,22 @@ fn catalog_for_toolkit_honours_slug_aliases() {
}
#[test]
-fn every_native_provider_has_a_catalog_and_a_positive_default_interval() {
- for (slug, default_secs) in NATIVE_PROVIDERS {
+fn every_native_provider_has_a_catalog() {
+ for slug in NATIVE_PROVIDERS {
assert!(
catalog_for_toolkit(slug).is_some(),
"native provider {slug} has no curated catalog"
);
assert!(has_native_provider(slug));
- assert!(
- *default_secs >= 1,
- "{slug} default interval must be positive"
- );
assert!(
CAPABILITY_TOOLKITS.contains(slug),
- "native provider {slug} is missing from the capability surface"
+ "native provider {slug} is missing from the capability list"
);
}
assert!(!has_native_provider("jira"));
assert!(!has_native_provider("nonexistent-toolkit"));
}
-#[test]
-fn sync_interval_env_var_upper_cases_the_toolkit() {
- assert_eq!(
- sync_interval_env_var("gmail"),
- "OPENHUMAN_COMPOSIO_GMAIL_SYNC_INTERVAL_SECS"
- );
- assert_eq!(
- sync_interval_env_var("microsoft_teams"),
- "OPENHUMAN_COMPOSIO_MICROSOFT_TEAMS_SYNC_INTERVAL_SECS"
- );
-}
-
-#[test]
-fn parse_sync_interval_override_rejects_zero_and_junk() {
- // `0` would burn the scheduler in a tight loop, so it is never honoured.
- assert_eq!(parse_sync_interval_override("0"), None);
- assert_eq!(parse_sync_interval_override("-5"), None);
- assert_eq!(parse_sync_interval_override("soon"), None);
- assert_eq!(parse_sync_interval_override(""), None);
- assert_eq!(parse_sync_interval_override(" 900 "), Some(900));
- assert_eq!(parse_sync_interval_override("1"), Some(1));
-}
-
-#[test]
-fn native_provider_sync_interval_is_none_for_catalog_only_toolkits() {
- // Reads no env var, so it is safe beside the process-global env tests.
- assert_eq!(native_provider_sync_interval_secs("jira"), None);
- assert_eq!(
- native_provider_sync_interval_secs("nonexistent-toolkit"),
- None
- );
- assert!(native_provider_sync_interval_secs("gmail").is_some());
-}
-
-#[test]
-fn toolkit_has_scope_distinguishes_gated_from_ungated_scopes() {
- // The gmail catalog includes destructive verbs (delete / trash /
- // batch_delete), so admin-gating actually unlocks something.
- assert!(toolkit_has_scope("gmail", ToolScope::Admin));
- assert!(toolkit_has_scope("gmail", ToolScope::Read));
- assert!(toolkit_has_scope("gmail", ToolScope::Write));
- // Case-insensitive toolkit slug → still routes to the catalog.
- assert!(toolkit_has_scope("GMAIL", ToolScope::Admin));
- // Unknown toolkit → no catalog → no scope is "gating" anything.
- assert!(!toolkit_has_scope("nonexistent-toolkit", ToolScope::Admin));
-}
-
#[test]
fn curated_scope_for_reads_the_catalogs_entry_not_the_heuristic() {
// Pick a real curated read action and assert the catalog's own verdict.