Skip to content

Installation and updates

Install released extensions on main, resolve tag and CI check conflicts when updating versions, and manage uninstalls.

Updated

Once an extension is released to the organization’s registry, any repo in the organization can install the release. A prerelease, which a branch or an unbumped commit to main publishes, isn’t installable: installing one, or updating an installation to one, returns InvalidRequest. Installing an extension pins that release in the repo’s commit DAG and copies the version’s custom models, custom fields, tag families, tags, CI checks, agent instructions, and agent skills into the repo under record IDs and tables of the repo’s own.

Installation on main

A repo installs an extension only on its main branch (ExtensionInstallationRequiresMain on any other branch). An installation takes the extension’s qualified name, <repo slug>.<name>: the slug of the repo that defines it, a dot, and its name, such as acme-standards.procurement, so two repos can publish extensions with the same name. The registry, installations, policies, and peers all use that name. A repo holds one extension of each name, its own or installed, so installing acme-standards.procurement in a repo that defines a procurement extension of its own, or that installs another repo’s procurement, fails with ExtensionNameInUse (HTTP 409). Tag family names are unique across a repo too, so installing an extension with a tag family whose name one of the repo’s families already has fails with ExtensionTagFamilyNameTaken (HTTP 409), which names that family in tag_family and tag_family_id. Rename the repo’s family, then install again. Because every branch in a repo starts from main, installing on main guarantees that every branch shares a single installation identity and never creates duplicate copies of the extension’s models during a merge.

Installing, updating, and uninstalling an extension all take manage on its installation (installation("acme-standards.procurement"), or installations for every one), which the default Editor policy doesn’t grant. See Actions.

Install a version on main and commit the change:

# Browse released extensions and their releases in the org
forge registry list-extensions --org "$ORG"
forge registry list-extension-versions --org "$ORG" --name acme-standards.procurement

# Install version 1.0.0 on main and commit
forge extensions create-extension-installation --repo "$OPS_REPO" --branch main \
  --data '{"name":"acme-standards.procurement","version":"1.0.0"}'

forge commits create-commit --repo "$OPS_REPO" --branch main \
  --data '{"message":"Install procurement 1.0.0"}'

# List installed extensions in the repo
forge extensions list-extension-installations --repo "$OPS_REPO" --branch main

How installed schema, tags, and records behave

After you install an extension in a repo, its copied resources follow clear ownership rules:

  • Installed schema is read-only: Custom models and custom fields copied from an installation carry extension_installation_id and cannot be renamed, modified, or deleted directly in the installing repo (InstalledSchemaReadOnly). They change only when you update or uninstall the installation. To attach repo-specific custom fields to an installed model, create a repo-owned custom model with a reference custom field pointing to the installed model’s api_name (such as procurement__line_item).
  • Records in installed models are editable: You create, update, tag, and delete records in an installed custom model just like records in a repo-owned model.
  • Installed tag families and tags are editable: Unlike schema, installed tag families and tags are data. Members with manageTags on the repo can rename an installed tag, change its code or parent_id, add repo-owned tags under an installed tag family, or delete an installed tag. When you later update the installation to a higher version, Forge reconciles your local tag edits with the target version’s changes.
  • Installed CI checks run on the repo’s commits: An installed CI check runs on every commit of the installing repo and gates its change requests like the repo’s own CI checks. Its extension_installation_id names the installation. Members with manageCi on the repo can edit an installed CI check, turn it off with {"enabled": false}, or make it advisory. Whether it’s enabled and its severity are the repo’s choices: an update keeps them and never counts them as an edit.
  • Installed agent instructions and skills are editable: Members with manage on agent instructions or agent skills can edit an installed AGENTS.md or agent skill and its files. When you later update the installation, Forge reconciles local edits against the target version, resolving each skill whole with all of its files.

Installation version updates

Updating an installation on main to a higher release is a two-step process: first run a read-only update check to inspect conflicts and blockers, then apply the update with any required conflict resolutions and commit.

# 1. Check what updating to 1.1.0 touches
forge extensions check-extension-installation-update --repo "$OPS_REPO" --branch main \
  --name acme-standards.procurement --data '{"version":"1.1.0"}'

