Skip to content

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

Description

@euxaristia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions