symfonic.platform.conversation_pg_pause¶
conversation_pg_pause ¶
Durable pause records that bind a selected-root token to one conversation turn.
A pause row is written only after the HTTP root has authenticated the token's
signed session and claim, and only while the conversation is still at the
revision the paused turn prepared. It is the selected root's issuance record:
a token with no row here was not paused by this root and is not resumed by
it. Resuming publishes the paused query and the final answer in the same
transaction that moves the row from pending to published and
compare-and-sets the conversation revision, so a resumed answer is published
at most once and never over a turn another worker published meanwhile.
A resume that fails after its token was claimed moves the row to
abandoned: the token is spent, so nothing can redeem the pause again and
the row stops pinning an empty session. A row orphaned by a process that died
mid-resume is released by its signed expires_at instead.
PostgresConversationPauses ¶
Pause verbs over one PostgresConversationAuthority's tables and pool.
Source code in src/symfonic/platform/conversation_pg_pause.py
abandon
async
¶
Settle a claimed pause whose resumed turn published nothing.
Call only after this caller won the token's single-use claim; the token is spent, so this never makes the pause redeemable again. Returns whether a pending row was settled.
Source code in src/symfonic/platform/conversation_pg_pause.py
pending
async
¶
The owner's pending pause, still resumable at its turn's revision.
Source code in src/symfonic/platform/conversation_pg_pause.py
publish
async
¶
Publish the paused query and resumed answer exactly once.
Source code in src/symfonic/platform/conversation_pg_pause.py
record
async
¶
record(principal: Any, session_id: str, claim_id: str, query: str, base_revision: int, *, expires_at: int, supersedes: str | None = None) -> None
File a pending pause; refuse if the turn's revision has moved on.
expires_at is the token's signed expiry (epoch seconds).