Skip to main content

Documentation 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.

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 at 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.
removed = issueloop.cleanup()
removed = issueloop.cleanup(older_than_days=7, repo="myrepo", statuses=["done"])
older_than_days
int
Delete tickets older than this many days. Defaults to the retention_days value from config (default 30).
repo
str
Optional repository filter. None cleans up tickets across all repos.
statuses
list
List of status strings to consider for deletion. Defaults to ["done", "failed"]. Only tickets in one of these statuses are eligible.
Returns an 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.
removed = issueloop.purge_repo("myrepo")
repo
str
required
Name of the repository whose tickets should be deleted.
Returns an 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.
stats = issueloop.get_database_stats()
stats_for_repo = issueloop.get_database_stats(repo="myrepo")
repo
str
Optional repository filter. None returns stats across all repos.
Returns a dict with:
database
str
The configured backend type, e.g. "local".
total_bugs
int
Total ticket count in the filtered scope.
by_status
dict
Mapping of status string to ticket count. Only statuses with at least one ticket appear.
db_size_bytes
int
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.
path = issueloop.export_bugs()
path = issueloop.export_bugs(repo="myrepo", path="/tmp/myrepo_bugs.json")
repo
str
Optional repository filter. None exports all tickets.
path
str
Output file path. Defaults to data/logs/bug_export.json. Parent directories are created if they do not exist.
Returns a 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 in in_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.
reaped = issueloop.reap_stale_bugs()
reaped = issueloop.reap_stale_bugs(older_than_minutes=60, repo="myrepo")
older_than_minutes
int
default:"30"
Tickets that have had dispensed_at set for longer than this many minutes are eligible for reaping.
repo
str
Optional repository filter.
Returns an 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 to run_<repo>.YYYYMMDDTHHMMSSZ.jsonl.bak and the read cursor is reset so the next create_tickets call starts fresh.
# Rotate logs for all repos (only archives if above threshold)
results = issueloop.rotate_logs()

# Rotate one repo with a custom size limit
results = issueloop.rotate_logs(repo_name="myrepo", max_size_mb=5.0)
repo_name
str
Optional repository name. When provided, only that repo’s log is checked. When omitted, all repos in the manifest are checked.
max_size_mb
float
default:"10.0"
Size threshold in megabytes. A log file must exceed this size to be archived. Files at or below the threshold are left untouched.
Returns a dict mapping repo name to True (archived) or False (no rotation needed).
Schedule cleanup() and reap_stale_bugs() on a regular interval in long-running agent loops. A cron-style wrapper that calls these every hour prevents the SQLite file from growing indefinitely and ensures crashed workers do not permanently hold tickets.

Build docs developers (and LLMs) love