You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(omp): first tag revision allocation in a nonempty legacy session invalidates its snapshot #769
I resumed an older OMP session and my next prompt was refused:
Magic Context could not safely prepare this turn; send your message again.
stage=pipeline elapsed=572ms recovery=no managed result; refused
(Pi tag hydration: tag snapshot is not ready; turn not sent, retry)
Hydration initially succeeded. The log then showed 25 pending operations applied, followed by a failure in runPipeline → getPiTagSnapshotView → sync.
Reproduction and likely cause
I reproduced the same error using the installed snapshot reader and a disposable database copy:
Keep an existing session's tags, but remove its schema_migrations_meta key tag_revision:<sessionId> to simulate legacy state.
Call ensurePiTagSnapshotReady, then read the snapshot successfully.
Update a tag's status on the same connection.
Read the snapshot again: tag snapshot is not ready.
With the revision key present, the same sequence passes. The first local update allocates a revision incarnation, changing foreignRevision. The existing firstAllocationPending handling only covers an empty session, so this nonempty legacy case is rejected.
I do not have the database from immediately before the original failure, so this establishes a reproducible mechanism, not proof of every original precondition.
Current status / expected behavior
The affected session now has a revision record. Offline replay of its current state passes context preparation (1,229 → 941 messages) and the OMP provider structure check. I have not verified a live model response.
I expect a session's own first revision allocation to preserve snapshot validity, while actual foreign writes and recreated revisions must still invalidate it. Please add regression coverage for nonempty legacy sessions and retain the foreign-write checks.
Thanks, the mechanism fits our code. The first-allocation exception only covers an empty session, so a nonempty session from before revisions existed treats its own first revision as a foreign write and refuses the turn. We're fixing it so a session's own first allocation keeps its snapshot valid, while foreign writes and recreated revisions still invalidate it, with your sequence as the regression test. It ships in the next patch, crediting you.
Shipped in 0.49.21. In an older Pi or Oh My Pi session, the session's own first tag revision no longer invalidates the tag snapshot and refuses the turn. It's accepted only with full proof: exactly one matching allocation seen on that connection, its change record present, and version counts that add up. A foreign write, an untracked writer or missing evidence still refuses. Restart Pi after updating; there's no migration. Thanks, @sisttri.
Activity
sisttri commentedon Oct 23, 2026
magic-alfonso commentedon Oct 23, 2026
Thanks, the mechanism fits our code. The first-allocation exception only covers an empty session, so a nonempty session from before revisions existed treats its own first revision as a foreign write and refuses the turn. We're fixing it so a session's own first allocation keeps its snapshot valid, while foreign writes and recreated revisions still invalidate it, with your sequence as the regression test. It ships in the next patch, crediting you.
magic-alfonso commentedon Oct 25, 2026
Shipped in 0.49.21. In an older Pi or Oh My Pi session, the session's own first tag revision no longer invalidates the tag snapshot and refuses the turn. It's accepted only with full proof: exactly one matching allocation seen on that connection, its change record present, and version counts that add up. A foreign write, an untracked writer or missing evidence still refuses. Restart Pi after updating; there's no migration. Thanks, @sisttri.