Skip to content

feat(composio): add GitHub as a native memory provider#2488

Open
M3gA-Mind wants to merge 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:feat/composio-github-provider
Open

feat(composio): add GitHub as a native memory provider#2488
M3gA-Mind wants to merge 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:feat/composio-github-provider

Conversation

@M3gA-Mind
Copy link
Copy Markdown
Contributor

@M3gA-Mind M3gA-Mind commented May 22, 2026

Summary

  • Lifts the github/ Composio module from a catalog-only stub into a full ComposioProvider that incrementally ingests issues and pull requests involving the connected user into the Memory Tree.
  • Uses GITHUB_SEARCH_ISSUES with involves:{login} updated:>{cursor} for efficient incremental fetches (mirrors the involves: privacy posture: only items the user created, was assigned to, mentioned in, or commented on).
  • Follows the exact same layout as clickup/ and notion/: provider.rs, sync.rs, tests.rs, mod re-exports.
  • Registers GitHubProvider in init_default_providers alongside the existing four providers.
  • 38 unit tests covering all sync helpers and provider metadata.

Test plan

  • cargo check -p openhuman — clean
  • cargo fmt --all -- --check — clean
  • cargo test -p openhuman composio::providers::github — 38/38 pass
  • cargo test -p openhuman composio::providers::registry — registry tests pass (GitHub now included in all_providers())

Related

Closes #2408

Summary by CodeRabbit

  • New Features
    • Added GitHub provider for incremental syncing of authenticated user's issues and pull requests.
    • Implements cursor-based pagination to fetch only new and updated items since last sync.
    • Enforces daily request budgeting for efficient API consumption.

Review Change Stack

Lifts the GitHub module from catalog-only into a full ComposioProvider
that incrementally ingests issues and PRs the connected user is involved
with into the Memory Tree.

- provider.rs: ComposioProvider impl using GITHUB_SEARCH_ISSUES with
  `involves:{login}` + ISO 8601 cursor for incremental fetches
- sync.rs: extract_issues, extract_issue_id, extract_issue_title,
  extract_issue_updated_at, extract_user_login helpers; html_url-based
  slug fallback for composite doc IDs
- tests.rs: 38 unit tests covering all helpers + provider metadata
- mod.rs: upgraded from catalog-stub to full provider layout
- registry.rs: GitHubProvider registered in init_default_providers

Closes tinyhumansai#2408
@M3gA-Mind M3gA-Mind requested a review from a team May 22, 2026 12:04
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 75e1af1a-f69b-4aeb-b5a2-9af8a8cda7fe

📥 Commits

Reviewing files that changed from the base of the PR and between 733fcfe and 2bf90a3.

📒 Files selected for processing (5)
  • src/openhuman/composio/providers/github/mod.rs
  • src/openhuman/composio/providers/github/provider.rs
  • src/openhuman/composio/providers/github/sync.rs
  • src/openhuman/composio/providers/github/tests.rs
  • src/openhuman/composio/providers/registry.rs

📝 Walkthrough

Walkthrough

This PR promotes GitHub from a curated tools-only module to a fully native memory-ingest provider. It adds incremental sync of user-assigned issues into the Memory Tree via cursor-based pagination, daily request budgeting, and composite deduplication on issue identity and update timestamp.

Changes

GitHub Provider Implementation

Layer / File(s) Summary
Module structure and exports
src/openhuman/composio/providers/github/mod.rs
Module documentation and submodule wiring updated to declare provider, sync, and tests submodules; GitHubProvider re-exported alongside existing GITHUB_CURATED tools.
Provider type, constants, and user profile fetching
src/openhuman/composio/providers/github/provider.rs (lines 1–119)
GitHubProvider struct with new() and Default constructors; API action constants and pagination limits; fetch_user_profile() calls authenticated-user endpoint and extracts login, name, email, avatar, and profile URL.
Incremental sync and budget management
src/openhuman/composio/providers/github/provider.rs (lines 121–424)
sync() loads SyncState, enforces daily budget, resolves viewer login, builds cursor-aware search query assignee:<login> sort:updated-desc, paginates up to MAX_PAGES, deduplicates via composite issue_id@updated_at key, persists each item into Memory Tree, advances cursor to newest updated_at, and returns SyncOutcome; resolve_login() helper extracts authenticated user login from API response.
Envelope extraction and field parsing helpers
src/openhuman/composio/providers/github/sync.rs
extract_issues() walks multiple Composio envelope paths; extract_issue_id() prefers numeric id, falls back to parsing html_url; extract_issue_title() prefixes with GitHub: {owner}/{repo}#{number}:; extract_issue_updated_at() and extract_user_login() handle nested response structures; now_ms() provides UNIX epoch timestamp; inline unit tests validate all paths and fallback behavior.
Comprehensive extraction and provider tests
src/openhuman/composio/providers/github/tests.rs
Unit tests for envelope shapes, issue identity extraction with fallbacks, title formatting, timestamp extraction, login extraction, and provider metadata assertions (toolkit_slug, sync interval, curated tool presence).
Provider registration in global registry
src/openhuman/composio/providers/registry.rs (lines 80–85)
GitHubProvider::new() registered in init_default_providers() between ClickUp and Gmail, integrating GitHub into system startup.

Sequence Diagram

sequenceDiagram
  participant User as Connected User
  participant sync as GitHubProvider.sync()
  participant github as GitHub API
  participant dedup as Dedup & Persist
  participant memory as Memory Tree
  
  User->>sync: trigger periodic sync
  sync->>github: fetch authenticated user
  github-->>sync: user profile with login
  sync->>sync: check daily request budget
  sync->>github: search issues (assignee:login updated:>cursor)
  github-->>sync: paginated results
  loop for each issue
    sync->>dedup: extract id@updated_at key
    dedup->>dedup: check if already synced
    dedup->>memory: persist_single_item if new/modified
    memory-->>dedup: mark synced or log error
  end
  sync->>sync: advance cursor to newest updated_at
  sync->>memory: save SyncState (cursor, timestamp)
  sync-->>User: return SyncOutcome (counts, budget remaining)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #2408: Directly addresses the linked issue's objective to add GitHub as a native Composio memory provider; all acceptance criteria (sync registration, incremental cursor support, budget checks, dedup, unit test coverage) are implemented in this PR.
  • #2418: Both this PR and that issue modify the sync query construction in provider.rs; this PR introduces the initial sync query logic while that issue may refine or extend it.

Suggested labels

working

Poem

🐰 A rabbit's ode to GitHub sync
GitHub issues flow through memory swift,
Cursor-based pagination lifts,
Dedup keys keep the stream so clean,
Budget guards the daily scene,
Contributors dogfood the gift!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(composio): add GitHub as a native memory provider' accurately and concisely describes the main objective of the PR: promoting GitHub from a catalog-only module to a full native ComposioProvider for memory ingestion.
Linked Issues check ✅ Passed The PR implementation aligns with all key requirements from issue #2408: GitHubProvider registered in init_default_providers, sync model with cursor/budget/dedup implemented, assignee-scoped queries, helper functions for extraction, unit tests (38 tests), and updated module documentation.
Out of Scope Changes check ✅ Passed All changes directly support the GitHub provider promotion objective. Modifications are limited to: github module files (provider.rs, sync.rs, tests.rs, mod.rs updates), registry.rs registration, and no unrelated refactoring or feature creep detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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 22, 2026
@M3gA-Mind
Copy link
Copy Markdown
Contributor Author

CI note: the single failing check () is panicking with cargo build --bin openhuman-core failed. This test builds the core binary in-process during the CI run — the failure is an infrastructure/resource issue in the runner (sccache, OOM, etc.) and is completely unrelated to the GitHub provider changes in this PR. All 8570 other tests pass. Requesting re-run.

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.

Add GitHub as a Composio memory provider (joining gmail / notion / slack / clickup / linear)

1 participant