Repository navigation
Let the chat answer questions about GitHub repos that aren't cloned - #44
Merged
Merged
Conversation
Picking a GitHub-only repo in a new searchable picker in the chat panel fetches a snapshot from GitHub (repo details, language breakdown, top-level files, README), stores it in a new github_repo_snapshots table, and feeds it to the model as the current repository. Snapshots refresh after 24h (GITLIB_SNAPSHOT_REFRESH_HOURS) or on demand; if GitHub can't be reached the chat falls back to the stored snapshot or listing data and says so. - core: RemoteRepoContext prompt blocks, capped <remote_library> list, and neutralization of GitHub-sourced text - web: `remote` field on /api/chat (owner/repo, exclusive with `repo`), validated against the account's listing; syncRemoteRepo server function - tests for prompt building, protocol, snapshot parsing and fetching, and the chat route Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Ask panel could only talk about repos cloned under
~/git, so a question like "What can you tell me about the repo composition?" about a GitHub-only repo got "I don't see that repo." This adds a repository picker to the panel and gives the model a stored GitHub snapshot for repos that aren't cloned.github_repo_snapshotstable (keyed by lowercasedowner/repo, like the community profiles). A snapshot is 4 GitHub calls: repo details, languages, top-level files, README. It is fetched on demand when you pick the repo or ask about it, reused for 24h (GITLIB_SNAPSHOT_REFRESH_HOURS, 0 = only on Refresh), and shared between concurrent askers. If GitHub can't be reached, the chat falls back to the stored snapshot, or to listing data only, and the prompt says why.<current_repository>(with<repository_files>and<repository_readme>), with language percentages computed on the server and the snapshot time stated. A small capped<remote_library>section lists GitHub-only repos for library-wide questions. All GitHub-sourced text goes through the existingneutralizeso it can't close a block./api/chattakes an optionalremote(owner/repo), mutually exclusive withrepo. The server only accepts repos the GitHub account lists, never an arbitrary slug.handleChattakes the remote source as an injected argument, so tests and non-GitHub setups are unaffected.Cloned repos are unchanged: they still use scanner data, notes and the README on disk.
For reviewers
<current_repository>tag rather than a new one, so "this repo" means the same thing for cloned and GitHub-only repos.GITLIB_GITHUB_TOKEN, GitHub allows 60 calls/hour (shared with the Issues/PRs tabs) and private repos won't work. Each snapshot costs 4 calls.owner/repopattern accepted../etc; it now follows GitHub's naming rules.Testing
npm run typecheckandnpx vitest run: 22 files, 550 tests pass. New coverage: prompt blocks (budgets, fallbacks, injection), protocol validation, snapshot parsing, and an end-to-end flow against a fake GitHub (fetch once, staleness, forced refresh, concurrent askers, no README, rate-limit fallback, unlisted repo refused).Rust 90.0%, Shell 10.0%, file list, README). No real GitHub request or real model was used.🤖 Generated with Claude Code