feat(composio): expose capability matrix#2002
Conversation
📝 WalkthroughWalkthroughThis PR adds a new ChangesComposio Capability Matrix RPC Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/openhuman/composio/ops.rs (1)
200-212: ⚡ Quick winAdd 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: Uselog/tracingatdebugortracelevel 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
📒 Files selected for processing (7)
src/openhuman/composio/mod.rssrc/openhuman/composio/ops.rssrc/openhuman/composio/ops_test.rssrc/openhuman/composio/providers/mod.rssrc/openhuman/composio/schemas.rssrc/openhuman/composio/schemas_tests.rssrc/openhuman/composio/types.rs
| 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() | ||
| } |
There was a problem hiding this comment.
🛠️ 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).
|
@coderabbitai can you tell me whats the benefit of this PR? |
|
Tip For best results, initiate chat on the files or code changes.
🔍 What it doesThis 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
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. |
Summary
composio.list_capabilitiesRPC/schema so clients can inspect supported integration capabilities without an authenticated Composio backend session.Test Plan
RUSTC=$(rustup which --toolchain 1.93.0 rustc) GGML_NATIVE=OFF rustup run 1.93.0 cargo fmt --allRUSTC=$(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 --libRUSTC=$(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 --libRUSTC=$(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 --libRUSTC=$(rustup which --toolchain 1.93.0 rustc) GGML_NATIVE=OFF rustup run 1.93.0 cargo check --manifest-path Cargo.tomlNotes
Summary by CodeRabbit
New Features
composio.list_capabilitiesRPC endpoint that retrieves a complete capability matrix for all supported toolkits, including information about sync intervals, native provider support, and feature availability.Tests