fs/session: fix agent files incorrectly reported as directories in rootOpen

The rootOpen function in root.go had a bug where paths like
'session/<id>/agent/<aid>/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.
This commit is contained in:
Ollie Agent 2026-08-02 10:09:07 +02:00
parent d9c2c4c7a3
commit 8d89ac31eb
1 changed files with 0 additions and 3 deletions

View File

@ -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])