Skip to content

Apply Patch

Apply Patch is the staged-diff mutation path behind the apply_patch agent tool. It applies unified diffs into BMO’s staging layer instead of writing directly to the working tree.

  • accepts unified diff input
  • validates path safety before staging
  • records bounded apply_patch.fired and apply_patch.action events
  • keeps diff bodies out of the observability surface

apply_patch is available when options.sandbox_mode = "staged". In direct-write mode, the staged apply path is not exposed.

  • bmo config show-apply-patch — config-only posture
  • /apply-patch or /smart-apply — live in-process posture
  • list_recent_apply_patch_events — raw JSON ring export for recent apply-patch and smart-apply events