Skip to content

fix: clear webchat spinner when the agent turn completes - #30

Merged
melvincarvalho merged 1 commit into
mainfrom
issue-28-webchat-spinner
Jun 11, 2026
Merged

melvincarvalho merged 1 commit into
mainfrom
issue-28-webchat-spinner

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Fixes #28

Each agent.output event is a completed turn — ContainerOutput.status is always success or error. But the webchat re-armed the spinner after rendering the reply and waited for the chat.send res frame, which the gateway only sends when the container process exits (close sentinel or 30-minute idle timeout). Result: agent is working ●●● spun forever after every answer.

Changes in src/webchat.html:

  • Clear the typing indicator on the agent.output event itself instead of re-arming it.
  • Render status: "error" outputs in the feed (error message) — previously they were invisible until container exit, masked behind the stuck spinner.

The res handler keeps its setTyping(false) as a belt-and-braces cleanup.

Tested: full suite passes (119/119); verified live against a gateway with the agent-micro runner where the container deliberately stays alive between turns.

Each agent.output event is a completed turn (status is always success
or error), but the spinner was re-armed after rendering and waited for
the chat.send res frame — which the gateway only sends when the
container exits (close sentinel or idle timeout), so it spun forever.

Clear the spinner on the output event itself, and surface error
outputs in the feed (they were previously invisible until exit).
@melvincarvalho
melvincarvalho merged commit f104f34 into main Jun 11, 2026
@melvincarvalho
melvincarvalho deleted the issue-28-webchat-spinner branch June 11, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

webchat: 'agent is working' spinner never clears after reply

1 participant