Repository navigation
fix(threads): offer linked workers for a project's new thread - #295
Merged
Merged
Conversation
A shared project is one row in the overview with every linked computer's workspaces. Only the initial read and the partner's updates were merged: when this computer republished its own row (a worker change, a rename, a config sync), the overview stream sent it with local workspaces only. The client replaced the merged row, so a project that lives only on a linked computer showed "No worker" in the new-thread picker. The routed overview stream now sends every update of a shared project with all computers' workspaces, reading the overview once per burst and falling back to the local row if that fails. The web picker keeps linked workers listed until the gateway capabilities load, greys out workers on an unreachable computer, and says the project's workers are not connected instead of "not on any worker yet" when the project has workspaces. Fixes: #168
This was referenced Nov 13, 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.
Root cause
A shared project (#168) is one overview row with every linked computer's workspaces. The routed overview merged them only in
GetOverviewand in updates from the partner. When this computer republished its own row of a shared project, the overview stream sent it with local workspaces only. Triggers includecoreBroadcastWorkerson any worker change, renames,projectsChangedafter a config sync and origin refreshes. Web and mobile upsert by id, so the merged row lost the partner's workspaces. A project that lives only on a linked computer then hadworkspaces: [], and the new-thread picker showed "No worker" and "… is not on any worker yet".I reproduced it with two linked gateways. A's
WatchOverviewemitted the shared project withworkspaces: []right after A republished it.Fix
apps/gateway/src/api/routed-overview.ts: every update of a shared project goes out with all computers' workspaces, whether it came from this computer or a partner. A burst (for example, a worker change republishing every project) reads the overview once, 50 ms coalescing. If that read fails, the local row still goes out. Mobile is fixed by the same change.WorkerPicker.svelte:docs/linked-computers.md: notes the merged stream updates.Verification
tests/integration/linked-new-thread.test.ts(two linked gateways, separate databases):linked-projects,config-sync-projects,worktrees,worktree-automationand the db schema test.bun install,gen:check,typecheck,lint,format:checkand the web build.check:tmp: 1517 pass, 3 fail. All 3 failures are in filesdev(feat(worktrees): list worktrees git already has #294) changed while the run was in progress; all 3 pass when rerun on the rebased branch.Not in scope
New worktrees on a linked computer's checkout stay refused on purpose (docs/worktrees.md, "Połączone komputery", stage 1). Supporting them needs gateway capability negotiation and is a separate feature.
Copy audit (docs/copy.md §8)
Fixes: #168