Skip to content

refactor(runtime): use OpenAI native ApplyPatch - #2532

Merged
Astro-Han merged 1 commit into
mainfrom
feat/1552-apply-patch-toolset
Aug 9, 2026
Merged

Astro-Han merged 1 commit into
mainfrom
feat/1552-apply-patch-toolset

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Register the AI SDK native openai.tools.applyPatch() tool only for documented Apply Patch models on native OpenAI Responses; every other model and provider keeps the existing tool surface.
  • Use @openai/agents-core.applyDiff() for the official single-file V4A create/update semantics.
  • Route create, update, and delete through the existing FilesystemExecutor, its canonical write lock, workspace adapter, permission boundary, and sandbox worker.
  • Keep create exclusive with recursive parent creation, and delete the directory entry itself so symlink targets are preserved.
  • Remove the prior design entirely: no custom multi-file parser, matcher, planner, editing protocol, provider fallback, second filesystem implementation, version/CAS protocol, or partial/unknown state machine.

Refs #1552

Verification

  • npm run format:check
  • npm run check:third-party-notices
  • npm --workspace @maka/core run build
  • npm --workspace @maka/runtime run build
  • npm --workspace @maka/runtime-host run build
  • 386 affected Runtime tests passed.
  • 3 focused Core permission tests passed.
  • 20 focused Runtime Host composition tests passed.
  • git diff --check

Not run locally: the full repository test suite or a paid OpenAI model call.

Review focus

  • Final diff: 30 files, +1,314/-60. Product source is +473/-57, focused tests are +549/-3, and generated dependency lock/notices account for +292.
  • Each provider call contains exactly one create_file, update_file, or delete_file operation. There is no multi-file transaction or partial-settlement state machine.
  • The AI SDK owns the provider schema, Agents Core owns V4A matching, and Maka owns filesystem authority.
  • The runtime uses the provider's canonical apply_patch name so continuation and replay serialize as apply_patch_call_output, including failures.
  • The filesystem-worker build resolves only Agents Core's applyDiff.mjs; it does not bundle the unrelated Agents SDK runtime.
  • This PR does not add a second Headless executor or expose Apply Patch to non-OpenAI providers.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Astro-Han
Astro-Han force-pushed the feat/1552-apply-patch-toolset branch from 6ab6dee to f024e55 Compare August 8, 2026 19:20
@Astro-Han Astro-Han changed the title feat: add session-fixed ApplyPatch toolsets feat: select ApplyPatch by model capability Aug 8, 2026
@Astro-Han
Astro-Han force-pushed the feat/1552-apply-patch-toolset branch from e793f9e to 1614e7a Compare August 9, 2026 01:44
@Astro-Han Astro-Han changed the title feat: select ApplyPatch by model capability feat: add ApplyPatch through the filesystem authority Aug 9, 2026
@Astro-Han
Astro-Han force-pushed the feat/1552-apply-patch-toolset branch from b012092 to a4e381f Compare August 9, 2026 04:11
@Astro-Han Astro-Han changed the title feat: add ApplyPatch through the filesystem authority refactor(runtime): use OpenAI native ApplyPatch Aug 9, 2026
@Astro-Han
Astro-Han force-pushed the feat/1552-apply-patch-toolset branch 4 times, most recently from 94b2972 to 6555f89 Compare August 9, 2026 06:52
@Astro-Han Astro-Han closed this Aug 9, 2026
@Astro-Han Astro-Han reopened this Aug 9, 2026
@Astro-Han
Astro-Han force-pushed the feat/1552-apply-patch-toolset branch 2 times, most recently from d74ec5c to 9887758 Compare August 9, 2026 07:43
@Astro-Han
Astro-Han force-pushed the feat/1552-apply-patch-toolset branch from 24b06bb to 872fdf6 Compare August 9, 2026 10:22
@Astro-Han
Astro-Han marked this pull request as ready for review August 9, 2026 10:48
@Astro-Han
Astro-Han merged commit 1b00c98 into main Aug 9, 2026
11 checks passed
@Astro-Han
Astro-Han deleted the feat/1552-apply-patch-toolset branch August 9, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant