Skip to content

feat(composio): expose capability matrix#2002

Merged
senamakel merged 1 commit into
tinyhumansai:mainfrom
honor2030:feat/integration-capability-matrix-tests
May 18, 2026
Merged

feat(composio): expose capability matrix#2002
senamakel merged 1 commit into
tinyhumansai:mainfrom
honor2030:feat/integration-capability-matrix-tests

Conversation

@honor2030
Copy link
Copy Markdown
Contributor

@honor2030 honor2030 commented May 17, 2026

Summary

  • Add a static Composio capability matrix that records catalog support, curated tools, native-provider support, memory ingest, and trigger support per toolkit.
  • Expose the matrix through a new composio.list_capabilities RPC/schema so clients can inspect supported integration capabilities without an authenticated Composio backend session.
  • Add focused coverage for the no-session RPC path, schema registration/output shape, and Gmail vs Google Calendar capability distinctions.

Test Plan

  • RUSTC=$(rustup which --toolchain 1.93.0 rustc) GGML_NATIVE=OFF rustup run 1.93.0 cargo fmt --all
  • RUSTC=$(rustup which --toolchain 1.93.0 rustc) GGML_NATIVE=OFF rustup run 1.93.0 cargo test --manifest-path Cargo.toml composio_list_capabilities_does_not_require_session --lib
  • RUSTC=$(rustup which --toolchain 1.93.0 rustc) GGML_NATIVE=OFF rustup run 1.93.0 cargo test --manifest-path Cargo.toml capability_matrix_distinguishes_native_from_catalog_only_toolkits --lib
  • RUSTC=$(rustup which --toolchain 1.93.0 rustc) GGML_NATIVE=OFF rustup run 1.93.0 cargo test --manifest-path Cargo.toml list_capabilities_schema_has_matrix_output --lib
  • RUSTC=$(rustup which --toolchain 1.93.0 rustc) GGML_NATIVE=OFF rustup run 1.93.0 cargo check --manifest-path Cargo.toml

Notes

  • This is intentionally a small read-only slice: it does not change auth, sync, execution, or trigger behavior.
  • The new RPC is safe to call before Composio session setup, which lets UI/agents discover built-in integration capabilities before asking users to connect accounts.

Summary by CodeRabbit

  • New Features

    • Added composio.list_capabilities RPC endpoint that retrieves a complete capability matrix for all supported toolkits, including information about sync intervals, native provider support, and feature availability.
  • Tests

    • Added comprehensive tests to verify the capabilities endpoint functions correctly without requiring session setup and returns expected toolkit data.

Review Change Stack

@honor2030 honor2030 requested a review from a team May 17, 2026 13:00
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

📝 Walkthrough

Walkthrough

This PR adds a new composio.list_capabilities RPC endpoint that returns a matrix describing toolkit capabilities (native providers, sync support, webhook/memory ingestion flags, sync intervals). The implementation spans type definitions, a capability builder from static toolkit metadata, an RPC operation, schema registration with handler wiring, and public API exports.

Changes

Composio Capability Matrix RPC Feature

Layer / File(s) Summary
Capability Matrix Data Model and Builder
src/openhuman/composio/types.rs, src/openhuman/composio/providers/mod.rs
ComposioCapability and ComposioCapabilitiesResponse types model per-toolkit capability flags (native provider, curated tools, sync intervals, webhook/memory ingestion). capability_matrix() builder populates capabilities from static toolkit metadata, distinguishing native-provider toolkits (gmail, notion, slack) from catalog-only ones. Test validates correct classification.
RPC Operation Implementation
src/openhuman/composio/ops.rs, src/openhuman/composio/ops_test.rs
composio_list_capabilities operation calls capability_matrix() and returns results wrapped in RpcOutcome with row count. Imports reorganized so provider helpers import from super::providers. Test verifies operation succeeds without stored session and returns expected capability flags for gmail (native + memory ingest) and googlecalendar (catalog-only).
Schema Registration and Handler Wiring
src/openhuman/composio/schemas.rs, src/openhuman/composio/schemas_tests.rs
composio.list_capabilities registered in schema registry with no inputs and required JSON capabilities output. handle_list_capabilities handler loads config and delegates to the RPC operation. Updated all_controller_schemas() and all_registered_controllers() to expose endpoint. Tests validate schema structure and registry presence.
Public API Exports
src/openhuman/composio/mod.rs
ComposioCapability and ComposioCapabilitiesResponse added to module re-exports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

working

Suggested reviewers

  • senamakel

Poem

