fix(composio): fail fast for uncurated empty toolkits#2293
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds toolkit slug normalization and uncatalogued-toolkit detection to composio_list_tools; when filtering yields no tools, the code returns a targeted error explaining which requested toolkits lack curated agent tool catalogs. Includes unit tests and a test-only provider validating the behavior. ChangesToolkit scope filtering and uncatalogued error handling
🎯 3 (Moderate) | ⏱️ ~20 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. 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/tools.rs (1)
807-810: ⚡ Quick winUse
debug!/trace!for this diagnostic branch log.Line 807 currently emits
info!for an internal state-transition diagnostic. This should bedebug!(ortrace!) to match repository logging policy and keep info-level logs focused.Proposed fix
- tracing::info!( + tracing::debug!( toolkits = ?scoped_toolkits, "[composio] list_tools empty for uncurated toolkit scope" );As per coding guidelines: "Use
log/tracingatdebugortracelevel on RPC entry and exit, error paths, state transitions, and any branch that is hard to infer from tests alone."🤖 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/tools.rs` around lines 807 - 810, Replace the info-level diagnostic in tools.rs with a debug (or trace) level log: locate the tracing::info! call that logs " [composio] list_tools empty for uncurated toolkit scope" with the scoped_toolkits field and change it to tracing::debug! (or tracing::trace!) so the state-transition diagnostic follows the repository logging policy and keeps info-level logs reserved for higher-severity messages.
🤖 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/tools.rs`:
- Around line 152-157: The uncatalogued_toolkits function currently only checks
catalog_for_toolkit(toolkit) and therefore can misclassify toolkits that are
available via a provider's curated_tools; update uncatalogued_toolkits to mirror
the actual visibility resolution used elsewhere by treating a toolkit as
catalogued if get_provider(toolkit).curated_tools() yields Some(_) or if
catalog_for_toolkit(toolkit) yields Some(_). In other words, for each toolkit
string call get_provider(toolkit).curated_tools().or_else(||
catalog_for_toolkit(toolkit)) and treat it as catalogued when that combined
result is Some(...); only include the toolkit in the returned Vec when that
combined check is None.
---
Nitpick comments:
In `@src/openhuman/composio/tools.rs`:
- Around line 807-810: Replace the info-level diagnostic in tools.rs with a
debug (or trace) level log: locate the tracing::info! call that logs "
[composio] list_tools empty for uncurated toolkit scope" with the
scoped_toolkits field and change it to tracing::debug! (or tracing::trace!) so
the state-transition diagnostic follows the repository logging policy and keeps
info-level logs reserved for higher-severity messages.
🪄 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: 7f1b65f0-41d2-4ffb-bb88-3a5e85384795
📒 Files selected for processing (2)
src/openhuman/composio/tools.rssrc/openhuman/composio/tools_tests.rs
d299c8a to
c49f9f2
Compare
c49f9f2 to
80f4980
Compare
|
huge thanks @aqilaziz, this fast-fail for uncurated toolkits is such a clean fix 🙌 way better than getting a silent empty tools response for stuff like onedrive or todoist. really appreciate you jumping back in on this one ✨ |
Summary
composio_list_toolsends up empty for requested or connected toolkits that do not have curated OpenHuman agent catalogs.toolsresponse for uncurated scopes such as OneDrive, Excel, or Todoist.Problem
composio_list_toolsfor those toolkits, it can receive an empty usable tool list and continue trying until max iterations.Solution
toolkitsfilter, or the active connected toolkits when filtering to connected accounts.toolslist is empty and the scoped toolkit set includes uncatalogued toolkits, return aToolResult::errorwith a concrete agent-ready support message.Submission Checklist
## Related— N/A: no matrix feature ID changed.docs/RELEASE-MANUAL-SMOKE.md) — N/A: no release smoke checklist surface changed.Closes #NNNin the## Relatedsection — N/A: partial fix for Uncurated connected toolkits fail through max iterations #2283; catalog/UI work remains.Impact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
codex/2283-uncurated-toolkit-fast-faild299c8ae92c690b911647f22746372572f17ff60Validation Run
pnpm --filter openhuman-app format:check— N/A: no frontend changes.pnpm typecheck— N/A: no TypeScript changes.cargo fmt --checkpassed.Validation Blocked
command:cargo test --lib empty_uncurated_toolkits_message --manifest-path Cargo.tomlerror:whisper-rs-sysbuild script could not findclang.dll/libclang.dll;LIBCLANG_PATHis unset in this Windows environment.impact:focused Rust tests could not run locally, but the helper tests are included for CI.Behavior Changes
composio_list_toolsresults for uncatalogued requested/connected toolkits now fail fast with a useful message.Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit
Bug Fixes
Tests