fix(agent/agentcontext): canonicalize scan root in symlink boundary check (#26175)

This commit is contained in:
Kyle Carberry
2026-06-09 19:21:55 -07:00
committed by GitHub
parent deb6eec68b
commit cc9f10fbf2
4 changed files with 18 additions and 8 deletions
+5 -5
View File
@@ -67,8 +67,8 @@ func TestManager_InitialSnapshotIsPopulated(t *testing.T) {
func TestManager_AddSourceTriggersResolve(t *testing.T) {
t.Parallel()
wd := t.TempDir()
src := t.TempDir()
wd := testutil.TempDirResolved(t)
src := testutil.TempDirResolved(t)
mustWriteFile(t, filepath.Join(src, "AGENTS.md"), "from source")
m := newTestManager(t, agentcontext.ManagerOptions{
@@ -194,7 +194,7 @@ func TestManager_RemoveSource(t *testing.T) {
func TestManager_HasSource(t *testing.T) {
t.Parallel()
wd := t.TempDir()
src := t.TempDir()
src := testutil.TempDirResolved(t)
m := newTestManager(t, agentcontext.ManagerOptions{
WorkingDir: func() string { return wd },
@@ -285,7 +285,7 @@ func TestManager_ResyncCanceledKeepsLiveSnapshot(t *testing.T) {
func TestManager_InitialSourcesSeeded(t *testing.T) {
t.Parallel()
wd := t.TempDir()
src := t.TempDir()
src := testutil.TempDirResolved(t)
mustWriteFile(t, filepath.Join(src, "AGENTS.md"), "from initial")
m := newTestManager(t, agentcontext.ManagerOptions{
@@ -312,7 +312,7 @@ func TestManager_InitialSourcesSeeded(t *testing.T) {
func TestManager_SeedSourcesLateBindsAfterManifest(t *testing.T) {
t.Parallel()
wd := t.TempDir()
late := t.TempDir()
late := testutil.TempDirResolved(t)
mustWriteFile(t, filepath.Join(late, "AGENTS.md"), "late binding")
// AllowedRoots intentionally omits `late` so AddSource