Skip to content

fix(server): persist selected provider at managed thread insert - #1774

Merged
chuks-qua merged 2 commits into
mainfrom
fix/managed-thread-provider-icon
Sep 28, 2026
Merged

chuks-qua merged 2 commits into
mainfrom
fix/managed-thread-provider-icon

Conversation

@chuks-qua

@chuks-qua chuks-qua commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Managed worktree threads were inserted with the repository default provider ("claude") and only corrected to the selected provider later, after worktree provisioning, via updateProvider. Any client that materialized the thread row during the provisioning window (thread-list refresh, reload, second client) saw provider: "claude" and rendered the Claude icon on threads running other providers, e.g. Devin SWE-2.

ThreadService.create now accepts a provider option forwarded to ThreadRepo.create, and both managed creation paths (ThreadCreationCoordinator.createManagedThread, ThreadBranchingService.createManaged) pass the selected provider at insert. The post-persistence updateProvider patches 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 onThreadPersisted time, 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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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.
@chuks-qua
chuks-qua merged commit 6e4cd78 into main Sep 28, 2026
6 checks passed
@chuks-qua
chuks-qua deleted the fix/managed-thread-provider-icon branch September 28, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant