Skip to content

Fix: GitHub composeio#543

Merged
Al629176 merged 4 commits into
tinyhumansai:mainfrom
YellowSnnowmann:fix/github-composeio
Apr 14, 2026
Merged

Fix: GitHub composeio#543
Al629176 merged 4 commits into
tinyhumansai:mainfrom
YellowSnnowmann:fix/github-composeio

Conversation

@YellowSnnowmann
Copy link
Copy Markdown
Contributor

@YellowSnnowmann YellowSnnowmann commented Apr 13, 2026

Summary

  • Added new Composio controllers and RPC methods to support GitHub repo discovery and trigger creation: openhuman.composio_list_github_repos and openhuman.composio_create_trigger.
  • Extended Composio backend client/core types to model GitHub repositories and created-trigger responses.
  • Updated the Composio connect modal so GitHub connections can load repositories, select a repo, and enable PR/push triggers directly from the UI.
  • Added stronger socket logging for incoming composio:trigger events (toolkit, trigger, metadata ids) to improve end-to-end debugging.

Problem

  • GitHub users could connect Composio, but they had no first-class path in the app to enumerate repos and create trigger subscriptions from the same flow.
  • Trigger setup required manual backend/API interaction, which made onboarding and validation of GitHub automations harder.

Solution

  • Implemented typed core support for:
    • listing GitHub repositories on a connected Composio account
    • creating Composio triggers with optional connection_id and trigger_config
  • Registered both operations in Composio schemas and controller registry so they are accessible via JSON-RPC.
  • Exposed new API helpers in the frontend Composio client.
  • Enhanced ComposioConnectModal for GitHub toolkits:
    • fetch repositories after successful connection
    • allow repo selection
    • enable GITHUB_PULL_REQUEST_EVENT and GITHUB_PUSH_EVENT with inline success/error UX
  • Added additional structured socket log context when publishing composio:trigger events.

Submission Checklist

  • Unit tests — Vitest (app/) and/or cargo test (core) for logic you add or change
  • E2E / integration — Where behavior is user-visible or crosses UI → Tauri → sidecar → JSON-RPC; use existing harnesses (app/test/e2e, mock backend, tests/json_rpc_e2e.rs as appropriate)
  • N/A — Not a docs-only change; tests are still recommended before merge
  • Doc comments — Added/updated Rust doc comments for new Composio API types and schema surfaces
  • Inline comments — Existing/new comments retained around non-obvious flow and payload mapping

(Any feature related checklist can go in here)

Impact

  • Runtime/platform: Desktop app + core sidecar Composio integration path.
  • Compatibility: Backward compatible; introduces additive RPC methods and UI capabilities.
  • Observability: Improved trigger-event logging in socket event handling.
  • Risk: UI behavior for GitHub connection flows changed; should be validated with live or mocked Composio responses.

Related

Summary by CodeRabbit

  • New Features
    • GitHub trigger management now available for connected GitHub accounts, enabling users to select repositories and enable push and pull request triggers.
    • Real-time status feedback for trigger configuration actions with error handling.
    • Automatic repository list loading on initial connection for streamlined setup.

- Enhanced the ComposioConnectModal component to support loading and selecting GitHub repositories for connected users.
- Introduced new API functions for listing GitHub repositories and creating triggers, improving integration capabilities with GitHub.
- Added state management for repository loading, selection, and trigger action feedback, enhancing user experience during GitHub integration.
- Updated types to include GitHub repository structures and responses, ensuring type safety and clarity in the codebase.
- Implemented new API endpoints for listing GitHub repositories and creating triggers, enhancing integration capabilities with GitHub.
- Updated types to include responses for GitHub repositories and trigger creation, ensuring type safety and clarity.
- Added corresponding handler functions and schemas to support the new operations, improving overall functionality and user experience in the Composio integration.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

The PR adds GitHub-specific trigger management capabilities to the Composio integration. It introduces UI and state management in the ComposioConnectModal component for repository selection and trigger enablement, adds frontend API wrappers for listing GitHub repositories and creating triggers, and implements corresponding backend HTTP client methods, RPC operations, and controller schemas to expose this functionality.

Changes

