Thread management using LangGraph's built-in checkpoint persistence.
Format ISO timestamp for display (e.g., 'Dec 30, 6:10pm').
Format ISO timestamp as relative time (e.g., '5m ago', '2h ago').
Format a filesystem path for display.
Paths under the user's home directory are shown relative to ~.
All other paths are returned as-is.
Get path to global database.
The result is cached after the first successful call to avoid repeated filesystem operations.
Generate a new thread ID as a full UUID7 string.
List threads from checkpoints table.
Populate message_count for an existing thread list.
This is used by the /threads modal to render rows quickly, then backfill
counts in the background without issuing a second thread-list query.
Populate checkpoint-derived fields for an existing thread list.
This is used by the /threads modal to enrich rows in one background pass,
so the latest checkpoint is fetched and deserialized at most once per row.
Prewarm thread selector cache for faster /threads open.
Fetches a bounded list of recent threads and populates checkpoint-derived fields for currently visible columns into the in-memory cache. Intended to run in a background worker during app startup.
Get cached recent threads, if available.
Apply cached message counts onto thread rows when freshness matches.
Apply cached initial prompts onto thread rows when freshness matches.
Populate initial_prompt for thread rows in the background.
Get most recent thread_id, optionally filtered by agent.
Get agent_name for a thread.
Check if a thread exists in checkpoints.
Find threads whose IDs start with the given prefix.
Delete thread checkpoints.
Get AsyncSqliteSaver for the global database.
Read the thread listing limit from DA_CLI_RECENT_THREADS.
Falls back to _DEFAULT_THREAD_LIMIT when the variable is unset or contains
a non-integer value. The result is clamped to a minimum of 1.
CLI handler for deepagents threads list.
Fetches and displays a table of recent conversation threads, optionally filtered by agent name or git branch.
CLI handler for: deepagents threads delete.