Flisk's Agent Resource: Durable Agents With Sessions You Can Restart
An agent is a process that holds a conversation. Restart the process and the conversation can disappear, unless something saves it. Flisk's agent resource type is built for that case. It scaffolds an agent service with durable checkpoints, routes each conversation by session, and drains in-flight turns before shutdown. This article covers the resource type. The series continues with tools,…
Flisk provides a resource type for creating durable agents with session-aware conversations. When you restart the process, the conversation is preserved thanks to durable checkpoints. The agent service is scaffolded with Traefik routing by session, ensuring concurrent conversations are kept separate. Upon graceful shutdown, in-flight turns complete and commit before stopping.
To use Flisk, you declare the agent settings in service.json, specifying the runtime as custom for plain Bun or Node code. The checkpoint is stored in a Docker volume, which must be removed manually to prevent accidental data loss. Requests include the x-session-id header, allowing Traefik to route by session. Flisk provides two health routes, /health and /ready, to verify checkpoint accessibility.
Your agent code only needs to implement the runTurn(checkpoint, input) function, where you call the model provider and return the response. Flisk handles checkpoint loading, appending user messages, committing atomic updates, and returning the reply. You write the custom logic for model calls and prompts evaluation. Flisk does not manage prompts, model selection, or state storage cost, as these depend on your agent framework.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.