Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
# model authentication
model authentication is supplied by model-provider extensions rather than the daemon configuration loader.
## credentials
Every secret albedo keeps lives in `$ALBEDO_HOME/creds.json`, mode `0600`, and only the daemon reads or writes it. It has three sections: `accounts` holds OAuth accounts (and an optional `alibaba` key) by store key, one object or an array; `providers` holds each profile's `apiKey` by profile name; `mcp` holds each MCP server's `bearerToken`, `headers` and `env` by server name. All credential and settings mutations share one per-home daemon lock. OAuth refreshes retain their re-read under that lock and preserve other sections. `config.json` keeps no keys: an `apiKey` still written there by hand is used and wins over the saved one until the next daemon start moves it.
At start the daemon moves secrets still kept elsewhere into `creds.json`: `auth.json`'s accounts, `mcp-credentials.json`'s servers, and each `config.json` profile's `apiKey`. It writes `creds.json` first, then moves the old files into `backups/` as `<name>-before-creds-<ms>` with every mode bit cleared, so an interrupted start loses nothing and the next one finishes. Not even their owner can read the backups without `chmod 600` first, so tools and agents running as the user never read them by accident; `rm -f` deletes them.
Clients save provider profiles and MCP configuration with credentials through the [settings API](settings.md). They only learn which credentials are saved. The existing authentication routes remain available. `GET /auth/credentials` answers `{"providers": [profile...], "mcp": {server: {"bearerToken": bool, "headers": [name...], "env": [name...]}}}`. `POST /auth/credentials/migration` answers `{"moved": [file...]}` with the files this daemon's start moved secrets out of, to the first client that asks and `[]` after; the CLI asks before its TUI starts and, after a migration, prints where the secrets went and the `rm -f` for the backups, then waits for enter. `PUT /auth/credentials/provi…