Skip to main content

Composition configuration

Agent context

Pass an agent block to tune what the chat loop sends to the model. All fields are optional.
  • toolOutputCap caps a single tool result before it reaches the model, so a runaway host response can’t blow the context window. Defaults to 32000 characters. Pass 0 to disable the cap. Persistence and the streamed thread are unaffected — only the copy sent to the model is truncated.
  • maxOutputTokens bounds tokens the model may emit per turn. Omit to defer to the model default.
  • historyWindow bounds how many past messages are re-sent to the model each turn. Vendo keeps whole messages so tool-call/result pairs stay paired. Omit to send the full thread (current behavior). The stored thread is untouched; only the per-turn model context shrinks.

Base path

The wire mounts under one base path, default /api/vendo. Configure createVendoClient({ baseUrl }) when mounting elsewhere. Rung 4 HTTP app UI is not proxied through this base.

Identity

Every wire request passes through principal(req). The returned Principal.subject scopes threads, apps, approvals, grants, activity, and runs. Ephemeral principals never write to disk. principal(req) must return kind: "user" (or null). Returning kind: "org" or a subject that starts with vendo: is rejected at the wire — those identities are Vendo-owned. See Principals and organizations. When principal(req) returns null, Vendo issues an anonymous session cookie. The first authenticated request afterward merges the anonymous session’s threads, apps, and state into the signed-in user; grants, approvals, connected accounts, and history stay put.

CSRF floor

Cookie-authenticated state-changing requests require Content-Type: application/json. The exhaustive exceptions are binary /apps/import, signed /webhooks/:source, and bearer-authenticated /tick.

Error envelope

Every non-2xx response has this shape:
The fixed map is validation 400, not-found 404, blocked 403, conflict 409, cloud-required 402, and sandbox-unavailable or not-implemented 501. MCP door paths are the exception; they speak MCP and OAuth response shapes.