Repository navigation
Conversation
rareboe
force-pushed
the
fix/44736-pin-race
branch
from
September 29, 2026 15:33
d79a467 to
f80db4d
Compare
Each TUI instance loaded session.json once and rewrote the whole pin list from its own copy, so an instance holding a stale snapshot erased pins added by another one. Two writers starting from an empty list end up with a single pin. Apply each pin or unpin to the file's current contents under Flock, the same approach createModelPreferenceRepository already uses for model preferences. The store still updates immediately and is reconciled once the write lands.
rareboe
force-pushed
the
fix/44736-pin-race
branch
from
October 7, 2026 09:23
f80db4d to
0d757e6
Compare
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.
Issue for this PR
Closes #44736
Type of change
What does this PR do?
Each TUI instance loads
session.jsononce and rewrites the whole pin list from its own copy, so a stale instance erases pins added by another one.Pin/unpin is now applied to the file's current contents under
Flock, the same approachcreateModelPreferenceRepositoryalready uses for model preferences. The UI still updates immediately.Retargeted from
devtov2and reimplemented on top of the current code.How did you verify your code works?
Added a concurrent-writers test in
test/context/local.test.ts: the old snapshot write ends up with a single pin, the new code keeps all of them.bun run checkpasses.bun testinpackages/tuimatches cleanv2(the only two failures are the shell-output timeout tests, which also fail without this change).Screenshots / recordings
N/A
Checklist