Repository navigation
feat: attach repositories to messages and clone them into .context - #89
Merged
Merged
Conversation
Picking a repository from the composer's attach menu (or the command palette) adds a `repository` chip. On send, the server clones anything missing into the workspace's `.context/` folder before the agent starts, like ctxclone: a new worktree gets it as a setup-card step before the setup script, other sends clone before the turn is recorded. Existing clones of the same remote are left alone and only fetched; folders that belong to something else are never overwritten; failures warn and the agent still starts. Each record's outcome and git status are written back onto the message, so the chip and the agent's prompt both say what happened. The picker lists the default owner's GitHub repositories (`gh repo list`), ranks recent picks first, accepts `org/` and pasted URLs, and marks repositories already in the workspace with their branch and ahead/behind. Default owner and folder are server settings under Settings > General. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-ups A send into an existing workspace has no setup card, so the clone now records a work log row (one per message, upserted) that reports progress and each repository's outcome before the turn starts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Starting a thread that needs other repositories as context meant clicking Create worktree first, then running
ctxclonein that worktree's.context/by hand before writing the first message.Now you can attach repositories to a message. T3 Code clones whatever is missing into the workspace's
.context/folder before the agent starts.How it works
gh repo list, with recently attached repositories first, like ctxclone's completion ranking. Typingorg/lists another owner, and a pastedowner/repoor clone URL also works. Repositories already in the thread's workspace are marked with their branch, ahead/behind, and changed-file count.repositorycontext record, a new kind incomposerContext.ts.apps/server/src/contextRepositories/ContextRepositories.ts). Full clones, as ctxclone does, with up to 4 in parallel..git..context/is added to the repository'sinfo/exclude, so checkpoints and diffs ignore the clones.ws.ts). On a new worktree it's a new Clone context repositories stage on the setup card, after checkout and before the setup script. Other sends (local first send, follow-ups) clone before the turn is recorded.cloned/present/conflict/failed, the detail, and git status) is written back onto the message. The prompt projection spells it out, for example:status: already cloned; left as it was, not pulled/git: on main, 0 ahead and 3 behind origin/main, clean working tree. The bootstrap path persists the message before the worktree exists, so the decider now restates a persisted message when the turn start carries changed context (decider.ts). Failures are warnings, and the agent still starts..context). Both are server settings.Surfaces
ghcredentials.Testing
ContextRepositories.test.ts(real git: clone, present with ahead/behind after a remote push, conflict, failed, outside-workspace folder refused, inspect, porcelain parsing), twoserver.test.tsintegration tests (bootstrap order ensure → setup script → turn, and the follow-up path), a decider restatement test, the projection text, contract round-trips, and client input parsing.server.test.ts > flushes more than one tool chunk before the synchronization markerfails on this branch. It's about the tool-callpreviewfield, which this PR doesn't touch.🤖 Generated with Claude Code (Claude Opus 5.5 in T3 Code)