Advanced Runtime
The workshop so far used the terminal and Slack, but both are clients of the same durable session model. This section connects the pieces and shows where custom real-time experiences fit.
The execution model
| Concept | Meaning |
|---|---|
| Session | A durable conversation with history, state, and a session-scoped sandbox |
| Turn | One user input and the agent work it triggers |
| Step | A checkpointed unit such as a model call or tool execution |
| Channel | The transport that starts, resumes, and renders a session |
The default harness manages model calls, context compaction, tool execution, and pauses. Vercel Workflow checkpoints the durable run beneath it.
- Completed steps are replayed from their recorded result after a restart.
- A step interrupted mid-execution may run again, so side effects still need idempotency.
- Approvals, questions, connection sign-ins, and subagents can park without holding compute.
- When input arrives, the run resumes at the waiting boundary.
You write agent capabilities, not Workflow primitives.
Two session handles
The public API exposes two different handles:
continuationTokenresumes the conversation with the next user message.sessionIdattaches to the durable event stream for rendering and inspection.
The token changes as the session progresses. A client should wait for session.waiting, use the current continuation token for one follow-up, and then wait again.
Drive the same agent over HTTP
Start a session:
curl -X POST http://127.0.0.1:2000/eve/v1/session \
-H 'content-type: application/json' \
-d '{"message":"Triage the sign-in issue for acct_123."}'Stream its newline-delimited events:
curl http://127.0.0.1:2000/eve/v1/session/<sessionId>/streamThe stream includes model steps, tool calls, tool results, approvals, incremental text, usage, failures, and the final session.waiting boundary. A client can reconnect from an event index without restarting the work.
Add a WebSocket channel
Custom channels live under agent/channels/. A WebSocket surface can use the same send helper as HTTP or Slack:
import { defineChannel, WS } from "eve/channels";
export default defineChannel({
routes: [
WS("/support/ws", async (_request, { send }) => ({
async message(_peer, message) {
await send(message.text(), {
auth: null,
continuationToken: "support-demo",
});
},
})),
],
});In a production channel, derive the continuation token from an authenticated conversation or user identity rather than hard-coding it. Authenticate the upgrade request and keep your own queue if a surface can send bursts while a turn is active.
Channel-agnostic sessions
Channels normalize inbound input and own delivery, but the agent loop stays the same. That is why one agent/ directory can serve:
- a terminal UI during development
- Slack mentions and direct messages
- a web chat built with
useEveAgent() - HTTP and WebSocket clients
- scheduled or proactive work
A custom channel can also hand work to another channel—for example, an incident webhook can open a Slack investigation thread without creating a separate agent implementation.
Explore next
- Add a
skillfor a support escalation playbook. - Add a specialist
subagentfor log analysis. - Add a scheduled daily incident summary.
- Replace the workshop stub with an idempotent ticketing integration.
- Build a web client that renders streamed events and approval prompts.