fix(compression): fence durable transcript revisions - #72806
Conversation
72001f0 to
57cfe13
Compare
|
Rebased as a stacked follow-up on #71486, preserving both live-tip recovery and durable transcript revision fencing. Exact head: |
|
Thanks for tracing this to the durable-row-count assumption. The premise is confirmed on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
308b23e to
83a2fbf
Compare
83a2fbf to
1bdac5d
Compare
|
Rebased and repaired on current |
|
Pairing metadata correction: the WebUI tree is unchanged, but its final commit was republished with the required verified author/committer identity. Exact paired review target is now WebUI |
Summary
Fence compression against an atomic durable transcript revision instead of comparing a model-facing projection length with SQLite's active-row count.
This fixes the cross-repository race where WebUI can legitimately project fewer messages than the Agent's durable transcript, while a real concurrent mutation must still prevent stale compression output from publishing.
Root cause
len(durable_parent) > len(messages)was treated as evidence of concurrent writes. That is not a valid invariant across WebUI sanitization, deduplication, replay and sidecar projection. It caused false retries and could exhaust the provider context window. Conversely, without a durable revision/CAS boundary, a true concurrent rewrite could be missed between load and publication.The previous PR head also introduced a separate CI regression: importing durable state through
gateway.config -> gateway.session -> agent.turn_context -> agent.conversation_compressionfrozestate.dbbefore runtimeHERMES_HOMEresolution. The current head keeps those imports lazy; the existing runtime-home regression is green again.Changes
api_contentsidecar digest;TurnContext/TurnRunnerand refresh it after clean Agent writes;Dependency and pairing
5d4539dcfc782953fbc27bd630b96b245c7c7621;1bdac5d4547914d70c134f06af0435568a35159c;cb11a7e25579638c9f67e8501dd151f581c4c942;0f7c4cef3f38aab591ae6fa6fcfdb76a869c669a.Merge #71486 first, then rebase this PR onto the resulting
mainto drop the stacked duplicate and revalidate the new exact head together with WebUI.Validation
ruamel, reproduced identically on unmodified base (515 passed, same 2 failed);py_compile, andgit diff --check: passed.No deployment or merge is performed by this PR update.