Skip to content

fix(opencode): omit empty apply patch move path - #45329

Open
altendky wants to merge 1 commit into
anomalyco:devfrom
altendky:apply-patch-metadata
Open

fix(opencode): omit empty apply patch move path#45329
altendky wants to merge 1 commit into
anomalyco:devfrom
altendky:apply-patch-metadata

Conversation

@altendky

Copy link
Copy Markdown
Contributor

Issue for this PR

Fixes #45275

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Non-move apply_patch changes included movePath: undefined in permission metadata. Pending permission requests then failed JSON encoding when clients called GET /permission.

This omits movePath unless a patch actually moves a file. It keeps the fix local to the v1 apply-patch metadata producer and preserves move metadata when present.

How did you verify your code works?

The regression test reproduced Expected JSON value with metadata.files[0].movePath set to undefined before the fix. The full test/tool/apply_patch.test.ts suite passes with 28 tests, package typecheck passes, and the pre-push repository typecheck completed 30 of 30 tasks successfully.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

I found a potentially related PR:

Related PR:

  • fix: apply_patch move to same path deletes the file #45316 - fix: apply_patch move to same path deletes the file
    • This appears to be related to the same apply_patch move functionality, though it addresses a different aspect of the issue (moving to the same path causing deletion vs. undefined metadata)

Also potentially related (similar pattern fixes):

The most immediately related is #45316, which also deals with apply_patch move behavior. You may want to verify these aren't addressing overlapping concerns or if they should be coordinated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1 apply_patch: permission list returns HTTP 400 for non-move changes

1 participant