Repository navigation
fix(client): preserve surviving input through committed reverts - #55403
CasualDeveloper wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
The approach looks sound. I couldn't reproduce the race live in the TUI. The 8 new regression tests fail on the base and pass with this change. All 38 tests in solid-data.test.ts pass, and the client typecheck passes. Clipping by transcript position matches what the server's revert projection does: it deletes messages and pending items by their position (seq >= boundary), not by ID order. Keeping only rows that are still waiting for acknowledgement is also safe, because events arrive in order: anything the server queued before the revert has already been acknowledged by the time the revert is handled.
Public API: unchanged. createSync's run callback gains an optional parameter, but it is internal to data.ts.
Concerns:
- A session can have its info loaded but not its transcript. For those, the boundary is never found and the session gets a full transcript and pending fetch (see the inline comment).
- When the session's info isn't loaded, nothing removes pending rows any more; the old code removed them. When it is loaded, the deleted rows stay visible until the pending reload finishes. That gap is probably acceptable, but it is a change from before.
- The reformatting of the existing "counts every subagent page" test is unrelated and can be dropped.
Related: #54150
a5bd92e to
67977fa
Compare
|
I rebased onto |
Project the loaded boundary by transcript position and retain unacknowledged replacements. Revalidate authoritative pending state and surviving history when the boundary or cursor falls outside the retained window. Reject superseded message and pending snapshots and older-page responses from deleted cursors before store publication.
67977fa to
da4198c
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Please reopen this PR. It was closed by the November 14 age/reaction cleanup, and I’m still maintaining the fix. This is the focused Client-only split requested in #55315. I addressed the earlier review’s unloaded-transcript, immediate pending-cleanup and unrelated-formatting concerns before cleanup closed it. On November 16 I refreshed the maintained copy onto Those fresh results are from the maintained combined source. This PR still points at |
|
I’ve now refreshed this PR’s own branch onto The fork branch is verified at the linked commit. GitHub's closed PR record still reports the older head SHA, so the link above identifies the refreshed revision. |
Issue for this PR
Fixes #44357
Split out of #55315; the original issue is closed, but its disappearing-replacement symptom is reproduced by the Client regressions.
Type of change
What does this PR do?
A committed revert could remove a replacement still waiting for acknowledgement. I keep those optimistic rows, clip the transcript by boundary position instead of ID order, and reload pending survivors from the server.
An off-page or page-edge boundary also needs fresh history and a valid cursor. Superseded transcript/pending/page reads cannot republish deleted rows. Unviewed transcripts stay unloaded; clipped pending rows clear immediately while surviving input keeps delivery-event bookkeeping, even without cached session info.
Two Client files only. No prompt API, send-chain, App/TUI, or cancellation changes; #54163 remains separate. The refresh preserves upstream cache-eviction guards, tool-file restoration and first-token handling.
How did you verify your code works?
devat0354362b857beae78166d4305f06c0b2f47c251e.bun run checkpasses. These checks ran on this focused branch, without the other feature branches.Screenshots / recordings
Data projection only; no visual styling changes.
Checklist
Process: human-directed, with agentic assistance from openai/gpt-6-astra.
Added by the opencode bot (AI-generated).
Related: #54150