🐰 A matrix of skills, now plainly revealed,
Composio's capabilities, formally sealed,
From toolkit to toolkit, the flags brightly shine,
Gmail syncs, Slack hooks, all logged in one line,
The RPC flows swift through schema so fine! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: exposing the capability matrix as a feature in the Composio module.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the working A PR that is being worked on by the team. label May 17, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/openhuman/composio/ops.rs (1)

200-212: ⚡ Quick win

Add an explicit RPC exit log for composio_list_capabilities.

Entry is logged, but success exit context is missing. Add a debug/trace exit log with row count to match the RPC observability contract.

Proposed patch
 pub async fn composio_list_capabilities(
     _config: &Config,
 ) -> OpResult<RpcOutcome<ComposioCapabilitiesResponse>> {
     tracing::debug!("[composio] rpc list_capabilities");
     let resp = ComposioCapabilitiesResponse {
         capabilities: capability_matrix(),
     };
     let count = resp.capabilities.len();
+    tracing::debug!(
+        rows = count,
+        "[composio] rpc list_capabilities: success"
+    );
     Ok(RpcOutcome::new(
         resp,
         vec![format!("composio: {count} capability row(s) listed")],
     ))
 }

As per coding guidelines: src/**/*.rs: Use log / tracing at debug or trace level on RPC entry and exit, error paths, state transitions, and hard-to-infer branches.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/composio/ops.rs` around lines 200 - 212, The RPC currently logs
entry in composio_list_capabilities but lacks a matching exit log; add a
tracing::debug (or tracing::trace per convention) call just before returning
that logs the successful exit and the count of capability rows (use the local
variable count or resp.capabilities.len()) so the RPC observability contract is
satisfied; place the log after constructing resp/count and before
Ok(RpcOutcome::new(...)) and include a clear message like
"composio_list_capabilities exit: {count} rows" to mirror the entry log.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/openhuman/composio/providers/mod.rs`:
- Around line 57-132: The file currently implements the capability matrix and
helpers (CAPABILITY_TOOLKITS, native_provider_sync_interval,
has_native_provider, and the capability_matrix() builder that calls
catalog_for_toolkit and toolkit_description) inside providers/mod.rs; move all
operational items (CAPABILITY_TOOLKITS, native_provider_sync_interval,
has_native_provider, and the capability_matrix implementation) into a new
sibling module providers/capability_matrix.rs, keep only a pub use or a thin
wrapper re-exporting the public entrypoint capability_matrix from mod.rs, and
update any local references so catalog_for_toolkit, toolkit_description, and
ComposioCapability remain accessible to the moved code (either by importing them
in the new module or relocating any dependent helpers).

---

Nitpick comments:
In `@src/openhuman/composio/ops.rs`:
- Around line 200-212: The RPC currently logs entry in
composio_list_capabilities but lacks a matching exit log; add a tracing::debug
(or tracing::trace per convention) call just before returning that logs the
successful exit and the count of capability rows (use the local variable count
or resp.capabilities.len()) so the RPC observability contract is satisfied;
place the log after constructing resp/count and before Ok(RpcOutcome::new(...))
and include a clear message like "composio_list_capabilities exit: {count} rows"
to mirror the entry log.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82d06b01-267d-4d3a-8620-ffb79e65a30f

📥 Commits

Reviewing files that changed from the base of the PR and between f9de38d and 71fafd0.

📒 Files selected for processing (7)
  • src/openhuman/composio/mod.rs
  • src/openhuman/composio/ops.rs
  • src/openhuman/composio/ops_test.rs
  • src/openhuman/composio/providers/mod.rs
  • src/openhuman/composio/schemas.rs
  • src/openhuman/composio/schemas_tests.rs
  • src/openhuman/composio/types.rs

Comment on lines +57 to +132
use crate::openhuman::composio::types::ComposioCapability;

const CAPABILITY_TOOLKITS: &[&str] = &[
"gmail",
"notion",
"slack",
"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",
];

fn native_provider_sync_interval(toolkit: &str) -> Option<u64> {
match toolkit {
"gmail" => Some(gmail::GmailProvider::new().sync_interval_secs()),
"notion" => Some(notion::NotionProvider::new().sync_interval_secs()),
"slack" => Some(slack::SlackProvider::new().sync_interval_secs()),
_ => None,
}
.flatten()
}

fn has_native_provider(toolkit: &str) -> bool {
matches!(toolkit, "gmail" | "notion" | "slack")
}

