Slice 9: git_checkout and create_branch (menu + MCP)

git boundary Checkout/CreateBranch; service GitCheckout/GitCreateBranch (activity detail names the branch; gitAction takes an ok-detail). HTTP /api/repo/git ops checkout + create-branch (branch field). MCP tools git_checkout and create_branch. <repo-menu> gains Switch branch… and New branch… (prompt for name). Service test covers create+switch and existing-branch failure. Checkout is not destructive - git refuses if it would overwrite changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 17:27:58 -04:00
parent e59d5bbd29
commit e1999bcf21
10 changed files with 136 additions and 14 deletions
+3 -3
View File
@@ -365,9 +365,9 @@ obeys the safety rules (§1.4).
the tool handlers (§1.7). Expected tools (grow as features land):
- Read: `list_repos`, `get_repo`, `get_active_project`, `get_activity`,
`get_pending_switch`, `list_prs`.
- Act: `git_fetch`, `git_pull`, `git_push`, `git_commit`,
`git_discard_changes`, `merge_and_cleanup_pr`, `set_active_project`,
`ack_switch`. (More — `git_checkout`, `create_branch`, `create_pr` — as they land.)
- Act: `git_fetch`, `git_pull`, `git_push`, `git_commit`, `git_checkout`,
`create_branch`, `git_discard_changes`, `merge_and_cleanup_pr`,
`set_active_project`, `ack_switch`. (More — `create_pr` — as they land.)
- **A tool's result type must be a struct, never a bare slice/map/scalar.** The
go-sdk infers each tool's `outputSchema` from its handler's result type, and MCP
structured output must be a JSON **object** (`type: "object"`). A handler that