From a7359fffcffad676a25aa3347d31d9ad90d7a62a Mon Sep 17 00:00:00 2001 From: Ollie Agent Date: Sat, 1 Aug 2026 21:06:26 +0200 Subject: [PATCH] fs/session: statewait must use h.ag.WaitChange, not Core.WaitChange Session.WaitChange delegates to a.Agent() (the active agent), so statewait was blocking on the WRONG agent's state changes. Agent.WaitChange uses per-agent changeCond, so it properly blocks until this specific agent's state actually changes. --- fs/session/files.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/session/files.go b/fs/session/files.go index 51c8180..11774e7 100644 --- a/fs/session/files.go +++ b/fs/session/files.go @@ -367,7 +367,7 @@ func (h *agentHelper) fileSpec(name string, mode os.FileMode) FileSpec { if base == "" { base = h.ag.State() } - v, ok := h.sess.Core.WaitChange(ctx, agent.WatchState, base) + v, ok := h.ag.WaitChange(ctx, agent.WatchState, base) if !ok { s := h.ag.State() return []byte(s + "\n"), s, nil