/// Static overview of the Composio integrations supported by this core build.
///
/// This deliberately does not consult the live Composio backend/direct tenant:
/// it is an observability surface for OpenHuman's own capability tiers. Use
/// `composio_list_toolkits` / `composio_list_connections` when callers need
/// the currently signed-in user's allowlist or OAuth state.
pub fn capability_matrix() -> Vec<ComposioCapability> {
CAPABILITY_TOOLKITS
.iter()
.map(|toolkit| {
let native_provider = has_native_provider(toolkit);
let catalog = catalog_for_toolkit(toolkit);
let sync_interval_secs = native_provider_sync_interval(toolkit);
ComposioCapability {
toolkit: (*toolkit).to_string(),
description: toolkit_description(toolkit).to_string(),
native_provider,
curated_tools: catalog.is_some(),
curated_tool_count: catalog.map_or(0, <[CuratedTool]>::len),
tool_execution: catalog.is_some(),
user_profile: native_provider,
initial_sync: native_provider,
periodic_sync: sync_interval_secs.is_some(),
sync_interval_secs,
trigger_webhooks: native_provider,
memory_ingest: native_provider,
}
})
.collect()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Move capability-matrix implementation out of providers/mod.rs.

This block adds operational logic directly into mod.rs. Please move the matrix constants/helpers/builder into a sibling module (e.g., providers/capability_matrix.rs) and re-export only the public entrypoint from mod.rs.

Suggested module split
 // providers/mod.rs
+mod capability_matrix;
+pub use capability_matrix::capability_matrix;

-use crate::openhuman::composio::types::ComposioCapability;
-
-const CAPABILITY_TOOLKITS: &[&str] = &[ ... ];
-fn native_provider_sync_interval(toolkit: &str) -> Option<u64> { ... }
-fn has_native_provider(toolkit: &str) -> bool { ... }
-pub fn capability_matrix() -> Vec<ComposioCapability> { ... }

As per coding guidelines: src/openhuman/**/mod.rs: Keep domain mod.rs files light and export-focused. Put operational code in sibling files (ops.rs, store.rs, schedule.rs, types.rs, bus.rs).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/composio/providers/mod.rs` around lines 57 - 132, The file
currently implements the capability matrix and helpers (CAPABILITY_TOOLKITS,
native_provider_sync_interval, has_native_provider, and the capability_matrix()
builder that calls catalog_for_toolkit and toolkit_description) inside
providers/mod.rs; move all operational items (CAPABILITY_TOOLKITS,
native_provider_sync_interval, has_native_provider, and the capability_matrix
implementation) into a new sibling module providers/capability_matrix.rs, keep
only a pub use or a thin wrapper re-exporting the public entrypoint
capability_matrix from mod.rs, and update any local references so
catalog_for_toolkit, toolkit_description, and ComposioCapability remain
accessible to the moved code (either by importing them in the new module or
relocating any dependent helpers).

@senamakel
Copy link
Copy Markdown
Member

@coderabbitai can you tell me whats the benefit of this PR?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Tip

For best results, initiate chat on the files or code changes.

@senamakel Here's a breakdown of the key benefits this PR introduces:


🔍 What it does

This PR introduces a Composio capability matrix — a static, structured record of what each supported toolkit (e.g., Gmail, Notion, Slack, Google Calendar) can and cannot do within the OpenHuman integration layer.


✅ Benefits

  1. Pre-session discoverability
    The new composio.list_capabilities RPC can be called before a Composio session is established — meaning clients can discover available integration capabilities without needing an authenticated Composio backend connection. This is useful for onboarding flows, UI rendering, or capability gating before a user links their account.

  2. Unified capability reference
    Instead of scattering capability knowledge across multiple places, the matrix consolidates per-toolkit flags in one place:

    • Does the toolkit have a native provider (e.g., Gmail ✅, Google Calendar ❌)?
    • Does it support curated tools?
    • Does it support memory ingest?
    • Does it support triggers/webhooks?
    • What is the sync interval (if any)?
  3. Safer, read-only surface
    The change is entirely read-only — it does not touch auth, sync, execution, or trigger behavior. This minimizes risk while adding meaningful new functionality.

  4. Distinguishing native vs. catalog-only toolkits
    The matrix makes it explicit which toolkits have a first-class native provider (Gmail, Notion, Slack) versus those that are catalog-only (e.g., Google Calendar), allowing clients to make smarter decisions about integration depth.

  5. Schema-first design
    The capability data is exposed via a registered RPC schema (composio.list_capabilities), making it part of the formal, testable API surface — with tests covering the no-session path, schema shape, and toolkit differentiation.


In short, this PR enables clients to inspect integration capabilities programmatically and early, improving discoverability and enabling smarter UI/UX decisions without requiring a full authenticated Composio setup.

@senamakel senamakel merged commit 86b661d into tinyhumansai:main May 18, 2026
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants