Repository navigation
Conversation
The gateway refuses ordinal+row_id truncation with 4030 whenever the two ordinal spaces disagree (NousResearch#82756): failed turns are skipped client-side while durable repair merges adjacent user rows, so restore-to-checkpoint on a session with queued/re-sent turns (e.g. after a 429) sent a stale ordinal alongside the row id and was refused. Keep the bound durable row id as the sole address and drop the ordinal the same way the ordinal-only path already does; messageId-only restores keep their ordinal (stale rendered ids fall back to it, NousResearch#82462).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
truncate_before_row_id, drop the client-computedtruncate_before_user_ordinalinstead of sending both.Motivation
Restore-to-checkpoint fails with
Restore failed/truncate_before_user_ordinal (N) does not match truncate_before_row_id target turn (M)on sessions whose client ordinal space diverged from the gateway's durable ordinal space — e.g. after queued/re-sent turns following a 429: failed turns are skipped client-side (isFailedUserTurn) while durable repair merges adjacent user rows, so the same target resolves to different ordinals on each side. The gateway's fail-closed 4030 cross-check (#82756) then refuses the pair, and the client had no path to send the row id alone.Implementation
In
runRewindSubmit, the ordinal-only branch already resolved a durable row id by content and dropped the client ordinal (#87059). This extends the same discipline to the already-bound-rowId branch: keep the durable row id as the sole address, setresolvedOrdinal = undefined. The cut is always aimed by the resolved durable target, so dropping the ordinal cannot re-aim a truncation.Validation
npx vitest run src/app/session/hooks/use-prompt-actions/— 214 passed (updated the bound-rowId case to assert ordinal is dropped)npx tsc -p . --noEmit— exit 0Impact
None identified beyond the behavior above. Backend (tui_gateway) unchanged; gateway 4030 protection remains in force for genuinely stale ordinals.
Refs: #82756, #87059, #82462