Skip to content

Wake an idle gated session before attesting follow-up deliveries - #149

Merged
oldsj merged 2 commits into
mainfrom
quiesced-wake
Oct 10, 2026
Merged

oldsj merged 2 commits into
mainfrom
quiesced-wake

Conversation

@oldsj

@oldsj oldsj commented Oct 10, 2026

Copy link
Copy Markdown
Owner

What changed

  • Follow-up messages to an idle gated session no longer fail with runtime_unattested. Before attesting, Mainloop's shared readiness path asks kagent to wake the session's existing paused actor (ResumeSession, needs Wake a READY session's quiesced actor on ResumeSession kagent#23). It then re-reads the session and runs the full frozen-identity check. A message goes only to the same generation and actor UID, never to a replacement.
  • After an unclear wake, the next delivery reconciles that same kagent operation before waiting for readiness. The failed message is never replayed.
  • A refusal inside the send guard is recorded as failed / "not sent", not uncertain.

Proven / not proven

  • Proven offline: fake runtime plus scratch PostgreSQL, through the real delivery path and production ensure_ready. 1404 backend tests pass, and make lint is clean. Independent review and re-review accepted the change.
  • Not proven live: a woken follow-up on the cluster.

oldsj added 2 commits October 10, 2026 04:34
kagent suspends an idle actor but keeps its Session READY, so a fresh
GetSession has no running association and every ordinary follow-up to a
gated Session failed with runtime_unattested once the actor idled.

The shared readiness path now calls kagent's fenced ResumeSession
activation, which wakes only the Session's current generation and actor
UID, before its fresh GetSession and full observation. Both the
pre-admission and pre-send checks use it. The activation reply is never
an observation. An unknown outcome is reconciled once through GetSession
and never replayed; while kagent still holds the operation nothing is
sent.

Signed-off-by: James Olds <12104969+oldsj@users.noreply.github.com>
An uncertain activation leaves kagent's READY/RESUME operation in
place until a ResumeSession joins it. The next delivery waited in
ensure_ready for NONE and timed out, so the supported reconciliation
was unreachable. Readiness now makes its one activation call first
when the observed Session holds READY/RESUME, then waits and attests a
fresh GetSession.

A readiness failure in the send guard happens before any turn bytes.
Record it as a failed, not-sent delivery instead of an uncertain one.

Signed-off-by: James Olds <12104969+oldsj@users.noreply.github.com>
@oldsj
oldsj merged commit 85e175e into main Oct 10, 2026
5 checks passed
@oldsj
oldsj deleted the quiesced-wake branch October 10, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant