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 ticket queue — claiming the next ticket, advancing it through the workflow, and handling failure or escalation cases. The queue is priority-ordered: blocking tickets are always dispensed before high, then normal, then low. Within the same priority, older tickets come first.

Ticket status flow

Tickets move through a defined set of statuses. The diagram below shows the normal transitions:
pending

  └──► in_progress   (via get_top_error)

         ├──► done         (via resolve)
         ├──► failed       (via fail)
         └──► needs_human  (via escalate)

in_progress ──► pending    (via reassign — puts it back in the queue)
pending     ──► pending    (via retry_bug — increments attempts, resets status)
blocked is a valid status value in the data model but is not set by any public lifecycle function — it is available for custom workflows that set it directly through propose_fix or external tooling.

get_top_error

Claims the highest-priority pending ticket for the named repository, sets its status to in_progress, stamps dispensed_at with the current UTC time, and returns the ticket dict. Returns None when there are no pending tickets.
ticket = issueloop.get_top_error("myrepo")
if ticket:
    # work on ticket["id"]
    issueloop.resolve(ticket["id"])
repo_name
str
required
Name of the repository to pull from.
Returns a ticket dict (see Ticket object shape) or None.

get_all_errors

Returns all open (non-done, non-in_progress) tickets, optionally filtered to one repository. Does not change any ticket state.
open_tickets = issueloop.get_all_errors("myrepo")
repo_name
str
Optional repository filter. Pass None or omit to return open tickets across all repos.
Returns a list of ticket dicts.

resolve

Marks a ticket as done. Call this after your code fix has been verified.
issueloop.resolve(ticket_id)
ticket_id
str
required
UUID of the ticket to resolve.
Returns None. The update is committed to the database immediately.

fail

Marks a ticket as failed without escalating or retrying. Use this when you want to record that an attempt was made but you do not intend to retry automatically.
issueloop.fail(ticket_id)
ticket_id
str
required
UUID of the ticket to mark failed.
Returns None.

escalate

Marks a ticket as needs_human and stores the reason in escalation_summary. Also fires a notification via the configured webhook (if any) so your team is alerted.
issueloop.escalate(ticket_id, reason="Repeated failures — needs manual investigation")
ticket_id
str
required
UUID of the ticket to escalate.
reason
str
default:"\"\""
Human-readable description of why escalation was triggered. Stored in ticket["escalation_summary"].
Returns the updated ticket dict, or None if the ticket was not found.

reassign

Resets a ticket from in_progress back to pending without incrementing the attempt counter. Useful when a worker crashes or is interrupted before completing its work.
issueloop.reassign(ticket_id)
ticket_id
str
required
UUID of the ticket to put back in the queue.
Returns the updated ticket dict, or None if the ticket was not found.
Use reap_stale_bugs() from the Database API to automatically reassign tickets that have been in_progress for too long — useful for agent crash recovery in long-running loops.

retry_bug

Increments the ticket’s attempts counter and resets its status to pending. Use this when an automated fix attempt fails but more retries are warranted.
issueloop.retry_bug(ticket_id)
ticket_id
str
required
UUID of the ticket to retry.
Returns the updated ticket dict (with the incremented attempts value), or None if the ticket was not found.

get_bug_attempts

Returns the current attempt count for a ticket without modifying any state.
count = issueloop.get_bug_attempts(ticket_id)
ticket_id
str
required
UUID of the ticket to inspect.
Returns an int — the number of attempts recorded — or None if the ticket does not exist.

bulk_resolve

Resolves a list of tickets in a single call. Each ticket is marked done in sequence. Useful for closing out a batch of tickets after a sweeping fix.
count = issueloop.bulk_resolve(["id-1", "id-2", "id-3"])
ticket_ids
list
required
List of ticket UUID strings to resolve.
Returns an int — the number of tickets that were resolved (equal to len(ticket_ids)).

Build docs developers (and LLMs) love