Cohort / File(s) Summary
Frontend UI Component
app/src/components/composio/ComposioConnectModal.tsx
Expanded modal to support GitHub-specific trigger management in the connected phase, adding state for repository loading, selection, and trigger enablement. Implements loadGithubRepos() to fetch and cache repositories, auto-loads on phase transition, and enableGithubTrigger() to create triggers with error/success feedback and request de-duplication.
Frontend API & Types
app/src/lib/composio/composioApi.ts, app/src/lib/composio/types.ts
Added listGithubRepos() and createTrigger() RPC wrapper functions alongside new TypeScript interfaces (ComposioGithubRepo, ComposioGithubReposResponse, ComposioCreateTriggerResponse) for type-safe API communication.
Backend Client Implementation
src/openhuman/composio/client.rs
Added list_github_repos() and create_trigger() methods to the Composio HTTP client, handling optional connection and trigger config parameters with proper URL/JSON construction.
Backend RPC Operations & Schema
src/openhuman/composio/ops.rs, src/openhuman/composio/schemas.rs
Introduced composio_list_github_repos() and composio_create_trigger() RPC operation handlers with corresponding controller schema definitions and handlers for input validation and parameter deserialization.
Backend Type Models
src/openhuman/composio/types.rs
Added Rust domain types (ComposioGithubRepo, ComposioGithubReposResponse, ComposioCreateTriggerResponse) with Serde mappings for camelCase JSON field conversions and optional field handling.
Observability
src/openhuman/socket/event_handlers.rs
Enhanced composio trigger event handler with additional informational logging including toolkit, trigger slug, and event metadata identifiers.

Sequence Diagram

sequenceDiagram
    participant User as User
    participant UI as ComposioConnectModal
    participant API as Frontend API
    participant RPC as RPC Server
    participant Client as Composio Client
    
    rect rgba(100, 150, 200, 0.5)
    Note over User,Client: GitHub Repository Loading
    User->>UI: Modal enters connected phase
    UI->>API: loadGithubRepos(connectionId)
    API->>RPC: composio_list_github_repos
    RPC->>Client: list_github_repos()
    Client-->>RPC: ComposioGithubReposResponse
    RPC-->>API: repos with count
    API-->>UI: populate githubRepos state
    UI->>User: display repo selection dropdown
    end
    
    rect rgba(150, 100, 200, 0.5)
    Note over User,Client: GitHub Trigger Enablement
    User->>UI: click "Enable Push Trigger"
    UI->>API: createTrigger(slug, selectedRepo)
    API->>RPC: composio_create_trigger
    RPC->>Client: create_trigger(slug, triggerConfig)
    Client-->>RPC: ComposioCreateTriggerResponse
    RPC-->>API: triggerId + status
    API-->>UI: update success state
    UI->>User: display success message
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hippity-hop! GitHub triggers now gleam,
Repository selection—a developer's dream,
Connected states with endpoints so clean,
Frontend to backend, a seamless scene,
Composio magic makes features lean! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.63% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix: GitHub composeio' is vague and generic, using a typo ('composeio' instead of 'composio') and lacking specificity about what is being fixed or added. Use a more descriptive title that clearly conveys the main change, such as 'Add GitHub repository discovery and trigger management to Composio integration' or 'Support GitHub trigger enablement in Composio connections'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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.

🧹 Nitpick comments (2)
app/src/components/composio/ComposioConnectModal.tsx (1)

229-242: Consider guarding against persistent errors to avoid retry loops.

The effect guard at line 233 only checks githubRepos.length > 0 || githubReposLoading. If loadGithubRepos fails with an error, the guard will pass again on the next render, potentially causing repeated failed API calls.

♻️ Suggested fix: include error state in guard
   useEffect(() => {
     if (phase !== 'connected') return;
     if (toolkit.slug.toLowerCase() !== 'github') return;
     if (!activeConnection) return;
-    if (githubRepos.length > 0 || githubReposLoading) return;
+    if (githubRepos.length > 0 || githubReposLoading || githubRepoError) return;
     void loadGithubRepos();
   }, [
     phase,
     toolkit.slug,
     activeConnection,
     githubRepos.length,
     githubReposLoading,
+    githubRepoError,
     loadGithubRepos,
   ]);

This prevents retry loops on persistent errors. Users can still manually reload via the "Reload repositories" button.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/components/composio/ComposioConnectModal.tsx` around lines 229 - 242,
The effect that auto-loads GitHub repos (useEffect watching phase, toolkit.slug,
activeConnection, githubRepos.length, githubReposLoading, loadGithubRepos) can
re-trigger loadGithubRepos on every render after a failed fetch; update the
guard to also check the repository error state (e.g., githubReposError or
similar) and return early if an error exists, and add that error state to the
dependency array so the effect won't loop on persistent failures; keep the
existing manual "Reload repositories" button for retries.
src/openhuman/socket/event_handlers.rs (1)

130-136: Minor: Duplicate log statements.

There are now two log::info! statements for the same event: one at line 120 and this more detailed one at lines 130-136. Consider removing the generic log at line 120 or consolidating them to avoid redundant output.

♻️ Suggested consolidation
         "composio:trigger" => {
-            log::info!("[socket] Publishing composio:trigger to event bus");
             match serde_json::from_value::<crate::openhuman::composio::ComposioTriggerEvent>(
                 data.clone(),
             ) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openhuman/socket/event_handlers.rs` around lines 130 - 136, There are
duplicate log::info! calls emitting the same composio:trigger event; remove the
earlier generic log or consolidate them into a single detailed log that uses
event.toolkit, event.trigger, event.metadata.id and event.metadata.uuid (the
detailed log currently shown) so only one info-level message is produced in the
event handler in src/openhuman/socket/event_handlers.rs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/src/components/composio/ComposioConnectModal.tsx`:
- Around line 229-242: The effect that auto-loads GitHub repos (useEffect
watching phase, toolkit.slug, activeConnection, githubRepos.length,
githubReposLoading, loadGithubRepos) can re-trigger loadGithubRepos on every
render after a failed fetch; update the guard to also check the repository error
state (e.g., githubReposError or similar) and return early if an error exists,
and add that error state to the dependency array so the effect won't loop on
persistent failures; keep the existing manual "Reload repositories" button for
retries.

In `@src/openhuman/socket/event_handlers.rs`:
- Around line 130-136: There are duplicate log::info! calls emitting the same
composio:trigger event; remove the earlier generic log or consolidate them into
a single detailed log that uses event.toolkit, event.trigger, event.metadata.id
and event.metadata.uuid (the detailed log currently shown) so only one
info-level message is produced in the event handler in
src/openhuman/socket/event_handlers.rs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 495ada3b-ef0e-4d62-8502-fac5341aeba2

📥 Commits

Reviewing files that changed from the base of the PR and between 57a8bed and 1a7a052.

📒 Files selected for processing (8)
  • app/src/components/composio/ComposioConnectModal.tsx
  • app/src/lib/composio/composioApi.ts
  • app/src/lib/composio/types.ts
  • src/openhuman/composio/client.rs
  • src/openhuman/composio/ops.rs
  • src/openhuman/composio/schemas.rs
  • src/openhuman/composio/types.rs
  • src/openhuman/socket/event_handlers.rs

@senamakel
Copy link
Copy Markdown
Member

creating of composio triggers should happen at the backend level.. not at the frontend. @YellowSnnowmann

…rom ComposioConnectModal

- Eliminated GitHub repository loading and trigger creation logic from the ComposioConnectModal component, streamlining its functionality.
- Removed associated state management and API calls for GitHub repositories and triggers, enhancing code clarity and maintainability.
- Updated types to reflect the removal of GitHub-related structures, ensuring consistency across the codebase.
@Al629176 Al629176 merged commit 219a2ff into tinyhumansai:main Apr 14, 2026
8 checks passed
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
* feat(composio): add GitHub repository management and trigger creation

- Enhanced the ComposioConnectModal component to support loading and selecting GitHub repositories for connected users.
- Introduced new API functions for listing GitHub repositories and creating triggers, improving integration capabilities with GitHub.
- Added state management for repository loading, selection, and trigger action feedback, enhancing user experience during GitHub integration.
- Updated types to include GitHub repository structures and responses, ensuring type safety and clarity in the codebase.

* feat(composio): add GitHub repository listing and trigger creation APIs

- Implemented new API endpoints for listing GitHub repositories and creating triggers, enhancing integration capabilities with GitHub.
- Updated types to include responses for GitHub repositories and trigger creation, ensuring type safety and clarity.
- Added corresponding handler functions and schemas to support the new operations, improving overall functionality and user experience in the Composio integration.

* refactor(composio): remove GitHub repository and trigger management from ComposioConnectModal

- Eliminated GitHub repository loading and trigger creation logic from the ComposioConnectModal component, streamlining its functionality.
- Removed associated state management and API calls for GitHub repositories and triggers, enhancing code clarity and maintainability.
- Updated types to reflect the removal of GitHub-related structures, ensuring consistency across the codebase.

* format: ran format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants