The ACP fake harness rejects valid working directories on macOS when
`/var/...` and `/private/var/...` refer to the same directory. Compare
filesystem identity with `os.Stat` and `os.SameFile` instead of
comparing path strings. Production code is unchanged.
Adds a discovery regression that probes through a symlinked working
directory. It reproduces the original harness error on Linux before the
fix and succeeds afterward.
Fixes
https://linear.app/codercom/issue/CODAGT-1450/flake-testdiscovery-multiple-variants
<details>
<summary>Implementation rationale and validation evidence</summary>
Filesystem identity accepts directory aliases while preserving rejection
of a different working directory or unexpected MCP servers. The
regression exercises the real ACP subprocess through `Manager.Reload`;
it skips Windows because creating symlinks requires developer mode or
administrator privileges.
The regression failed before the fix with `unexpected directory or MCP
configuration`. The complete ACP package passed 20 runs, plus 10 runs
with the race detector. Targeted standard and new-code golangci-lint
checks and `paralleltestctx` passed. Local validation ran on Linux. CI
passed, including Go tests on Linux, macOS, and Windows and the
race-enabled Go tests.
</details>
Generated by Coder Agents on behalf of @hugodutka.