Skip to content

fix(computers): preserve configured providers when linking - #455

Merged
nixuuu merged 1 commit into
devfrom
fix/link-config-merge
Nov 9, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/link-config-merge

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Linking a fresh desktop could replace an existing claude:native definition with its later bootstrap defaults. In particular, resetting ownLogin could make the worker remove the instance's existing .credentials.json while trying to link an absent device login. A two-gateway regression reproduced the overwrite before this fix (Working Claude became an empty label).

Fixes: #164

Result

  • Track edit intent per field. Untouched account/provider defaults yield to configured values, regardless of creation time or invitation direction. Explicit resets remain edits; legacy snapshots use conservative inference.
  • Preserve concurrent explicit account, instance and proxy values locally. Settings → Linked computers lists alternatives with Keep this computer’s / Use the other’s. Either choice publishes a resolution, including transitive observations across computers and restarts.
  • Keep CLI paths, CLI authentication files and per-worker overrides at their existing home. Shared definitions still include connection kind, arguments, models, environment and own-login choice. Connector/environment records retain their documented merge rules. Secrets remain encrypted at rest and travel only over the pinned mTLS gateway link; notices contain no secret values.
  • Make Sign in commands target the actual worker executable and effective instance/device login home, including worker overrides and PowerShell quoting. The turn action already selects the correct instance and worker; it opens settings and does not execute login.

Recovery

  1. Update both computers before enabling configuration sharing again; an older gateway still has the old merge behavior.
  2. On the affected computer, restore overwritten provider fields from Settings → Linked computers history (90-day retention), especially own-login choice and secrets. Without history, restore the definition and local paths manually in Settings → Providers.
  3. Select the instance and worker, refresh account status, run its Sign in command on that worker, refresh and retry. Configuration history cannot restore native CLI authentication files or keychain tokens that were already deleted.

Migration: 0110_config_field_ancestry, following the merged DB2 migrations 0103–0109 on dev (a423af85). Rebased onto that commit: provider recording retains DB2's bounded saveRecords batches together with edit intent and per-author ancestry. Configuration store scoping, blob filtering and move redirect batching remain intact. Protobuf additions are additive; generated code is included. Polish merge, ownership and recovery documentation is updated.

Validation

  • 67 passing tests after rebase, with files run separately: 36 original focused integration tests (bootstrap, intent, providers, identity, settings, notices, notice recovery and provider accounts), the complete schema suite (23, including the original migration-idempotence test), online migrations (5) and DB2 record batches (3). This reruns all previous 37 tests. Coverage includes all four creation/invitation combinations, local login fixtures/paths/worker overrides/secrets, explicit resets and conflict choices, three-computer transitive restore, encryption and owner scope. The batch durability test also verifies edited and seen survive reopening storage.
  • PostgreSQL migration application and idempotence, including merged migrations 0103–0109 followed by 0110; bun install, bun run typecheck, bun run lint, bun run format:check, bun run gen:check, web build.
  • Investigated the repeated recovery-file CI failure: unmodified PR head 4e0ea1ac failed 5/5 isolated runs at the same post-replay record assertion; current dev a423af85 passed 5/5. The fixture omitted the intentional edited=true and seen=[] field metadata added during transport. Updated the fixture while retaining exact equality and all rollback/cursor/restart assertions. The corrected recovery file passed 5/5 isolated runs (30 passing tests), with a private TMPDIR throughout. The failure did not indicate a production atomicity defect: merge/history/intent writes and cursor updates remain in the same sql.withTransaction.
  • Full check:tmp deliberately left to CI as requested. No UI/E2E tests or live provider login. Browser visual inspection remains unverified.

Copy audit (docs/copy.md §8): ambiguous Restore/Dismiss for unresolved conflicts → Use the other’s / Keep this computer’s, so the effect is explicit. Bare CLI login guidance → the selected worker's scoped command, so it reaches the actual account. Text uses English, sentence case, active actions and the existing instance/worker/computer glossary; secret alternatives remain A different key. Layout allows action wrapping and long text, but desktop/phone and light/dark browser inspection has not been performed. No new decorative copy or color-only cues.

