Agent Tools
The GitHub agent provides 6 tools for searching and navigating code:
Code Search & Reading (Sourcebot)
Section titled “Code Search & Reading (Sourcebot)”| Tool | Description | Key Parameters |
|---|---|---|
searchCode | Regex-based code search across indexed repositories. Supports Zoekt file: and -file: syntax for path filtering. | query, repo_filter, language_filter, file_filter, file_exclude, limit |
readFiles | Read full file contents with line numbers from indexed repositories. | paths, repository |
findSymbolDefinitions | Find where a symbol (function, class, variable) is defined using language-specific patterns. | symbol, language, repository |
findSymbolReferences | Find all references to a symbol across the codebase using word-boundary matching. | symbol, language, repository |
Repository Discovery (Sourcebot)
Section titled “Repository Discovery (Sourcebot)”| Tool | Description | Key Parameters |
|---|---|---|
searchRepos | Fuzzy search for repository names. | query, limit |
listAllRepos | List all indexed repositories. | None |
Manual Override
Section titled “Manual Override”Prefix your query with /github to route directly to the GitHub agent, bypassing the workflow classification:
/github Where is the authentication middleware defined?Agentic Loop with Step Limiting
Section titled “Agentic Loop with Step Limiting”The GitHub agent operates as an autonomous agentic loop with built-in limits to prevent infinite tool calls:
| Setting | Default | Description |
|---|---|---|
github_max_steps | 12 | Maximum tool calls per agent invocation |
github_warning_step_ratio | 0.8 | Warn the agent when 80% of steps are used |
github_temperature | 0.3 | LLM temperature for focused, deterministic responses |
github_timeout_seconds | 60 | Per-API-call timeout; overall agent execution timeout is 120s |
Citation System
Section titled “Citation System”The agent uses inline citations in the format @file:{repo::path:startLine-endLine}. These are automatically converted to clickable GitHub URLs in a Sources section appended to every response:
Sources:- https://github.com/org/repo/blob/HEAD/src/auth/middleware.py#L42-L58- https://github.com/org/repo/blob/HEAD/src/utils/helpers.py#L10-L25Organization Scoping
Section titled “Organization Scoping”All searches are automatically scoped to the configured github_org. Repo-level exclusions are applied both in search queries and as post-fetch filters.
Rate Limiting
Section titled “Rate Limiting”The integration uses three layers of rate limit protection:
| Layer | Behavior |
|---|---|
| Proactive throttling | Tracks GitHub API x-ratelimit-remaining headers. Starts throttling when remaining requests fall below the buffer threshold (default: 100). Enforces minimum delay between search requests (default: 2 seconds). |
| Reactive backoff | On 429 or rate-limit 403 responses, applies exponential backoff with jitter (base 2s, max 60s). Respects Retry-After header. Up to 3 retry attempts. |
| Graceful degradation | If rate limits are exhausted, search tools return empty results instead of failing. The agent reports the limitation to the user. |
Configurable Limits
Section titled “Configurable Limits”All rate limit settings are configurable via the Admin UI and support hot-reload:
| Setting | Default | Range | Description |
|---|---|---|---|
github_default_max_results | 20 | 1–100 | Default max results per search |
github_max_search_concurrent | 2 | 1–10 | Max concurrent search API requests |
github_search_min_delay | 2.0s | 0–10s | Min delay between search requests |
github_max_retries | 3 | 0–10 | Retry attempts on rate limit errors |
github_retry_base_delay | 2.0s | 0–10s | Exponential backoff base |
github_retry_max_delay | 60s | 10–300s | Maximum retry delay |
github_core_buffer_threshold | 100 | 10–1000 | Throttle when remaining requests below this |
github_search_cache_ttl | 60s | 0–3600s | Search result cache duration |
API Endpoints
Section titled “API Endpoints”| Endpoint | Method | Description |
|---|---|---|
GET /api/connectors/github | GET | Get GitHub connector status and configuration |
PATCH /api/connectors/github | PATCH | Enable/disable the GitHub connector (hot-reload) |
GET /health | GET | System health check including GitHub connectivity |