Repository navigation
feat(clients): each client's own key, proof of use by that key, and how to connect it by hand - #98
Merged
Merged
Conversation
…ow to connect it by hand
- `/clients` gives every client the key generated for it and when that key
was last used. "In use" was proven by the client name a request's headers
claim, which any program can write; the key is something only the
gateway assigns. `Db::last_seen_by_hint` goes with it.
- Every adoptable client now says how to connect it by hand (`manual`):
which file to open, the fields adoption would write (the key field
flagged `secret`, never valued) and the gateway address in the form that
client wants. A client that is not detected can still be pointed at the
gateway.
- Manual-only clients get an id and structured steps (`setup`) instead of
one sentence with the address baked in (`how`), so the address and the
key can each have a copy button. Gemini CLI's steps now include the key.
- `POST /clients/{id}/key` prepares the client's own key: the one kept for
it, or a new one bound to it. Adoption goes through the same function,
so a key made while configuring Cursor by hand is marked as Cursor's the
way an adopted client's key is.
- Plans say which key goes in and whether it is made at that moment
(`key`, `key_created`); a restore plan names the key that is kept and
now lists the fields it removes. `FieldChange.secret` marks the key field.
CONTROL_API_VERSION goes to 7.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fylorn
force-pushed
the
feat/clients-page
branch
from
September 22, 2026 04:51
f94b567 to
0d72f63
Compare
Merged
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.
Why
The desktop app's Clients page is being rebuilt as a table: status, the key each client uses, recent requests, and a way to connect any client by hand. Four facts it needs were missing or wrong in
/clients:clients[].client), the response did not.last_seen_mscame from the client name in request headers, which any program can claim. After adoption each client has its own key — that is the proof worth showing.What changes
DetectedClientgainskey(the key generated for it, kept after a restore) andmanual(how to connect it by hand);last_seen_msis now the last request made with that key.Db::last_seen_by_hintis removed.ManualSetup { steps, fields, endpoint }: for an adoptable client, "open this file and set these fields" plus exactly the fields adoption writes (tw_adopt::clients::edits), the key field flaggedsecretand never valued, and the address in the form the client wants (/v1or not). Zed gets an extra step for its key, which lives in Zed's own settings.ManualClientgainsid,key,last_seen_msandsetup;howis gone. The steps no longer contain the address — the UI gives the address and the key their own copy buttons. Gemini CLI's steps now includeGEMINI_API_KEY(the gateway already acceptsx-goog-api-key).POST /clients/{id}/key→ClientKey { name, key, created }: the key kept for that client, or a new one bound to it (free_name). Adoption'sensure_keynow goes through the sameprepare_key, so a key made while configuring Cursor by hand is recorded as Cursor's exactly like an adopted client's key.PlanViewgainskeyandkey_created: which key an adoption will write and whether it is created at that moment; a restore plan names the key that stays, and now lists the fields it removes instead of none.FieldChange.secretreplaces the path heuristic (token/keyin the name) with the flag adoption itself uses.twcore clientsprints the new steps and address.CONTROL_API_VERSION→ 7 (ManualClient.howremoved).Tests
tw-control/tests/adopt.rs: a manual client's key is made once, bound to it and listed; every client says how to connect it by hand (paths,/v1or not, the key field never valued, no address inside a step); plans name the key and whether it is new, before and after adopt/restore; "in use" follows the client's own key while a request that only claims to be Claude Code does not count.tw-adopt: every adoptable client has manual steps and an endpoint in the right form; Zed's extra step; every step carries a code.tw-store: the observation-window test now asks by key.cargo fmt --check,clippy -D warnings,cargo test --workspaceandscripts/smoke.sh(51 passed) pass locally.🤖 Generated with Claude Code