Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt

Use this file to discover all available pages before exploring further.

Patch a change. A successful patch snapshots the result into a new commit owned by the same Mesa change.
import base64
from mesa_sdk import FileUpsert

change = await mesa.changes.patch(
    repo="app",
    change_id="zyxwvutsrqponmlkzyxwvutsrqponmlk",
    message="Update README",
    files=[
        FileUpsert(
            path="README.md",
            content=base64.b64encode(b"# Updated\n").decode(),
        )
    ],
)
Resolve conflicts:
from mesa_sdk import HunkFix, HunkResolution

change = await mesa.changes.patch(
    repo="app",
    change_id="zyxwvutsrqponmlkzyxwvutsrqponmlk",
    resolutions=[
        HunkResolution(
            path="README.md",
            hunks=[HunkFix(hunk_id="h1", take="target")],
        )
    ],
)

Options

repo
str
required
Repository name.
change_id
str
required
Existing Mesa change ID.
org
str | None
Organization override.
message
str | None
New change message.
author
Author | None
New author identity.
committer
Author | None
New committer identity.
files
list[FileChange] | None
File operations to apply. Mutually exclusive with resolutions.
base_commit_oid
str | None
Optimistic-concurrency token. When set, the patch fails with ConflictError if the change has advanced past this commit.
resolutions
list[Resolution] | None
Conflict resolutions to apply to a conflicted change. Mutually exclusive with files.

Response

Returns the updated change object with id, current_commit_oid, is_conflicted, message, author, committer, parents, created_at, and updated_at.

Required scope

write