063a839790
- Add clone_mode and branch fields to tool_instances - Add ssh_key_id to git_repositories for per-repo SSH key assignment - Implement host-side git cloning with branch selection (default: main) - Mount SSH keys into containers for git operations in clone mode - Add dirty state check on clone-mode instance deletion with confirmation - Update SessionsPage with mount/clone selector, branch input, SSH key display - Add SSH key selector to repository creation form - Add dirty delete confirmation modal with changed files list - Update API schemas and endpoints for new fields - Sync delta specs to main specs (git-repo, tool-instances, repo-clone-mode) - Archive completed OpenSpec change: repo-clone-mode-with-ssh - Document git requirement for custom tool types Quality gates: Frontend typecheck and build passed OpenSpec: repo-clone-mode-with-ssh archived with all tasks complete
1.4 KiB
1.4 KiB
Context
Repository creation currently produces mirrored bare repos for any remote clone and bare repos for blank creations. The workspace, file browser, commit editor, and git toolbar are built around a working-tree repository model, so users can hit 400s when they try to sync or when the repo has no usable branch state.
Goals
- Create working clones for remote repositories
- Create working repos with an initial branch for blank repositories
- Preserve the existing repository create endpoint and shared UI flow
- Keep fetch/pull/push aligned with a normal local clone
Decisions
- Clone mode
- Use
git clonewithout--mirror - Keep the existing remote URL preflight and URL parsing behavior
- Blank repositories
- Initialize with
git init -b mainwhen supported - Fall back to
git initplusgit symbolic-ref HEAD refs/heads/mainif needed
- Branch state
- Treat
mainas the initial branch name for blank repos - Make branch listing and current-branch helpers tolerate unborn
HEAD
- Pull behavior
- Prefer the current branch when no explicit branch is supplied
- Do not force
origin <branch>if the branch is unborn or already tracked by the current checkout
Risks
- Some older git versions may not support
git init -b; the backend should fall back cleanly - Existing blank repos created under the old bare model may still require migration or cleanup outside this change