# 2. Apply the update with conflict resolutions and commit
forge extensions update-extension-installation --repo "$OPS_REPO" --branch main \
  --name acme-standards.procurement --data '{
    "version": "1.1.0",
    "resolutions": [
      { "record_id": "tag_01j...", "action": "take_ours" }
    ]
  }'

forge commits create-commit --repo "$OPS_REPO" --branch main \
  --data '{"message":"Update procurement to 1.1.0"}'

The target version must be strictly higher than the pinned version (ExtensionInstallationNotNewer otherwise). Applying an update while a conflict has no resolution or a blocker remains fails with ExtensionInstallationUpdateRefused (HTTP 409), whose check lists what’s left to decide. With ?cascade=true (--cascade), its blockers leave out what the cascade would clear. A resolution list that names a record twice, or names a record that is neither a conflict nor in previously_took_ours, fails with InvalidExtensionInstallationUpdateResolution (HTTP 422).

What an update does automatically

For every resource that has no conflict or blocker, updateRepoExtensionInstallation updates the repo in place:

  • Resources kept by the target version retain their repo record IDs, so business records and tag memberships stay attached, and enabled schedules remain enabled.
  • Custom models, custom fields, tag families, tags, CI checks, agent instructions, agent skills, and schedules added by the target version are created, with added schedules starting disabled.
  • A custom field that the target version adds back after an earlier version removed it starts empty, even where a --cascade update left values behind.
  • If the target version adds a required custom field, every stored record where that custom field is empty receives the custom field’s default_value.
  • Merging a branch that created records before the update gives those records the default_value of each custom field the target version added, required or not.
  • If the target version changes a custom field’s type, every stored record value that converts cleanly is cast to the target type, by the casts in Custom field type changes.
  • If the target version adds or changes a formula custom field, the formula is recomputed across all stored records.

Conflict resolution

If the installing repo edited an installed tag family, tag, CI check, agent instructions, or agent skill, and the target extension version also modified or dropped that same record, checkRepoExtensionInstallationUpdate lists it in conflicts:

  • Each conflict has _tag ("TagFamily", "Tag", "CICheck", "AgentInstructions", or "AgentSkill"), kind ("edit" when both sides modified it, or "edit_delete" when the version dropped a record that the repo edited or placed child tags under), record_id (the repo’s ID for the record), and ours, base, and theirs snapshots.
  • Pass a resolution for each conflict in resolutions:
    • { "record_id": "tag_...", "action": "take_ours" } keeps the repo’s version of the record. Forge remembers take_ours across subsequent updates: later updates report the record under previously_took_ours and keep the repo’s copy automatically without blocking the update (unless a later version drops the record). For an edit_delete conflict, take_ours detaches the record from the installation and keeps it as the repo’s own.
    • { "record_id": "tag_...", "action": "take_theirs" } overwrites the record with the target extension version’s copy (or deletes it on edit_delete, moving any repo-owned child tags up to the nearest remaining ancestor) and resumes tracking the extension in subsequent updates. You can also pass take_theirs for any record listed in previously_took_ours to opt back into following the extension’s version.

Update blockers

When a target version drops a model, custom field, tag family, tag, or schedule that the repo uses, tightens a custom field constraint, or gives a tag family a name that another of the repo’s tag families has, the update check lists each issue in blockers:

Blocker _tag Meaning How to resolve
Records A custom model dropped by the target version still contains records in the repo. Delete the records or pass ?cascade=true (--cascade) to delete them with the update.
TagMemberships A tag dropped by the target version is still attached to records in the repo. tag_family and tag are the names of its family and the tag, tag_id is the repo’s tag, and count is how many records it’s on. Remove the tag from those records or pass --cascade.
EnabledSchedule A schedule dropped by the target version is still enabled on the branch. Disable the schedule or pass --cascade.
CustomFieldValues A custom field removed by the target version, or retyped so that some of its values have no cast, holds non-null values on stored records. Clear those values or pass --cascade to drop the unconvertible or removed values.
Dependency A repo-owned custom model has a reference or formula custom field that depends on a model or custom field removed or retyped by the target version. Update or delete the repo’s dependent custom field first (--cascade never deletes repo-owned schema).
TagFamilyNameTaken The target version adds a tag family, or renames one, under a name that another of the repo’s tag families has. tag_family is the name and tag_family_id is the repo’s family that has it. Rename that family before updating (--cascade doesn’t rename it).
UniqueValues A custom field becomes unique: true in the target version, and stored records in the repo have duplicate values. Edit the records so their values in that custom field are distinct before updating.
RequiredValues A custom field is required: true in the target version and has no default_value, so the update can’t fill stored records where it’s empty. Forge now refuses to publish such a version (ExtensionRequiredFieldWithoutDefault), so only a version published before that rule reports it. Update to a later version that gives the custom field a default. When the custom field already exists in the repo, filling it on those records also clears the blocker (--cascade doesn’t).
Violation The update would break another rule that every write enforces, given as violation in the form a merge reports it: for example, the target version removes a picklist option that stored records still hold, or retargets a reference custom field while records name records of its old target. Change those records before updating (--cascade doesn’t clear them).

