> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Session Persist Failed Input • AI Agent SDK

> SessionPersistFailedInput: Input for SESSION_PERSIST_FAILED hooks (a durable session write failed).

# SessionPersistFailedInput

> Defined in the [**events**](../modules/events) module.

<Badge color="blue">AI Agent</Badge>

Input for SESSION\_PERSIST\_FAILED hooks (a durable session write failed).

Fired by the session store when an `add_message`/`set_chat_history`
write cannot be persisted (disk-full, SQLite/FTS corruption, permission /
`OSError`). Instead of losing the already-produced turn silently, the
store spills it to an atomic fallback file and fires this hook so operators
can observe/route the failure (metrics, alerting, forensics) — mirroring the
`MESSAGE_UNDELIVERED` posture on the outbound side (Issue #3597).

`spilled` reports whether the last-resort fallback write itself
succeeded; `spill_path` is the file the turn was salvaged to (when any).

## Properties

<ResponseField name="role" type="str">
  No description available.
</ResponseField>

<ResponseField name="content" type="str">
  No description available.
</ResponseField>

<ResponseField name="error" type="str">
  No description available.
</ResponseField>

<ResponseField name="spilled" type="bool">
  No description available.
</ResponseField>

<ResponseField name="spill_path" type="Optional[str]">
  No description available.
</ResponseField>

<Accordion title="Internal & Generic Methods">
  * **to\_dict**: Generic utility method.
</Accordion>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/hooks/events.py#L144">
  `praisonaiagents/hooks/events.py` at line 144
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Session Management" icon="clock" href="/docs/docs/concepts/session-management" />

  <Card title="Sessions Feature" icon="folder" href="/docs/docs/features/sessions" />

  <Card title="Session Persistence" icon="database" href="/docs/docs/features/session-persistence" />
</CardGroup>
