[Workshop] Wire visitor input bar to Timmy AI (free chat reply) #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & Why
The Workshop input bar says "Say something to Timmy…" but Timmy never responds. Typing sends a
visitor_messageover WebSocket which only broadcasts the text to other visitors — no AI is involved and no speech bubble appears. This is the most visible demo gap: the first thing anyone tries is talking to Timmy, and nothing happens.Fix: route
visitor_messagethrough the AI on the server side, then send the result back as atype: "chat", agentId: "timmy"message. On the frontend, timmy chat events triggersetSpeechBubble()so Timmy visibly responds.Done looks like
Out of scope
Tasks
events.ts, whenvisitor_messagearrives, callagentService.chatReply()in a fire-and-forget background task. Broadcast the visitor's message immediately, then broadcast the AI reply as{ type: "chat", agentId: "timmy", text }. Apply per-visitor in-memory rate limit (3 req/min).{ type: "agent_state", agentId: "gamma", state: "working" }to make the crystal ball pulse; reset toidleafter reply.websocket.js, when achatevent arrives withagentId === "timmy", callsetSpeechBubble(text)fromagents.js.ui.js, addkeydownlistener on#visitor-inputto submit on Enter (it currently only has the send button).Relevant files
artifacts/api-server/src/routes/events.tsartifacts/api-server/src/lib/agent.tsthe-matrix/js/websocket.jsthe-matrix/js/agents.jsthe-matrix/js/ui.js