Describe the Bug
Cloudflare deployments can fail to persist agent sessions when session history contains large inline image content.
In Flue 0.11.0, image bytes are redacted from runtime events/run history, but persisted session history still stores the full SessionData object as a single JSON string in flue_sessions.data via SqlSessionStore.save():
INSERT OR REPLACE INTO flue_sessions (id, data, updated_at)
VALUES (?, ?, ?)
On Cloudflare Durable Object SQLite, a single string/blob value is limited to 2MB. If a session contains a large image, or enough accumulated history, JSON.stringify(sessionData) can exceed that limit and the session save fails with:
Error: string or blob too big: SQLITE_TOOBIG
at SqlSessionStore.save
This can interrupt otherwise valid agent runs. The durable-session storage shape seems to need a more granular design, ideally one row per session entry plus externalized or chunked blob/image content for large attachments.
Expected Behavior
Flue should persist sessions containing large images or attachments without exceeding Cloudflare Durable Object SQLite’s per-cell string/blob limit.
A robust design might:
- Store session metadata separately from session entries.
- Store each
SessionEntry as its own row instead of one JSON blob for the whole session.
- Externalize or chunk large image/blob/document content referenced by an entry.
- Rehydrate externalized content on session load so model context remains unchanged.
- Delete associated externalized blobs when the session/session tree is deleted.
Steps to Reproduce
- Deploy a Cloudflare-target Flue agent using Durable Object SQLite persistence.
- Send a prompt/skill/task call with an attached image large enough that the persisted
SessionData JSON exceeds Cloudflare’s 2MB string/blob limit.
- Observe session persistence fail with
SQLITE_TOOBIG, for example:
Error: string or blob too big: SQLITE_TOOBIG
at SqlSessionStore.save
Describe the Bug
Cloudflare deployments can fail to persist agent sessions when session history contains large inline image content.
In Flue 0.11.0, image bytes are redacted from runtime events/run history, but persisted session history still stores the full
SessionDataobject as a single JSON string influe_sessions.dataviaSqlSessionStore.save():On Cloudflare Durable Object SQLite, a single string/blob value is limited to 2MB. If a session contains a large image, or enough accumulated history,
JSON.stringify(sessionData)can exceed that limit and the session save fails with:Error: string or blob too big: SQLITE_TOOBIG at SqlSessionStore.saveThis can interrupt otherwise valid agent runs. The durable-session storage shape seems to need a more granular design, ideally one row per session entry plus externalized or chunked blob/image content for large attachments.
Expected Behavior
Flue should persist sessions containing large images or attachments without exceeding Cloudflare Durable Object SQLite’s per-cell string/blob limit.
A robust design might:
SessionEntryas its own row instead of one JSON blob for the whole session.Steps to Reproduce
SessionDataJSON exceeds Cloudflare’s 2MB string/blob limit.SQLITE_TOOBIG, for example:Error: string or blob too big: SQLITE_TOOBIG at SqlSessionStore.save