Peers between extensions

An extension can depend on releases of other extensions in the org’s registry as peers: extensions that the repo installs beside it. It declares each one in its package.json under peerDependencies, as @buildr-custom/<org slug>.<repo slug>.<name> with an npm range:

{ "peerDependencies": { "@buildr-custom/acme.integrations.directory": "^1.2.0" } }
  • Publishing: the repo that defines the extension runs it beside its peers, so a commit doesn’t publish it until that commit’s snapshot holds each peer at a version that its range allows. The publication fails with ExtensionDependencyRefused, naming the peer and its range. Install the peer on main, and the commit that installs it publishes the extension again. On a branch, bring that commit in by merging a change request from main into the branch, which publishes the extension again too, or cut a fresh branch from main. Updating a peer on that repo’s main publishes the extension again, so main runs the extension with the peer’s new code. An extension can’t name another extension of the same repo as a peer yet, and a @buildr-custom package under dependencies is refused. Since a repo holds one extension of each name, a peer that shares the extension’s own name, or two peers that share a name, such as integrations.directory and vendors.directory, are refused too. A release’s package.json names its peers by the org’s slug at the time it was published, so after the org changes its slug, publishing refuses a package.json that still names a peer by an earlier slug, and its error gives the name to use. Releases published before the change keep installing under either slug, since the registry answers to an org’s previous slugs until another org takes one.

  • Code: a dependent imports a peer’s files like any npm package, such as import { edition } from "@buildr-custom/acme.integrations.directory/names", and calls a peer’s tools from any of its tools with peerTools, which takes the peer’s qualified name and runs the tool of the peer’s installation in the repo that the call runs in. A call from a member needs that member’s own call on the peer’s tool, and a call from the dependent’s schedule, trigger, webhook, or mailbox needs no policy, since the dependent’s built-in policy covers its peers. Each installation runs a build of its own, linked with the release of each peer that its repo installs, so updating a peer changes the code that its dependents run. A build refuses an import of an extension that peerDependencies doesn’t declare, and a UI’s import of any extension.

  • Types: each release’s npm package holds the type declarations that Forge emits from its code, so an author writes no type file. After npm install, TypeScript checks an import of a peer’s module, and a call to its tools through peerTools, against what the peer’s code returns. A peer’s tool that declares no output has the type its handler returns, as JSON carries it: a Date arrives as a string, a result of undefined as null, and a property that holds a function not at all. Declarations cover the peer’s TypeScript and JavaScript modules, and .d.ts files that its author wrote ship with them. A value whose type Forge can’t infer, such as an untyped parameter or a type error in the peer’s code, is any:

    import type directory from "@buildr-custom/acme.integrations.directory";
    import { defineExtension, object, peerTools, string, tool } from "@buildr/sdk";
    
    const vendor = tool(
      { description: "Finds a vendor's company", input: object({ code: string() }) },
      async (ctx, { code }) => peerTools<typeof directory>(ctx, "integrations.directory").companies.lookup({ code }),
    );
    
    export default defineExtension({}, { tools: { vendor } });

    import type imports only the peer’s type, so the build bundles none of the peer’s code for it. A call rejects with a ForgeError as a call through ctx.forge does.

  • Connections: a requirement that the repo leaves unbound takes the connection that a peer’s binding names for the same provider and scope, so an extension that calls the service its peer calls needs no binding of its own. See Bindings and audiences.

  • Installing: nothing installs a peer for you. Installing an extension whose peer the repo lacks, or holds at a version outside the range, fails with ExtensionDependenciesUnmet (HTTP 409). Install or update the peer first. Each installation reports the dependencies that its version declares.

  • Updating: an update fails with ExtensionDependenciesUnmet when the new version falls outside a range that another installation declares on it, or declares a peer that the repo lacks or holds outside its range. Update the dependent first, or pick a release that fits. An update moves only to a newer release, so some ways out start with an uninstall. When the repo holds the peer above the range, uninstall the peer and install a release in range. When a dependent and its peer cross a major together, uninstall the dependent, update the peer, and install the dependent’s new release, in one working change before you commit. The error’s message names the way out.

  • Uninstalling: uninstalling a peer that another installation still declares fails with ExtensionDependenciesUnmet. Uninstall the dependents first.

  • In the defining repo: the repo that defines an extension installs its peers too, so the ranges in the extension’s package.json count like an installation’s. Updating a peer outside that range, or uninstalling it, fails with ExtensionDependenciesUnmet, and a commit whose package.json range rejects the installed peer reports an extension_peer violation. To move a peer past the range, change the range and update the peer in one working change, then commit.

  • Racing changes: installing or updating builds each installation against the peers that the repo holds. When other changes to the repo’s installations, such as a script that updates the peer, keep moving those peers while the builds run, the install or update changes nothing and fails with ExtensionInstallationsKeptChanging (HTTP 409). Send it again once those changes finish.

  • Merging: a merge that would leave an installation without its peer, such as a branch that uninstalls the peer while main installs the dependent, reports an extension_peer violation and is refused until one side changes.

