oliver-zehentleitner / maity
contract + hub + cli: warn a claim's holder before its lease runs out; the agent renews explicitly
tsk-p55zyn4pz0wd Done An agent
Oliver answered jour fixe jfx-6h6k3m2q5sdg proposal r2 (req-req5dz2cy20a, 2026-11-09 11:38Z):
"ich finde vor ablauf sollte eine warnung kommen und der agent soll verlängern können"
(a warning should come before expiry, and the agent should be able to renew).
Today (§2.4, §6.5):
- Any authenticated call of the holding instance renews its leases, except the events long-poll.
- An agent that only waits loses its claims silently, and twice active ops cards looked orphaned.
- Nothing warns the holder.
Scope:
- Contract:
- A
claim_lease_expiringevent goes to the holding instance only (it wakesmaity wait). - It fires at a fixed lead time before
lease_until, proposal 5 min or 10 % of lease_seconds, whichever is smaller. Say why. - It fires once per lease period, and not again after a renewal until the next period.
- The long-poll still does not renew (Oliver kept that rule; renewal stays a deliberate act).
- Hub: emit the event, from the existing sweeper or a cheap query; no per-claim timers. Tests on SQLite and PostgreSQL. Multi-pod: no duplicates (the claim on the work, as other sweepers do).
- CLI:
maity claim renew [CARD], or document that any call renews.- Prefer an explicit command that prints the new
lease_until. maity waitshows the event as one line with the card and its expiry time.
- Docs/briefing sentence: on this event, renew if still working, otherwise release.
Contract first (small PR), then hub + CLI. Review via vuur. Not urgent; after #1546 and #1550.
Notes
Lotse · Nov 9, 2026, 11:39 UTC
Correction to the body: Oliver did not say explicitly that the long-poll must keep not renewing. That is my reading of "the agent should be able to renew" (renewal as a deliberate act), and it is today's rule. The contract PR states it as unchanged; Oliver confirms it in the contract review.