NousResearch/hermes-agent · error
Session transcript exceeds the Desktop safe-load limit; use
Error message
Session transcript exceeds the Desktop safe-load limit; use the Web Dashboard export for this session.
What it means
Thrown by getAllSessionMessages() in apps/desktop/src/hermes.ts:737 when the accumulated JSON size of a session's transcript (paged at 500 messages, order 'oldest') exceeds maxJsonChars (default 32,000,000 characters). This is a deliberate protective cap: loading an unbounded transcript into the renderer would exhaust memory and freeze the app. The error tells the user to use the Web Dashboard's export for that session instead.
Source
Thrown at apps/desktop/src/hermes.ts:737
const messages: SessionMessage[] = []
const pageSize = 500
const maxJsonChars = options.maxJsonChars ?? 32_000_000
let jsonChars = 0
let offset = 0
let resolvedSessionId = id
while (true) {
const page = await getSessionMessages(id, profile, {
limit: pageSize,
offset,
order: 'oldest'
})
resolvedSessionId = page.session_id
jsonChars += (JSON.stringify(page.messages) ?? '').length
if (jsonChars > maxJsonChars) {
throw new Error(
'Session transcript exceeds the Desktop safe-load limit; use the Web Dashboard export for this session.'
)
}
messages.push(...page.messages)
// Legacy backends ignore pagination and return the full transcript.
if (!page.pagination || page.messages.length === 0 || page.messages.length < page.pagination.limit) {
break
}
offset += page.messages.length
}
return { session_id: resolvedSessionId, messages }
}
export function deleteSession(id: string, profile?: string | null): Promise<{ ok: boolean }> {View on GitHub (pinned to c896c09c42)
Solutions
- For that session, use the Web Dashboard export instead of the desktop full-transcript load.
- Load incrementally: call getSessionMessages(page) with limit/offset and render a windowed list rather than getAllSessionMessages.
- If you must load more and accept the memory risk, pass a larger options.maxJsonChars explicitly.
- Trim the session (delete bulky old messages / start a new session) if desktop full-history viewing is a hard requirement.
Example fix
// before
const all = await getAllSessionMessages(sessionId) // throws past 32 MB
// after — windowed paging
const first = await getSessionMessages(sessionId, profile, { limit: 500, offset: 0, order: 'oldest' })
// or explicit cap bump when the caller accepts the cost:
const all = await getAllSessionMessages(sessionId, profile, { maxJsonChars: 64_000_000 }) Defensive patterns
Strategy: try-catch
Validate before calling
const SOFT_LIMIT = 32_000_000 // pre-check via a lightweight estimate: fetch only the latest page first const latest = await getLatestSessionMessages(id, profile) // if backend reports totals, compare before attempting the full walk
Try / catch
try {
const all = await getAllSessionMessages(id, profile)
} catch (e) {
if (e instanceof Error && e.message.includes('safe-load limit')) {
// route the user to the Web Dashboard export; do NOT retry with a huge cap blindly
offerDashboardExport(id)
} else throw e
} Prevention
- Prefer paged/windowed rendering via getSessionMessages over getAllSessionMessages
- Treat the 32 MB default as a memory guard, not a bug
- Only raise maxJsonChars deliberately for a known session on capable hardware
- For archival needs, use the dashboard export instead of loading into the renderer
When it happens
Trigger: Opening a session whose cumulative messages JSON exceeds 32 MB (measured with JSON.stringify per page); calling getAllSessionMessages with many pages until the counter passes the cap; calling with a custom smaller maxJsonChars option.
Common situations: Long-running agent sessions with huge tool outputs or base64 attachments; sessions shared across CLI/gateway surfaces that grew for weeks; importing old session databases; a user clicking a giant pinned session in the desktop transcript view.
Related errors
- That project has no folder to move into
- gh pr create failed (is gh installed and authenticated?)
- Branch name is required.
- Secure token storage is unavailable (no OS keyring service w
- Failed to encrypt the remote gateway token for secure storag
AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14).
Data as JSON: /api/errors/7458005366fc35a1.
Report an issue: GitHub.