fix(server): persist selected provider at managed thread insert - #1774
Merged
Merged
Conversation
Managed worktree threads were inserted with the repository default provider and only corrected after provisioning via updateProvider, so clients materializing the row during checkout saw provider "claude" and rendered the Claude icon on e.g. Devin SWE-2 threads. ThreadService.create now accepts a provider option forwarded to ThreadRepo.create, and both managed creation paths pass the selected provider at insert, making the post-provisioning updateProvider patches redundant.
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.
What
Managed worktree threads were inserted with the repository default provider (
"claude") and only corrected to the selected provider later, after worktree provisioning, viaupdateProvider. Any client that materialized the thread row during the provisioning window (thread-list refresh, reload, second client) sawprovider: "claude"and rendered the Claude icon on threads running other providers, e.g. Devin SWE-2.ThreadService.createnow accepts aprovideroption forwarded toThreadRepo.create, and both managed creation paths (ThreadCreationCoordinator.createManagedThread,ThreadBranchingService.createManaged) pass the selected provider at insert. The post-persistenceupdateProviderpatches and the response-spread workaround are removed since the row is correct from the start.Verified with focused Vitest coverage asserting the persisted row carries the selected provider at
onThreadPersistedtime, plus the live Electron runs attached below.Why
The sidebar and composer rendered the wrong provider icon (orange Claude asterisk) on new Devin/SWE-2 managed worktree threads during provisioning, and the stale icon could persist until the next thread-list refresh.
UI Changes
Before: a new SWE-2 worktree thread shows the Claude asterisk in the sidebar after a mid-provisioning reload.
After: the same flow shows the Devin icon immediately.
provider-icon-before.mp4
provider-icon-after.mp4
Config Changes
None.
Review Notes
None.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.