Repository navigation
feat(computers): share projects and worktree policy across computers - #168
Merged
Merged
Conversation
nixuuu
force-pushed
the
feat/linked-shared-config-3
branch
from
November 5, 2026 12:22
08c6c74 to
9191a00
Compare
nixuuu
force-pushed
the
feat/linked-shared-config-3
branch
from
November 5, 2026 14:43
9191a00 to
73db7aa
Compare
nixuuu
marked this pull request as ready for review
November 5, 2026 14:43
nixuuu
added a commit
that referenced
this pull request
Nov 6, 2026
## Root cause A shared project (#168) is one overview row with every linked computer's workspaces. The routed overview merged them only in `GetOverview` and 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 include `coreBroadcastWorkers` on any worker change, renames, `projectsChanged` after 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 had `workspaces: []`, and the new-thread picker showed "No worker" and "… is not on any worker yet". I reproduced it with two linked gateways. A's `WatchOverview` emitted the shared project with `workspaces: []` 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`: - linked workers stay listed until the gateway capabilities load (before, they were briefly hidden); - workers on an unreachable computer are greyed out and disabled, with the presence reason, as on mobile; - the empty state says "<project>'s workers are not connected." when the project has workspaces. "not on any worker yet" now appears only when it is true. - `docs/linked-computers.md`: notes the merged stream updates. ## Verification - New `tests/integration/linked-new-thread.test.ts` (two linked gateways, separate databases): - A's overview stream keeps B's workspace after A republishes the shared project. This test fails without the fix. - B's worker is in A's overview and online. - A thread created from A on B's worker lives on B, in B's project. - Passed, each file run on its own: `linked-projects`, `config-sync-projects`, `worktrees`, `worktree-automation` and the db schema test. - Clean: `bun install`, `gen:check`, `typecheck`, `lint`, `format:check` and the web build. - `check:tmp`: 1517 pass, 3 fail. All 3 failures are in files `dev` (#294) changed while the run was in progress; all 3 pass when rerun on the rebased branch. - Browser, against three linked test gateways and a vite dev BFF: - wrk-ai only on "Mac-Studio-of-the-team": the picker shows that worker and the composer is ready (light, desktop); - pinpoint on two computers: grouped "This computer" / "Mac-Studio-of-the-team"; - an offline "Mac mini": its worker is greyed out and disabled with "Offline since …" (dark, iPhone 12 Pro width). ## 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) - New: "{project}'s workers are not connected." It is short and factual, and it replaces a false claim. No other text changed. Fixes: #168
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
Clone outbound stream messages before mapping shared project IDs so local Hub subscribers retain their home project and worktree metadata. Fixes: #168
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
Clone outbound stream messages before mapping shared project IDs so local Hub subscribers retain their home project and worktree metadata. Related: #168
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
When a linked computer watches a home gateway, its project ID translation can change the same live thread row that the home's web and mobile clients receive. A working worktree thread can then show “Unknown project” even though its stored placement is correct. Clone each outbound stream message before translating IDs so local clients keep the home project ID and the peer receives its global ID. The source of the problem is `remoteServe`: `create(descriptor, message)` returns an already typed protobuf message unchanged. Hub subscriptions share those instances, and `ConfigIds.map` mutates project references in place. Project alias mapping was introduced in #168; #526 and #539/#541/#543 did not introduce this boundary. Both clients resolve projects by exact `projectId`, so both are affected. The database placement and `threadSelect` retain the parent project and joined worktree; this is an ID rewrite, rather than evidence of a partial status row. No client merge fallback or cwd-based guess is needed. The gateway integration regression uses two linked databases with merged project aliases and a side thread inheriting its parent's worktree. A real worker holds a turn open while overview updates and a resumed thread delta arrive. It checks the local/global project IDs and branch before, during and after work, including an unread update while working. The branch-over-directory presentation change remains in #545, which uses the same domain helper on mobile and web. Validation: scoped `nice -n 19` oxlint and oxfmt checks passed; `git diff --check` passed. Local installation, typecheck, tests, builds, fingerprints, browser and render measurements remain deferred at the maintainer's request while host diagnostics run. GitHub CI will run the required suite. The local commit hook was skipped using its supported `SKIP_SIMPLE_GIT_HOOKS` switch because commitlint is not installed in this worktree and local install is deferred; CI validates the Angular title. Copy audit (`docs/copy.md` §8): no UI strings, labels, errors, empty states or actions changed. The existing “Unknown project” fallback remains; this fix supplies its correct project reference. Documentation change is in Polish. No mobile/native dependencies, client subscriptions or timers changed. Related: #168 Related: #545
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.
Stage 3 of 7 of shared configuration across linked computers. The design is in
docs/linked-computers.md.What changes
location.project_id. Projects without an origin merge only by global id.computer_shared_*), its sync loop and its UI (ShareSetting,ShareScope,SharedConfigOverview) are removed, and so is a broken query inmoves-preview.ts.Migration:
0075_config_projects. Proto (additive):Project.global_id = 801.Tests: gateway↔gateway integration covers:
locationstays local;Full suite: 1195 passed, 0 failed.
Copy audit (
docs/copy.md§8):