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

# Partial Merge Task

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

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.net/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/versions/86f514b4e920/schema)
