The untitled rows in your session list are cron jobs that never ran


You open the session list looking for last week’s incident review, and instead you scroll through rows with no title. Same timestamp shape, all empty. You tell yourself you misremembered, check hermes sessions stats, and the total is a thousand higher than last month. The database file has grown too. Deleting feels risky — some of these might be real runs — but the list has stopped being usable.

Those blank rows are probably not your imagination. They are your cron jobs.

A row is written before any gate runs

A gateway-owned cron fire is a stateful path, not “hit the clock, run the script”. It starts with admission: take the execution right, write a row into sessions, get a session id — and only then does it enter run_job.

Inside run_job sits a row of gates, there for good reasons: save tokens, save time, prevent accidental wakes.

  • A monitor tick where nothing changed — no need to wake the model.
  • A wakeAgent: false script job — run the script, not an agent.
  • A blocked or empty payload from upstream.
  • A configuration-level refusal.
  • A failed store acquisition.

When one of those fires, run_job returns without doing work. Which is entirely correct — except that the session row is already committed. It is never ended, it has no messages, and it just sits there.

Why they never clean themselves up

Retention skips sessions that never ended. That rule is right: you do not want to reclaim a session that is still running. These empty fires happen to match it exactly, so they never age out.

A monitor that runs every five minutes and is gated as “no change” most of the time is 288 fires a day. Write a row at admission and return early on each one, and that is hundreds of empty sessions daily. A few weeks later, this is your list:

Title                        Workspace          Last Active   ID
────────────────────────────────────────────────────────────────────
—                            hermes-agent-lab   just now      local-c552...
HermesAgentLib ops job · Nov  hermes-agent-lab   23h ago       local-fd56...

Titled rows ran. Rows titled “—” are the empty ones.

The fix: one finally that ends what it started

PR #155300 makes the close a single deterministic path instead of something scattered across return branches:

  • When a gate stops the fire, the row is ended as cron_suppressed through the handle admission borrowed. No second handle is borrowed, and the lent store is never closed.
  • The close lives in one finally that also covers the gates, an AIAgent import failure and scope construction — the paths that used to raise before the lifecycle try now end the row exactly once.
  • End first, decorate second. The title and cwd writes happen after the end, and all three share one bounded proxy, so a stalled title write cannot block the close or pile up cleanup workers.
  • A live detached worker keeps its deferred teardown; it is not torn down underneath itself.
  • Receipts and admissions are kept, so an exact retry after a restart still returns the same terminal result without re-running the gate.

One design option was deliberately excluded: not writing the row at all for a gated fire. That would change the admission’s retry identity and the scope the gate runs in, so it stays a separate change.

Checking and cleaning up

See how many cron sessions you have:

hermes sessions list --source cron --limit 20

Titled rows are usually real runs (job name plus a timestamp); “—” rows are the leftovers. To ask whether a zero-message pass can clear them:

hermes sessions prune --source cron --max-messages 0 --older-than 1d --dry-run

That command’s answer can be confusing, and the reason is the bug itself:

No sessions match (last active before 2026-11-20 12:09, source 'cron', <= 0 messages).

Retention skips sessions that never ended, and these are exactly that. So on an older build, prune cannot reclaim them — you are down to hermes sessions delete <id> per row, or waiting for the fix, after which new suppressed fires end properly and become eligible for retention like any other finished session.

The full session subcommand surface (list, prune, archive, export, repair) is in the hermes sessions reference. If your actual problem is “the job looks like it never ran” rather than “it left a pile of empty rows”, read diagnosing silent cron failures instead; and if you want to know why a gate keeps stopping a job, cron doctor walks through it.

Can you use it today

Only from main. The PR merged on 2026-11-20, after the v0.23.3 tag, so no released build contains it. A related fix from the same batch moved gateway startup recovery onto a worker thread — that restart-loop story — and both share one theme: a session row’s lifecycle has to be closed out by someone.

Update (2026-11-25): these changes shipped in v0.23.4 (November 24) — hermes update brings them in. The “not in v0.23.3 / on main only” wording above is a snapshot from publication time.

Short version: if you write the row at admission, someone must own ending it. A gate stopping a fire is fine; what was missing was telling the database that this fire is over. Now something does, and it is called cron_suppressed rather than “still running, forever”.