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.
This commit is contained in:
Ollie Agent 2026-08-01 21:06:26 +02:00
parent 3f61a8929a
commit a7359fffcf
1 changed files with 1 additions and 1 deletions

View File

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