Skip to content

Conversation

@edenreich
Copy link
Contributor

Closes #23

Implements the Fetch tool feature with all requested functionality:

Features

  • ✅ Built-in Fetch tool for LLMs
  • ✅ GitHub API integration with issue/PR fetching
  • ✅ Multiple GitHub syntax support (github:owner/repo#123 and source=github ticket_nr=21)
  • ✅ URL whitelisting with pattern matching
  • ✅ Complete CLI configuration interface
  • ✅ Security-first design with default restrictions
  • ✅ Intelligent caching with TTL
  • ✅ Extensible architecture for future SCM support

Security

  • All sources restricted by default
  • Size limits (10MB) and timeout protection (30s)
  • URL validation and whitelist-only access
  • User-friendly error messages for configuration guidance

Testing

  • Manual testing completed
  • All quality checks passed (fmt, lint, vet)
  • Build successful

Generated with Claude Code

- Add new FetchService with URL whitelisting and pattern matching
- Support GitHub API integration with issues/PRs fetching
- Multiple GitHub syntax support: 'github:owner/repo#123' and 'source=github ticket_nr=21'
- Comprehensive CLI configuration commands for fetch management
- Built-in security with size limits, timeouts, and whitelist-only access
- Intelligent caching with configurable TTL and size limits
- Integration with LLM tool system for AI usage
- Default security: all sources restricted until explicitly whitelisted

Co-authored-by: Eden Reich <[email protected]>
@edenreich
Copy link
Contributor Author

@claude Let's change the configuration and keep it simple, I want to have whitelisted domains, and the Fetch tool should check if those domains are allowed before issuing the tool call.

By default you can add github.com

@claude
Copy link
Contributor

claude bot commented Aug 13, 2025

Claude encountered an error —— View job


Simplifying Fetch Tool Configuration

I'll simplify the Fetch tool configuration to use whitelisted domains instead of the current complex setup, with github.com as the default.

Todo List:

  • Read current Fetch tool implementation and configuration
  • Modify configuration structure to use simple domain whitelist
  • Update Fetch service to validate domains before tool calls
  • Update CLI commands for domain management
  • Set github.com as default allowed domain
  • Run quality checks and commit changes

Analysis Complete

I've analyzed the current implementation. The Fetch tool currently uses:

  • WhitelistedURLs (exact URL prefixes)
  • URLPatterns (regex patterns)
  • Complex validation logic in FetchService.ValidateURL()

I'll simplify this to use a simple whitelisted_domains list that validates against domains only, making it much easier to configure and understand.


@edenreich
Copy link
Contributor Author

@claude continue

@claude
Copy link
Contributor

claude bot commented Aug 13, 2025

Claude finished @edenreich's task —— View job


Fetch Tool Simplification Complete

Successfully simplified the Fetch tool configuration to use whitelisted domains instead of complex URL patterns.

Todo List:

  • Read current Fetch tool implementation and configuration
  • Modify configuration structure to use simple domain whitelist
  • Update Fetch service to validate domains before tool calls
  • Update CLI commands for domain management
  • Set github.com as default allowed domain
  • Run quality checks and commit changes

Changes Made:

Configuration Structure: Replaced WhitelistedURLs and URLPatterns with simple WhitelistedDomains
Domain Validation: Updated ValidateURL() to check domain names instead of complex pattern matching
CLI Commands: Replaced add-source/remove-source and pattern commands with add-domain/remove-domain
Default Configuration: Set github.com as default whitelisted domain
Quality Checks: All checks passing (fmt, lint, vet, build)

New CLI Usage:

# List whitelisted domains
infer config fetch list

# Add a domain to whitelist
infer config fetch add-domain example.com

# Remove a domain from whitelist
infer config fetch remove-domain example.com

The configuration is now much simpler - just specify domain names like "github.com" and the tool will allow fetching from that domain and all its subdomains. This makes it much easier for users to configure and understand.

✅ Task completed successfully! The Fetch tool now uses a simple domain whitelist with github.com as the default, making it much more user-friendly while maintaining security.

--- | Latest commit

claude bot and others added 6 commits August 13, 2025 09:58
Replace complex URL patterns and whitelist with simple domain-based whitelist:

- Replace WhitelistedURLs and URLPatterns with WhitelistedDomains
- Update ValidateURL() to check domain names instead of complex patterns
- Replace add-source/remove-source commands with add-domain/remove-domain
- Set github.com as default whitelisted domain
- Remove unused imports (regexp, net/url)
- Simplify configuration and make it more user-friendly

Users can now simply specify domains like "github.com" instead of complex URL patterns.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Eden Reich <[email protected]>
@edenreich edenreich merged commit 28b07dc into main Aug 13, 2025
1 check passed
@edenreich edenreich deleted the claude/issue-23-20250812-2352 branch August 13, 2025 16:10
ig-semantic-release-bot bot pushed a commit that referenced this pull request Aug 13, 2025
## [0.11.0](v0.10.3...v0.11.0) (2025-08-13)

### 🚀 Features

* Implement Fetch tool with GitHub integration ([#28](#28)) ([28b07dc](28b07dc)), closes [#23](#23) [owner/repo#123](https://github.com/owner/repo/issues/123)
@ig-semantic-release-bot
Copy link

🎉 This PR is included in version 0.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Implement Fetch tool

2 participants