@nixuuu
nixuuu force-pushed the fix/link-config-merge branch from 074b4ac to 4e0ea1a Compare November 9, 2026 20:36
Track bootstrap intent and preserve concurrent provider and account edits until an explicit choice. Keep local CLI homes and worker overrides, and scope recovery commands to the effective login home.

Fixes: #164
@nixuuu
nixuuu force-pushed the fix/link-config-merge branch from 4e0ea1a to d2e5c15 Compare November 9, 2026 21:16
@nixuuu
nixuuu merged commit 3f71455 into dev Nov 9, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/link-config-merge branch November 9, 2026 21:23
nixuuu added a commit that referenced this pull request Nov 10, 2026
Imported skills can already be in the shared library while remaining
uninstalled. The previous “No computers” and plugin statuses did not
explain assignment, review or linked deletion notices.

This change adds a compact library summary, explicit installation and
review states, and single/bulk skill installation using the existing
all/computers/tags selectors. Assigned rows list their computers and use
the same Synced / Syncing / Error vocabulary as Computers & preview.
Installation counts require current successful worker reports; pending
assignments remain separate.

Web and mobile now offer installation targets during CLI import,
defaulting to the source computer. The additive
`ImportLibraryChoice.skill_selector` field uses the existing
owner-scoped skill save path. Replace preserves existing assignments.
Bulk actions use sequential revision-checked saves, preserve computer
overrides and expose partial results; no new bulk RPC or database
migration is needed.

Linked deletion notices explain shared configuration and offer Keep /
Accept deletion plus bulk deletion resolution. Empty instructions and
previews point to adding and assigning a document. Polish
environment/import documentation is updated.

### Validation

- Passed: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun
run lint`, `bun run format:check`, and the web production build.
- Focused gRPC integration: 19 tests, 361 assertions passed. Covers bulk
installation with actual worker reports, stale revision rejection,
import source/all/tag assignments, Undo and foreign-owner rejection.
- Browser checks used an isolated gateway, worker and Postgres with 25
unassigned skills, 3 installed skills, 2 pending plugins, 3 deletion
notices and empty instructions. Checked light/dark at 1280, 820 and 390
px, long names, single/bulk install, bulk removal, review checksum
gating, import targets, bulk deletion acceptance and empty preview
guidance. Before/after screenshots are kept outside the repository.
Checkbox selection required DOM click fallback after the browser locator
timed out; resulting saves used the real API.
- Full `bun run check:tmp`: **2154 passed, 163 skipped, 2 failed**, with
no Canopy temp entries left. Failures were `scripts/release.test.ts`
(“Release accepts the event SHA…”, default 5 s timeout) and
`tests/integration/linked-thread-liveness.test.ts` (“an event sequence
gap…”). Both files are unchanged. Rerunning those files through
`check:tmp --timeout 30000` passed **28 tests / 253 assertions** with
clean temp cleanup. The initial full run remains red; no baseline run
was used to establish whether these failures predate this branch.
- Mobile changes are JS only. `bunx [email protected] fingerprint:generate
--platform <ios|android> --build-profile production --json
--non-interactive` produced unchanged hashes: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. No native device interaction
was verified.

### Copy audit — docs/copy.md §8

| Before | After | Reason |
| --- | --- | --- |
| No computers / 0 computers | Not installed + Install… | Names the
installation state and next action without duplicate counts. |
| Not assigned / Ready to review | Review required + Review | Explains
the prerequisite before installation; checksum confirmation remains
explicit. |
| Restore / Dismiss | Keep / Accept deletion, with shared-library
explanation | Makes the result of each deletion decision clear. |
| No instructions assigned to this destination | Add a document and
assign it to see what agents receive. | Gives the next step in the empty
library and preview. |
| Instructions, skills and plugins that follow your computers… | Assign
library items to computers or tags to install them. | States the
assign-to-install rule directly. |

New copy uses sentence case, active action labels, correct file plurals
and text statuses. Errors and stale-library messages give a recovery
action; bulk deletion confirmation names the shared-library and
installation effects. Short, typical and long names were checked at
desktop, narrow and phone widths in both themes. Status meanings do not
depend on color or icons. No new humorous copy was added. Picker
ellipses and the longer install-all label follow the explicit task
wording.

Fixes: #118
Related: #455
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