Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

st agents has no freshness window — reports stale status as live #102

Description

@schickling-assistant

Problem

st agents reports an identity's status value verbatim, with no freshness window. A status file written days ago reads exactly like one written a second ago.

Consumers that apply a staleness rule and consumers that do not therefore disagree about the same identity at the same moment.

Evidence

Same host, same instant, one identity whose provider had been dead for roughly three minutes:

st agents           →  available
convoy ls --tree    →  DEAD (status stale 3m ago)

convoy ls --tree is right. st agents is reporting a value it has no reason to believe is current.

This surfaced while diagnosing a separate sidecar defect, but it is independent of that: even with a correctly-behaving writer, a crashed host or a killed session leaves a final status that st agents will keep echoing indefinitely.

Why this matters

st agents is the natural thing to reach for when asking "who is up right now" — it is the bus's own roster command. If the answer can be arbitrarily stale with no indication, then either:

  • every consumer has to reimplement a staleness rule (and they will pick different windows), or
  • consumers quietly trust it and get the wrong answer

Right now convoy has implemented its own window and smalltalk has not, which is why the two disagree. That divergence will keep widening as more consumers appear.

Proposed direction

Options, roughly in increasing order of change:

  • (a) Display-only staleness. st agents keeps printing the raw value but annotates age, e.g. available (3m ago) or a stale marker past a threshold. No semantic change; makes the ambiguity visible.
  • (b) Derived status with a window. st agents resolves to offline/stale when the status mtime exceeds a threshold, so the roster means "currently live". Matches what convoy already does.
  • (c) Shared freshness contract. The window lives in the library alongside the status reader, so every consumer inherits one definition rather than each choosing.

(c) is what actually stops the divergence; (a) is a cheap immediate improvement that does not commit to a semantic.

What I would like consensus on

  1. Should st agents mean "identities with a live session" or "last known status, whenever that was"? Both are defensible; the roster framing implies the first.
  2. If a window is adopted, what is the threshold, and does it belong in smalltalk so consumers share it — or is each consumer expected to decide?
  3. Should staleness be a distinct rendered state rather than collapsing into offline? An identity that was busy and went stale is not the same as one that cleanly went offline, and losing that distinction may matter for debugging.

I am happy to implement whichever shape is preferred. The reason I am raising it as a question rather than opening a PR is that (b) changes what an existing command means, and that seems worth agreeing on first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions