Skip to content

feat(kin): teammates link and remove their own devices - #539

Merged
GLDRoger merged 18 commits into
kinfrom
merge/linked-devices
Nov 18, 2026
Merged

GLDRoger merged 18 commits into
kinfrom
merge/linked-devices

Conversation

@GLDRoger

Copy link
Copy Markdown
Owner

Why

How

  • The author's commits unchanged, plus one merge of kin: DeviceLinks is now K179, the permission checks the pull request moved inside their transactions stay there, and everything kin added since is kept. One publish in kin's newer removal code is now commit-bound like the ones around it.
  • An independent check of the merge resolution alone found it sound.

Tests

  • At the merged head: typecheck 42/42; branch checks clean; 791 tests in 37 files (auth, Kin auth, people, migrations, RPC access, refresh hub, push, feature map, client runtime, phone notifications); Kin web browser tests 8 files, 11 tests.

🤖 Generated with Claude Code

Surajsm60720 and others added 18 commits November 18, 2026 15:43
A teammate's own agents (Claude Code on their computer) could not read the
Kin tasks they hold on someone else's server. The bridge joins with a device
join link, keeps the session in ~/.config/kin-bridge (0600), and serves
kin_tasks and kin_task_update over stdio, calling kin.work.* as that person,
so the server's own team rules decide what it sees and may change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A teammate needed the owner for every new device, and every device signed out
after 30 days. Now a person lists and removes their own devices, makes a
one-use code and link (ten minutes) that adds a device to their own account,
and a device in use renews its session under a fresh deadline (same session,
so pushes and bindings stay). A person's own link never brings back someone
the owner removed; code guesses are rate limited; ten devices a person.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion in the Keychain

`kin-mcp-bridge join` takes a Linked devices code (with --server the first
time) or link. Each use renews the session once it is in its last 23 days, so
a laptop in use stays signed in. On macOS the session lives in the login
Keychain (written through `security -i`, so the token never sits in argv), and
an older session file moves there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ession

A teammate manages the phones and computers signed in as them, removes any,
and links one more with a one-time code, link and QR. The phone renews its
bearer once a run and the browser its cookie, so a device in use stays
signed in; the owner sees and removes a teammate's devices. The bridge gains
kin_link, renews before each call, and won't move to another server from a
tool. Wrong codes pause only their sender.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts old row

Accept takes the joining device's kind, so a laptop or browser no longer lists
as a phone. The bridge removes its previous session when it links again, so
Linked devices doesn't fill with stale copies. Device copy shared once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A device link only redeems while the device that made it is still
  signed in; the new device records which device linked it.
- Removing a device signs out every device linked from it and cancels
  the links they left open. A linked device removes only itself and
  what it linked.
- The 10-device limit holds when a link is used, not only when made.
- Self-links stay out of the owner's invite list and can't be cancelled
  there.
- The device list shows a session signed out any way as signed out;
  "Last used" is now "Last connected".
- An open socket sees a renewed deadline instead of closing at the old
  one; web and phone retry a renewal that failed.
- The cookie renewal route needs the app's own Origin, scheme included.
- Each linked device rings the person's phones.
- Migration renumbered to 175 (#496 holds 174).
- The MCP bridge and typed codes are out of this PR; link and QR remain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Cookie renewal accepts the app's own origin behind a proxy
  (X-Forwarded-Host or same-origin fetch), still on the request's scheme.
- Web renews when a tab is shown again and the phone when it returns to
  the front, at most daily, so a long-open app doesn't sign out.
- A link replaces only the last one the same device made.
- The new-device push leads with the kind of device the host saw; the
  phone route no longer takes a device type from the body.
- Tests: linking rings the person and the new device hears nothing of
  itself; proxied and same-origin renewals pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Signing out a session by any path (Kin's Remove, Sharing & access,
  the CLI, a proof key) signs out every device linked from it and
  cancels the links they left open, in the same transaction. Plain
  expiry does not cascade.
- Removing a device checks inside its transaction that the asking
  device is still signed in.
- The owner's invite list and cancel respect who the caller may act on.
- The 10-device limit also holds for an owner's invite for someone
  already at it.
- Renewal routes answer 500 for host faults, so clients retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	apps/server/src/kin/persistence/KinMigrations.test.ts
#	apps/server/src/kin/persistence/KinMigrations.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Phone renewal goes only through the live, checked connection and never
  overwrites a token a re-join saved; web and phone renew hourly while open
- A co-owner can't invite their own person; their devices come only from links
- Authority and time are read inside each transaction; links record their id
- The renew route refuses null or malformed origins and trusts forwarded
  hosts only from a loopback peer; a full device list reads as such, not a bad link
- Pushes skip signed-out or expired devices; a self-link posts a fixed notice in Kin
- Removal copy walks the whole chain; "just linked" matches by link id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Renewal leaves this change: devices keep today's 30-day session
- A removal walks from the device named, whatever its session's state, and
  each step stays with one person in one company; a re-pair is a sign-out
- A signed-out session acts as no one, and an open socket rechecks its row
  every minute, so a sign-out from the CLI closes it
- Sign-out notices, chat events and authority reads sit inside the write's
  transaction; a team with no Team agent hears of a new device in its chats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its write

- A barrier lands a removal or demotion just before each call opens its
  transaction; triggers record what every write saw of its maker
- Removing a device whose session already ended, a re-pair, and a forged
  cross-person link; two redeemers leave exactly one session
- A sign-out written by another process closes an open socket in a minute
- With no Team agent, the new-device notice lands in the person's direct chats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bring the linked-devices work up to date with kin. DeviceLinks moves
from K176 (now RecordComments) to K179, after AskOutsideAndDispatch.
KinPeople keeps the authority reads inside the write transaction and
kin's new-person retry, removed-person refusal, held-question close and
waiting cancellation; that cancellation now publishes after commit like
the rest of removal. KinPushSender keeps kin's subject-aware recipients
and the device-link exceptSession filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T23:07:50.772177Z 276e27c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@GLDRoger
GLDRoger merged commit d9067a0 into kin Nov 18, 2026
@GLDRoger
GLDRoger deleted the merge/linked-devices branch November 18, 2026 23:06
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.

2 participants