Service extensions

A service is an extension that runs only in the repo that defines it, for callers anywhere in the org, such as a company directory that every project repo looks companies up in. It declares its kind in defineExtension:

export default defineExtension({}, { kind: "service", tools: { companies: { lookup } } });

An extension without kind is installable: each repo that installs it runs its own copy, at the release that it pins. A service differs in these ways:

  • Where it runs: only in the repo that defines it, at the version that the repo’s main head commit publishes. Its tools read and write that repo’s records, as ctx.repo.id, and its schedules, triggers, webhooks, and mailboxes run there.

  • Installing: no repo installs a service. Installing or updating to a version that is a service fails with ExtensionServiceNotInstallable (HTTP 409).

  • Calling it: POST /orgs/:org_id/extension-services/:name/tools/:tool (forge extensions call-extension-service-tool) calls a tool by the service’s qualified name, <repo slug>.<name>, such as integrations.directory. The call acts as you, and the defining repo’s policies decide whether you may read that repo and call the tool. Calling an installable extension this way fails with ExtensionNotAService (HTTP 409).

  • From another extension: any tool calls a service’s tools with serviceTools, which peerTools matches in everything but where the tool runs. The call acts as whoever the calling tool acts as. A member’s call needs the member’s own call on the service’s tool. A call from a schedule, trigger, webhook, or mailbox acts as the calling extension, which the defining repo’s policies must allow to call the tool.

    import type directory from "@buildr-custom/acme.integrations.directory";
    import { defineExtension, object, serviceTools, string, tool } from "@buildr/sdk";
    
    const vendor = tool(
      { description: "Finds a vendor's company", input: object({ code: string() }) },
      async (ctx, { code }) =>
        serviceTools<typeof directory>(ctx, "integrations.directory").companies.lookup({ code }),
    );

    A service isn’t a peer, so the caller doesn’t list it in peerDependencies. To type the calls, add the service’s package to devDependencies and run npm install. import type brings in only its types, so the build bundles none of its code.

  • Versions: every caller reaches the version that the service’s main publishes, so a change to a tool’s input or output reaches every caller at once. Add a field or a tool rather than change one that callers depend on.

Extension uninstallation

You can remove an installation on any branch with DELETE /repos/:repo_id/branches/:branch/extension-installations/:name (forge extensions delete-extension-installation). In the CLI, pass --data null (without --data, the CLI stops with Missing required flag):

forge extensions delete-extension-installation --repo "$OPS_REPO" --branch main \
  --name acme-standards.procurement --cascade --data null
