Files
coder/agent/agentcontext
Dean Sheather 74cafeb29a fix(agent/agentcontext): enforce symlink boundary for single-file sources (#31919)
`discoverIn` checked scan roots with `os.Stat`, so a single-file source
(for example `/repo/AGENTS.md`) that is a symlink looked like a regular
file and skipped the symlink boundary check in `resolveReadTarget`.
Directory roots were already covered because they use `ReadDir` entries.

`discoverIn` now uses `os.Lstat`. A symlinked single-file root is
validated against the link's parent directory: targets outside it return
`StatusInvalid` with an empty payload, matching directory-root behavior,
and broken links return `StatusUnreadable`. Symlinks to directories are
still scanned as directory roots.

Fixes CODAGT-1510.

> Generated by Coder Agents on behalf of @deansheather.
2026-11-30 21:30:06 +11:00
..
…