Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub devs tools #315

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

marc-aurele-besner
Copy link
Member

Add GitHub devs tools

  • List currently connected user repositories
  • List specific user repositories
  • List specific organization repositories
  • List forked repositories
  • Create a fork from the repository
  • Get the default GitHub repository branch
  • Create a new branch from another branch
  • Create commit GitHub tool
  • Create pull request GitHub tool

@jfrank-summit
Copy link
Member

What are we waiting on to for this PR? Looks awesome!

@marc-aurele-besner marc-aurele-besner marked this pull request as ready for review March 12, 2025 13:55
@marc-aurele-besner
Copy link
Member Author

What are we waiting on to for this PR? Looks awesome!

Testing I guess, I haven't really tested these tools yet 😓

But I guess
1-no-option-25b3e991dae257904057799db9410a1b

Copy link
Member

@Xm0onh Xm0onh left a comment

Choose a reason for hiding this comment

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

Awesome!
Just a small suggestion:

Copy link
Member

@jfrank-summit jfrank-summit left a comment

Choose a reason for hiding this comment

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

It would be worth wrapping these in a GitHub agent, the tool list is getting quite long!

Copy link
Member

@jfrank-summit jfrank-summit left a comment

Choose a reason for hiding this comment

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

I think this is great! As discussed earlier, there are a lot of tools here and many of them won't be used by some agents. It would be great if we could group this tools into common use cases (they kind of are now) or scopes and all the creator of a GitHub agent to select the necessary groups for their agent.

@chadlegrand
Copy link

Thank you for adding these GitHub developer tools! I've reviewed the changes and have some suggestions to enhance the implementation:

  1. Error Handling Pattern
    I agree with @Xm0onh and @jfrank-summit about returning errors instead of throwing them. The suggested pattern with {success, error} object is more agent-friendly and consistent with best practices in async operations. This would make error handling more predictable across the codebase.

  2. Model Configuration
    Regarding the Claude model selection, switching to Claude-3-5 as default is a good suggestion. Consider implementing this as a configurable option:

const defaultModelConfig: LLMConfiguration = {
  provider: 'anthropic',
  model: process.env.CLAUDE_MODEL || 'claude-3-5-sonnet-latest'
}
  1. Tool Organization
    The activity tools should be included in createGitHubTools() as mentioned. Consider grouping related tools into categories for better organization:
return {
  repos: { list, create, delete, ... },
  activity: { watch, unwatch, ... },
  issues: { create, comment, ... }
}
  1. Type Safety
  • Consider adding more specific TypeScript types for the GitHub API responses
  • Use zod schemas for runtime validation of API responses
  • Add type guards where necessary
  1. Testing
    Since testing is pending:
  • Add unit tests for the new tools using mock responses
  • Include integration tests with GitHub's API sandbox environment
  • Add test coverage for error scenarios

These changes would improve code maintainability, type safety, and reliability while following Web3 development best practices.

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.

4 participants