forge commits create-commit --repo "$OPS_REPO" --branch main \
  --data '{"message":"Uninstall procurement"}'

Uninstalling removes the installation and all custom models, custom fields, tag families, tags, CI checks, agent instructions, and agent skills that belong to it:

  • A tag family the repo changed, by renaming it, adding tags to it, or editing or keeping one of its tags, holds the repo’s own data, so uninstalling fails with ExtensionInstallationInUse and lists the family in conflicts, as an edit_delete conflict with the family’s ID in record_id. --cascade doesn’t settle it. Uninstall again with a resolution for each family: take_ours keeps the family whole, with all its tags and the records tagged with them, as the repo’s own, and take_theirs removes it with all its tags. Because the CLI currently accepts only null as delete-extension-installation’s body, send resolutions through the HTTP API (or MCP’s forge.extensions.deleteRepoExtensionInstallation):

    printf 'Authorization: Bearer %s\n' "$FORGE_TOKEN" |
      curl -sS --fail-with-body -X DELETE "$FORGE_URL/repos/$OPS_REPO/branches/main/extension-installations/acme-standards.procurement" \
        -H @- -H 'Content-Type: application/json' \
        --data '{"resolutions":[{"record_id":"tag_family_...","action":"take_ours"}]}'
  • Installed CI checks, agent instructions, and agent skills that the repo edited are edit_delete conflicts in conflicts too, with _tag "CICheck", "AgentInstructions", or "AgentSkill". Turning a CI check off or changing its severity isn’t an edit, so such a CI check goes with the installation. take_ours keeps the record (and all of a skill’s files) as the repo’s own, and take_theirs removes it.

  • If the installation’s models contain Records, the tags it removes have TagMemberships, or any of its schedules is an EnabledSchedule, uninstalling fails with ExtensionInstallationInUse and lists them in blockers unless you pass ?cascade=true (--cascade).

  • If a repo-owned custom field has a Dependency (a reference or formula) pointing to one of the installation’s models, --cascade does not remove it. Update or delete the referencing custom field first.

  • Uninstalling never stops a workflow run: each run keeps the version it pinned until it ends, and stays listed under the installation’s name. Terminate runs you no longer want.

  • An uninstall on a branch merges into main like any change, unless main updated the installation since the branch split off. See Merging across an update.

Merges across an update

A merge treats an installation as one unit, so the merged repo always matches the version it pins. When one side of a merge updated or uninstalled an installation since the branches split off, the merge takes the installation from that side:

  • The branch’s other edits to what that version still declares merge as usual: turning a schedule on or off, editing a tag, writing values into an installed custom field.
  • A schedule the version dropped never runs, even if the branch turned it on. The merge never reports conflicts on the bookkeeping tables extension_installations or extension_references.
  • A conflict that brings back a custom field, custom model, tag family, tag, or CI check the version dropped refuses the side that keeps it with InvalidMergeResolution. Resolve it with the side that removes it. For a removed_custom_field_write on an installed custom field, the branch’s values in that field go with it, and the rest of each record still merges.

When a branch uninstalled an extension that main updated since, or that the other side wrote to since the branches split off (it added or edited records in the installation’s models, added tag memberships, or turned a schedule on), the merge reports one conflict for the whole installation:

{
  "id": "installation:extension_installation_...",
  "kind": "installation",
  "installation_id": "extension_installation_...",
  "extension_name": "acme-standards.procurement",
  "versions": { "base": "1.0.0", "ours": "1.1.0", "theirs": null }
}

versions gives the version each commit pins, with null for the side that uninstalled it. Resolve the conflict with take_ours or take_theirs. The side you take keeps or removes the whole installation: its schema, its tags, the records in its models, and the tag memberships on its tags or records. Taking the uninstall is refused with InvalidMergeResolution while the other side holds records, tag memberships, or enabled schedules that it added after the branches split off, because the uninstall never saw them. Remove them on that side, or keep the installation. When the side that uninstalled it also reinstalled the extension, keeping the old installation is refused as well, because two installations would share one name: delete or move the records the other side added, take the reinstall, and enter them again in the reinstalled models.

Type to search…

↑↓ navigate↵ selectEsc close