feat: sign in to Copilot, ChatGPT, and Mistral Vibe

Three provider kinds have a browser sign-in, but the add-provider
dialog only accepted a pasted key. A per-account login record now runs
the adapter's InteractiveLogin on the server, reports the instruction,
URL, and code to the dialog, and stores the credential before the
browser sees completion. The credential never reaches the client.

The dialog gets a sign-in stage for flow kinds, with a link, a
copyable code, and retry after failure. Closing the dialog cancels the
flow. ChatGPT's callback lands on the server's loopback port, and the
instruction names the port to forward.
This commit is contained in:
vhaudiquet committed 2026-11-28 18:06:21 +01:00
1 parent 369075a842
commit f5087220da
12 files changed
+927 -23

No files matched your search

+26 -3
View File
@@ -526,7 +526,29 @@ private range in the config when every user is on the same network.
Provider keys and sandbox private keys are encrypted at rest with a key
from the environment or a 0600 file. The server refuses to start without
it. No route, log line, or event carries a key.
it. No route, log line, or event carries a stored key.
### Provider sign-in
GitHub Copilot, ChatGPT, and Mistral Vibe do not ask for a key. The
server runs the adapter's `InteractiveLogin` and keeps a per-account
record of its last update. The browser asks the server to start the
flow, polls the record, and renders the instruction, URL, and code. It
never receives the credential. When the adapter completes, the server
seals the credential and inserts the provider row before the browser
sees the completion, so a missed poll cannot lose a token. Closing the
dialog cancels the flow. Records expire after 15 minutes, and only
their owner can read or cancel them. They live in memory, so a restart
drops a sign-in in progress. No provider row exists until the adapter
completes.
ChatGPT's callback returns to loopback port 1455, or 1457 when 1455 is
taken. The machine that runs the browser must forward that port to the
server before opening the URL. Copilot's device code and Mistral Vibe's
console sign-in need no inbound port.
A sign-in URL can carry a short-lived device or PKCE token. The server
does not log it, and it is not the stored provider key.
## 9. Storage
@@ -669,8 +691,9 @@ This repository, as committed:
provider switch.
- A model picker over the provider's live catalog, with context,
output, price, and vision from the adapter and models.dev. A custom
id is always accepted. Adding a provider asks for its kind and key;
the room chooses the model.
id is always accepted. The add-provider dialog asks for a kind and
key, or runs a sign-in for GitHub Copilot, ChatGPT, and Mistral Vibe.
The room chooses the model.
- One conversation per room, a `@rhema` mention starts a turn, human
messages are stamped with their author's name, and only the `message`
tool puts agent text in the room.