From 8d89ac31ebe4d0d7da5d91e82f95139393e57d7f Mon Sep 17 00:00:00 2001 From: Ollie Agent Date: Sun, 2 Aug 2026 10:09:07 +0200 Subject: [PATCH] fs/session: fix agent files incorrectly reported as directories in rootOpen The rootOpen function in root.go had a bug where paths like 'session//agent//state' were split into 4 parts by strings.SplitN(name, "/", 4). An if len(parts) == 4 guard incorrectly returned 'state: is a directory', turning every agent file into a directory error. Removed the erroneous guard so the code falls through to NewAgentTree(...).Open(parts[3]), which correctly opens the agent's synthetic file. --- fs/session/root.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/session/root.go b/fs/session/root.go index b8036bc..3d3564f 100644 --- a/fs/session/root.go +++ b/fs/session/root.go @@ -525,9 +525,6 @@ func rootOpen(rs *rootState, name string) (File, error) { if ag == nil { return nil, fmt.Errorf("agent %s not found in session %s", parts[2], sessID) } - if len(parts) == 4 { - return nil, fmt.Errorf("%s: is a directory", parts[3]) - } al := sess.AgentLogFor(ag.ID()) if al == nil { return nil, fmt.Errorf("agent log not found for %s", parts[2])