Skip to content

fix(core): normalize file.status paths relative to instance dir#14207

Open
shantur wants to merge 1 commit intoanomalyco:devfrom
shantur:fix-worktree-file-status-path
Open

fix(core): normalize file.status paths relative to instance dir#14207
shantur wants to merge 1 commit intoanomalyco:devfrom
shantur:fix-worktree-file-status-path

Conversation

@shantur
Copy link
Contributor

@shantur shantur commented Feb 18, 2026

Issue for this PR

None

Type of change

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

What does this PR do?

file.status returns incorrect/unstable file paths when x-opencode-directory points inside a repo (including git worktrees) because it runs path.relative(Instance.directory, x.path) on git-provided paths that are already relative, causing bogus ../... paths and inconsistent results depending on server cwd and request directory.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Manual API verification and tested with NeuralNomadsAI/CodeNomad#180

Screenshots / recordings

Pre Change

[
    {
        "path": "../../../banner.py",
        "added": 0,
        "removed": 1,
        "status": "modified"
    },
    {
        "path": "../../../tasmotizer.py",
        "added": 150,
        "removed": 2,
        "status": "modified"
    }
]

Post Change

[
    {
        "path": "banner.py",
        "added": 0,
        "removed": 1,
        "status": "modified"
    },
    {
        "path": "tasmotizer.py",
        "added": 150,
        "removed": 2,
        "status": "modified"
    }
]

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 github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 18, 2026
@github-actions
Copy link
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No issue referenced. Please add Closes #<number> linking to the relevant issue.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@shantur shantur force-pushed the fix-worktree-file-status-path branch from 8e9fd40 to c3f3c48 Compare February 18, 2026 23:14
@R44VC0RP R44VC0RP removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 18, 2026
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.

2 participants

Comments