Repository navigation
FIX: let concurrent chat converter runs commit their own pieces - #3225
Merged
Roman Lutz (romanlutz) merged 4 commits intoOct 15, 2026
Merged
Roman Lutz (romanlutz) merged 4 commits into
Roman Lutz (romanlutz) merged 4 commits into
Conversation
The commit at the end of runConversion rejected the whole update when the state run id moved, so a conversion started in the same tick as another one lost its results even though the per input revision checks already guard staleness. Track which run owns each input, commit the outcomes a run still owns, and clear ownership wherever results are reset. The converting flag now only clears when no run is active. Fixes microsoft#3224 Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
…inish Run ownership and the set of active runs move into the conversion state, so a scope or generation change that React abandons mid render discards the reset together with that render instead of leaking it out of a ref. The converting flag now reflects every active run, so apply stays disabled until the last concurrent run commits, and each run removes only itself on completion. Follow-up to the review on microsoft#3225. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Roman Lutz (romanlutz)
approved these changes
Oct 15, 2026
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.
Description
Fixes #3224
Two conversions started in the same tick raced through
runConversion: the reentry guard readstate.runIdfrom a stale render closure, both runs started, and the commit rejected the earlier run wholesale with a run id comparison, so the piece it converted kept stale results with no error.Runs now record which inputs they own. A run commits exactly the outcomes for inputs it still owns, the per input revision and pipeline revision checks keep protecting against genuinely stale outcomes, and ownership is cleared everywhere results are reset (clear all, restore, generation and scope changes). The converting flag only clears when no run is active anymore.
Tests and Documentation
Added a regression test that gives the text and image pieces distinct first results, starts one conversion per piece in a single act, and asserts both pieces update to new values. It times out on main and passes with the change. The full converters related suites pass (useChatConverters, usePieceConverters, ConverterPanel, ChatWindow, 253 tests) and
tsc --noEmitis clean.No documentation change needed, so I did not run JupyText.