Repository navigation
fix(work): reject stale AI Work results (#298) - #299
Merged
Merged
Conversation
karaaslanz
force-pushed
the
fix/298-stale-work-result
branch
from
September 30, 2026 15:30
ac252cb to
b54e657
Compare
karaaslanz
marked this pull request as ready for review
September 30, 2026 15:36
karaaslanz
force-pushed
the
fix/298-stale-work-result
branch
from
September 30, 2026 16:36
b54e657 to
8f10762
Compare
This was referenced Sep 30, 2026
Closed
Owner
|
Reviewed against issue #298. The Work request captures the document ID and content, checks the latest snapshot before applying the response, and rejects stale results with a clear retry message. Unchanged documents retain the existing apply behavior. Regression coverage includes unchanged content, edits during a request, and switching documents. The change stays within the current-document Work flow. Latest main was merged without conflicts in f1c910e. Validation passed: 26 frontend tests, frontend lint, production build/TypeScript, and 206 backend tests with 13 subtests. No blocking issues found. Approved for merge. |
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
Prevents stale AI Work responses from overwriting newer user edits in the active document.
When a Work request starts, the frontend now snapshots both the active document identity and its content. Before applying the returned
modified_content, it verifies that the user is still on the same document and that the document content has not changed. If either changed while the request was in flight, the stale result is rejected and the user is asked to re-run the task against the current document.Changes
useAIActions.Validation
Exact-head upstream CI on 8f10762:
Frontend tests: 26 passed, 0 failed
Frontend lint: passed
Frontend production build / TypeScript: passed
Backend tests: 195 passed, 0 failed
Ruff check / format check: passed
CI also reports existing environment/dependency warnings (Node/action deprecation, npm dependency audit output, build-cache warning, and an ffmpeg availability warning); none are introduced by this change.
Closes #298.
Refs #274, #280.