Skip to main content

Module github_search

Module github_search 

Source
Expand description

The github_search tool — live GitHub code/issue search.

Where KnowledgeSearchTool searches the indexed snapshot a GithubConnector ingested, github_search hits the live GitHub search API so the agent can find code or issues that landed after the last ingest — fresh lookups beyond the indexed corpus.

§Shape

Arguments: { "query": string, "kind"?: "code" | "issues" }. The tool runs the query through a pluggable GithubSearchBackend (default: OctocrabGithubSearch, the real GitHub API) and renders the top results (title, URL, snippet).

§Scope + auth

The tool is constructed with a GithubAuth and a default owner/repo scope; the scope is folded into the search query (repo:owner/name) so the agent’s lookups stay within the team’s repos by default.

§Test split (G9)

The live network is behind the OctocrabGithubSearch backend, exercised only by an #[ignore] + env-gated (SMOOTH_AGENT_E2E=1) test. The tool’s arg-parsing and result-formatting are unit-tested offline against a stub backend, exactly like the web_search tool.

Structs§

GithubSearchResult
A single GitHub search hit.
GithubSearchTool
A Tool that runs a live GitHub search through a GithubSearchBackend, scoped to a default owner/repo.
OctocrabGithubSearch
The real backend: live GitHub search via octocrab.

Enums§

GithubAuth
How the github_search tool authenticates to the GitHub API.
GithubSearchKind
Which GitHub search index to query.

Traits§

GithubSearchBackend
A pluggable GitHub-search backend.