You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
webchat: 'agent is working' spinner never clears after reply #28
After the agent replies in the webchat, the agent is working ●●● indicator stays on screen indefinitely, even though the answer has already been rendered.
Seen on a live gateway (v0.0.11) with the agent-micro runner; the same should apply to any runner that keeps the agent process alive between messages.
Why
In src/webchat.html, the agent.output handler clears the typing indicator, renders the result, then immediately turns the indicator back on, expecting the final res frame to clear it:
if(frame.type==='event'&&frame.event==='agent.output'){setTyping(false);if(frame.payload.result)add('agent',frame.payload.result);setTyping(true);// <-- stays on until the res frame}elseif(frame.type==='res'){
...
setTyping(false);}
But the res frame for chat.send is only sent when runContainerAgent() resolves — and that promise resolves when the agent process exits. Agents deliberately stay alive after answering, polling for follow-up IPC messages until the _close sentinel or the 30-minute containerTimeout. So in normal operation the res arrives ~30 minutes after the reply, and the spinner spins the whole time.
Possible fixes
Treat a status: "success" / status: "error"agent.output event as end-of-turn in the webchat and clear the indicator there (smallest change, webchat-only).
Or send the chat.sendres when the first terminal output arrives rather than on process exit (changes gateway semantics for all WS clients — raw clients currently have the same problem, they cannot await res per turn).
Repro
npx jsclaw gateway, open the chat URL
Send any message
Reply renders; agent is working ●●● remains until the container exits
Activity