Web Chat#
The web chat interface provides real-time conversation with managed agents through the Lens Agents dashboard.
Connection#
Web chat uses a persistent WebSocket connection for real-time messaging. The connection is authenticated using your session credentials.
Connection lifecycle#
- Connect — WebSocket connection is established when you open the agent's chat tab
- Authenticate — your session token is validated on the server
- Ready — bidirectional messaging begins
- Keep-alive — a 30-second ping/pong cycle detects dead connections. If the server does not respond to a ping within the interval, the client initiates reconnection
- Disconnect — connection closes when you navigate away or lose network
Reconnection#
If the connection drops, the client automatically reconnects:
- Up to 10 reconnection attempts
- 3-second interval between attempts
- Messages sent during disconnection are queued and delivered when the connection is restored
- After 10 failed attempts, the client stops retrying and shows an error state
Connection status indicators#
The chat interface shows the current connection state:
| Status | Meaning |
|---|---|
| Connecting | WebSocket connection in progress |
| Connected | Active connection, ready for messages |
| Disconnected | Connection lost, reconnection in progress |
| Error | Reconnection failed after all attempts |
Messaging#
Message processing#
Messages are processed in strict FIFO (first-in, first-out) order per user. If you send multiple messages before the agent responds, they are queued and processed sequentially. The agent finishes responding to the first message before starting on the second.
Multiple concurrent WebSocket connections from the same user are supported — messages appear on all connected sessions.
Message modes#
| Mode | Behavior |
|---|---|
| followup | Standard message, queued and processed in order |
| steer | Sent while the agent is processing, intended to redirect the agent's response |
| collect | Batch multiple messages before the agent starts processing |
Typing indicators#
While the agent is processing your message, a typing indicator is shown. For longer operations (running kubectl commands, querying APIs), the agent streams intermediate updates so you can see what it is doing.
Tool call visualization#
When the agent uses tools during a conversation, each tool call is shown inline:
- Tool name and parameters are displayed
- Tool output is shown (truncated for large results)
- You can see the agent's reasoning process step by step
Markdown rendering#
Agent responses are rendered as Markdown, including:
- Code blocks with syntax highlighting
- Tables, lists, and headers
- Links to external resources
Thread management#
Conversations are organized into threads:
- Each agent has one active thread per user
- Previous threads are archived and accessible from the thread history
- Threads persist across sessions — you can close the browser and resume later
- Daily session reset — threads reset at a configurable time (default: 4 AM local timezone)
Conversation compaction#
For long-running conversations, older messages are automatically summarized:
- The most recent 20 messages are kept in full
- Older messages are compressed into a summary
- The agent retains context without exceeding token limits
Sync with Slack#
Web chat and Slack are synchronized:
- Messages sent via web chat are delivered to Slack (if connected in personal mode)
- Messages sent via Slack DM appear in web chat
- The agent's responses appear in both places simultaneously
- Thread context is shared — the agent knows the full conversation regardless of which channel a message came from
Using web chat#
Every managed agent has a web chat interface on the platform. Users type messages, paste code blocks, share error logs, or ask multi-part questions; the agent processes each in order. Web chat and Slack DMs share the same conversation history — messages sent in one surface immediately in the other.
Related#
- Slack integration — channel and DM interaction
- Creating a managed agent — getting started with managed agents
- Memory and learning — how agents retain context across conversations