Skip to content

ADR-0027 — Thread listing is a function taking the saver

  • Status: Accepted
  • Date: 2026-11-13
  • Supersedes: none
  • Authors: project maintainers

Context

Thread listing is the one convenience read that ships (ADR-0025). It has one read and no state of its own, and it reads no stored value, so it needs neither the serde nor the patch decoder.

Decision

Listing will be a module-level function taking the saver, alist_threads(saver, *, filter, before, limit), yielding ThreadInfo(config, metadata, created_at), in listing.py and exported from the package. There is no companion class, no graph and no langgraph dependency; one statement per page; no fence token in returned configs.

Alternatives considered

  • A companion class — rejected: it would hold only the saver.
  • A method on the saver — rejected: the saver stays the BaseCheckpointSaver contract.
  • A token in the returned config — rejected: listing is not a run's read, and a token there could only act when the thread is gone, turning the application's next ainvoke into a ThreadConflictError.

Consequences

  • Parameters mirror alist's: before is a ThreadInfo.config from an earlier page.
  • Each page is one snapshot; pages together are not.
  • The sync saver gets list_threads(saver, …) (architecture.md §9).

References