These functions manage the IssueLoop ticket store over time — pruning old resolved tickets, recovering stale in-progress claims, exporting data, and rotating large log files. The default backend is a local SQLite file atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/onenot8/issueLoop/llms.txt
Use this file to discover all available pages before exploring further.
data/issueloop.db. All functions that modify the database commit immediately.
cleanup
Deletes tickets that have been in a terminal status (done or failed by default) for longer than the retention period. This is the primary housekeeping function for long-running agent deployments.
Delete tickets older than this many days. Defaults to the
retention_days value from config (default 30).Optional repository filter.
None cleans up tickets across all repos.List of status strings to consider for deletion. Defaults to
["done", "failed"]. Only tickets in one of these statuses are eligible.int — the number of tickets that were deleted.
purge_repo
Deletes all tickets for a repository, regardless of status or age. Use with care — this is irreversible.Name of the repository whose tickets should be deleted.
int — the number of tickets deleted.
get_database_stats
Returns a summary of the ticket store, including per-status counts and (for the local SQLite backend) the file size on disk.Optional repository filter.
None returns stats across all repos.The configured backend type, e.g.
"local".Total ticket count in the filtered scope.
Mapping of status string to ticket count. Only statuses with at least one ticket appear.
SQLite file size in bytes. Present only when using the
"local" backend.export_bugs
Exports all tickets (or tickets for one repo) to a JSON file and returns the path to that file.Optional repository filter.
None exports all tickets.Output file path. Defaults to
data/logs/bug_export.json. Parent directories are created if they do not exist.str — the absolute path of the file that was written. The file contains a JSON array of ticket dicts (same shape as the Ticket object).
reap_stale_bugs
Finds tickets that have been inin_progress status for longer than older_than_minutes minutes and resets them to pending. This handles the case where a worker process claimed a ticket and then crashed or was killed before finishing.
Tickets that have had
dispensed_at set for longer than this many minutes are eligible for reaping.Optional repository filter.
int — the number of tickets reset to pending.
rotate_logs
Archives the JSONL run log for one or all repositories when it exceeds the size threshold. The active log is renamed torun_<repo>.YYYYMMDDTHHMMSSZ.jsonl.bak and the read cursor is reset so the next create_tickets call starts fresh.
Optional repository name. When provided, only that repo’s log is checked. When omitted, all repos in the manifest are checked.
Size threshold in megabytes. A log file must exceed this size to be archived. Files at or below the threshold are left untouched.
True (archived) or False (no rotation needed).