Sessions
Durable execution — configure turn limits, memory, and human approval for your agent's sessions.
Every run of a Zett agent happens inside a Cencori session. A session is the durable unit of execution: it holds the conversation, survives across turns, and is where memory and human-in-the-loop approvals live. Zett creates and drives sessions through the Cencori Sessions API on your behalf.
Configuring sessions
Add agent/sessions/config.ts with a default-exported SessionConfig:
// agent/sessions/config.ts
export default {
maxTurns: 50,
idleTimeoutMs: 300_000,
requireApproval: false,
memory: {
strategy: "lastN",
limit: 20,
},
};Fields
interface SessionConfig {
maxTurns?: number; // cap turns in a single session
idleTimeoutMs?: number; // auto-close after inactivity
requireApproval?: boolean; // pause for human approval before tool calls
memory?: {
strategy: "lastN" | "summary" | "keyFacts";
limit?: number;
};
}Durable execution
Because the session lives on Cencori, work isn't lost between turns. A session can
pause — waiting for the next user message, or for an approval — and resume later
with its full context intact. The runtime surfaces these transitions as
protocol events: session.waiting when it's idle awaiting
input, session.completed when it ends.
Human-in-the-loop
Setting requireApproval: true routes tool calls through Cencori's approval flow:
the session pauses and emits an approval-required state, and a human approves or
rejects the action before it runs. This is the same Sessions approval mechanism
Cencori exposes to its gateway customers.
Session creation, turn submission, and streaming are wired today through the
Cencori Sessions API (POST /v1/sessions, POST /v1/sessions/:id/turns). Approval
gating and memory strategies are enforced by Cencori at run time. See
Running agents.