Upgrade Clients and Frontends
Read this page if your project calls an agent through eve/client, a frontend binding such as useEveAgent, SessionStore, or the HTTP API. Deploy the upgraded server first, because new clients call routes, such as POST /eve/v1/session/:sessionId/end, that older servers don't serve. Sections start with the changes most frontends need.
This page is part of Upgrade to 1.0.
Update frontend stores and hooks
| Before | After |
|---|---|
EveAgentStore | SessionStore |
host | baseUrl (required on a direct client; frontend default "") |
data.messages, data.agents, and other fields under data | view, messages, agents, events, session, status, error |
conversationReducer, defaultMessageReducer, EveAgentReducer | Query view with selectors from eve/events; read messages and agents |
transcriptReducer(options) | transcriptOf(events, options) |
followIdle: true | Omit followWhile |
followIdle: false | followWhile: (view) => !idle(view) || activeTurn(view) !== undefined |
| Busy status for a Stop control | activeTurn(view) |
Import idle and activeTurn from eve/events. The followIdle: false replacement also keeps following while a turn waits for a person.
messages shows only the current conversation, so messages from before a clear don't appear. view still holds every retained turn.
Save events and the cursor as they arrive, not only when a turn ends, so a turn paused for an approval survives a page reload. See Frontend.
Replace reset() with end()
Rename reset() to end() on client sessions, SessionStore, the React, Vue, and Svelte bindings, channel session handles, ChannelSource from eve/channels, and the Slack handler context (ctx.end()). end() resolves with a delivery.
Move HTTP callers from POST …/reset to POST …/end. The server still serves /reset, and the stream still records the control as source: { control: "reset" } on delivery.admitted.
end() retires the session permanently, and the handle keeps the retired ID. Don't use it for a New chat button. Choose the call that matches what the button should do:
| Goal | Call |
|---|---|
| Start a new conversation, and the store creates sessions | newSession() |
Start a new conversation, and you pass in your own session | Create a client session, as below, and bind a new store to it. newSession() only clears local state here. |
| Clear the model's context but keep the session | clear(). It cancels a running turn and stops its background tasks. |
| Close the conversation for good | end() |
See Session controls.
Read results from a delivery
A Delivery is the receipt for one message or control. send() and the session controls return it as soon as the server accepts the request, before the agent runs. Read the rest from the delivery:
delivery.result()waits for the outcome. Itsstatusiscompleted,awaiting-input,failed, orcancelled, and it describes this request, not the session. ChecksessionEndedto learn whether the session ended.delivery.stream()yields the events for this request.
Each read is independent and accepts a signal. Results don't include an events array, so read events from delivery.stream().
client.sessions.create() returns { session, delivery } when you pass a message, and { session } when you don't. See Client streaming.
Handle client errors by code
Every error from eve/client extends EveError and has a stable snake_case code. Narrow with each class's static is() instead of instanceof, so errors from a separately bundled copy of eve still match.
SessionNotActiveError has one of two codes:
session_not_ready, withretryable: true, when the server asks the client to try again. Retry the request.session_not_activeonce the session can't take requests. Start a new session.
ClientError.code is http_error when the server's response had no code.
Save the full session snapshot
session.state is the whole ClientSessionState, not only sessionId and streamIndex, and session.snapshot() returns the same state as snapshot.session. It includes an opaque inbox value that lets later sends skip a server-side session lookup. Save the complete state as is, and pass it back unchanged, for example with client.sessions.attach(saved.sessionId, saved). See Faster sends with inbox.
In server code, sessions.attach(id) from eve/server returns a read-only SessionReader with id and stream(), not a handle that can send. Use SessionInfo from eve/context for the metadata in ctx.session. See Read a session in process.
Check request shapes
- The eve channel rejects unknown top-level fields on session creation, message, and control requests with
400, naming the fields it accepts. Fix misspelled or unsupported options instead of relying on them being ignored. See the eve channel. historypassed tosend()orcreate()accepts onlyid,role, andtexton each entry, and an unknown field throwsInvalidSessionHistoryError. Map stored messages to that shape before you pass them.- Clients reject redirects by default. Point
baseUrlat the final destination, or setredirect: "manual". See Authentication. ctx.agent().send()file parts must be HTTP(S) URLs, not inline bytes or base64.
Flatten reconnect options
Replace streamReconnectPolicy with reconnect. Move the fields from streamOpenReconnectPolicy directly into reconnect, and rename retryableErrorStatuses to retryableStatuses. Defaults are unchanged. Use the ReconnectOptions type from eve/client instead of StreamReconnectPolicy or StreamReconnectRetryPolicy. See Reconnection.
To turn off automatic reconnects, replace streamReconnectPolicy: { reconnect: false } with reconnect: false.
Read agent info with an operator credential
GET /eve/v1/info and client.info() serve only operators: service and runtime callers, such as Vercel OIDC, jwtHmac(), or jwtEcdsa(), and local development through localDev(). Other callers, including web chat users, get 403 with code info_forbidden.
- Move browser calls to
client.info()to your server, or hardcode what they show. - To admit another credential, return
principalType: "service"orallowAgentInfo: truefrom its eve channel authenticator.allowAgentInfo: falsedenies a caller that would otherwise qualify. - The client reads an enum value it doesn't know as
"unrecognized". Handle that value when you switch on fields such asmodeorsourceKind. Fields namedkindgain values only with a new agent-info version.
eve eval against a deployment also needs an operator credential. See Agent info access.