Skip to content

fix(tools): normalize or guide models against absolute POSIX paths on Windows hosts #972

Closed

Description

@euxarist

Summary

When models run on Windows hosts, they occasionally hallucinate standard POSIX paths (such as /home/user/... or /tmp/...) in arguments to read_file, glob, and grep. These paths fail with raw OS-level errors (e.g. GetFileAttributesEx <workdir>\home: The system cannot find the file specified).

Problem

  • In internal/tools/, path resolution on Windows interprets leading /home/... relative to the current working drive or repository root, causing missing-path errors.
  • The model wastes turns retrying non-existent directories rather than adjusting to workspace-relative or Windows paths.

Proposed Solution

  1. Platform hints on failure: When a tool on Windows receives a /home/... or root-like POSIX path that does not exist, provide an actionable error hint clarifying the workspace root and host OS.
  2. Path normalization: Strip synthetic /home/user/<repo> prefixes when they match workspace-relative targets.

Activity

  1. added a commit that references this issue on Sep 1, 2026
    662ad75
  2. added
    enhancement
    issue-approved
    on Sep 8, 2026
  3. Vasanthdev2004 commented on Sep 8, 2026

    @Vasanthdev2004
    Collaborator

    Approved, with one constraint on the second half.

    The failure hint is the safe part and is welcome as is: a /home/... or root-like POSIX path that does not exist on a Windows host should say so in terms of the workspace root and the host OS, so the model stops retrying the same wrong shape.

    Silent path normalization is the risky part. A rewritten path can land on a real file the model did not mean, and then a read or write succeeds against the wrong target with no error to notice. If normalization goes in at all it should be narrow (the literal /home/<user> prefix mapped to the workspace, nothing broader), logged in the result so the substitution is visible, and covered by a test that a path resolving to something outside the workspace is refused rather than rewritten. The hint alone would be a good first PR.

  4. Vasanthdev2004 commented on Sep 12, 2026

    @Vasanthdev2004
    Collaborator

    Back in the pool, and still valid on current main.

    This came up in an audit of open issues whose only linked pull request had closed, which made them look covered to a query while nobody was actually working them. The earlier attempt closed without landing, so this is open for a fresh one.

    I verified the problem still exists rather than assuming it, and the audit verdict was independently re-checked before I posted this. The label is already on, so a PR implementing it can merge on review.

  5. Yan123-tech commented on Oct 8, 2026

    @Yan123-tech

    Taking this one, scoped to the hint-only first PR recommended above: when a tool on Windows receives a root-like POSIX path (/home/..., /tmp/..., or similar) that does not exist, the error message will name the workspace root and the host OS so the model stops retrying the same path shape. Path normalization stays out entirely, per the constraint.

    I'll develop and test on a native Windows machine, include regression tests, and note AI assistance in the PR description.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementissue-approved

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions