---
title: "Partial Merge Task"
method: POST
path: "/api/v1/tasks/{task_id}/partial-merge"
---

# Partial Merge Task

`POST /api/v1/tasks/{task_id}/partial-merge`

## Request

- Base URL: `http://127.0.0.1:8052`
- URL: `http://127.0.0.1:8052/api/v1/tasks/{task_id}/partial-merge`
- Auth: none declared

Incrementally merge specific committed files from the agent's branch into main.

Allows a long-running agent to push a completed subset of its work (e.g.
the first 5 of 10 test files) while still writing the rest.  Reduces
wall-clock time by making partial results available downstream earlier.

Only files that are already **committed** in the agent's worktree branch
(``agent/<session_id>``) are merged.  Uncommitted files are returned in
``uncommitted_files`` so the caller knows to commit them in the worktree
first.  Files that were already merged by a prior call are skipped and
returned in ``skipped_already_merged``.

Requires the task to be ``in_progress`` with a ``claimed_by_session`` set.

## Path parameters

- `task_id` string, required

## Request body

- PartialMergeRequest: Body for POST /tasks/{task_id}/partial-merge. Requests an incremental merge of specific files from the agent's branch into the main branch before the task finishes. Only files already committed in the agent's worktree branch are processed.
  - `files` string[], required
  - `message` string

## Response `200`

Successful Response

- PartialMergeResponse: Response for POST /tasks/{task_id}/partial-merge.
  - `success` boolean, required
  - `merged_files` string[], required
  - `skipped_already_merged` string[], required
  - `uncommitted_files` string[], required
  - `conflicting_files` string[], required
  - `commit_sha` string, required
  - `error` string, required

## Other responses

- `404`: Task not found
- `409`: Task not in progress or has no active session
- `422`: Validation Error

---

[API](https://skmtc.dev/bernstein/apis/bernstein-task-server.md) · [All operations](https://skmtc.dev/bernstein/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc.dev/bernstein/apis/bernstein-task-server/revisions/2a20a34ad2eb?raw)
