Problem
POST /projects/:projectId/tasks/:taskId/branches always calls GitHub to create the branch before inserting into github_task_branches.
When developers create branches in their IDE or agent and only want to associate an existing branch with a task, the API returns:
GitHub API error: Reference already exists
Pull request linking already supports this pattern via POST .../pull-requests/link. Branches had no equivalent.
Proposed solution
Add a link-only endpoint:
POST /projects/:projectId/tasks/:taskId/branches/link
Body:
{
"repo_id": "uuid",
"branch_name": "feature/my-branch"
}
Expected behavior:
- Verify
repo_id belongs to the project
- Verify the branch ref exists on GitHub
- Insert into
github_task_branches (ON CONFLICT DO NOTHING)
- Emit
github.branch_linked
- Allow one branch → many tasks
Also add MCP tool github_link_branch_to_task, mirroring github_link_pr_to_task.
Status
Implemented in a single clean commit — see open PR from branch feat/link-branch-clean (supersedes earlier draft PR #17).
Use case
Branch and PR are created outside Paca (IDE, agent, GitHub web). Tasks are linked afterward for traceability — same workflow as pull-requests/link.
Problem
POST /projects/:projectId/tasks/:taskId/branchesalways calls GitHub to create the branch before inserting intogithub_task_branches.When developers create branches in their IDE or agent and only want to associate an existing branch with a task, the API returns:
Pull request linking already supports this pattern via
POST .../pull-requests/link. Branches had no equivalent.Proposed solution
Add a link-only endpoint:
Body:
{ "repo_id": "uuid", "branch_name": "feature/my-branch" }Expected behavior:
repo_idbelongs to the projectgithub_task_branches(ON CONFLICT DO NOTHING)github.branch_linkedAlso add MCP tool
github_link_branch_to_task, mirroringgithub_link_pr_to_task.Status
Implemented in a single clean commit — see open PR from branch
feat/link-branch-clean(supersedes earlier draft PR #17).Use case
Branch and PR are created outside Paca (IDE, agent, GitHub web). Tasks are linked afterward for traceability — same workflow as
pull-requests/link.