feat: add providers without a default model

The add-provider form asked for a model even though the room owns that choice. It now asks for a name, kind, base URL, and key. New providers store no default, and New room requires a model before it can submit.

Existing providers keep their model as an optional default. The model picker hides the Provider default row when there is none, and a room with no usable model gets a clear error instead of an empty model reaching the provider.
This commit is contained in:
vhaudiquet committed 2026-11-28 17:31:52 +01:00
1 parent 2216f37422
commit 369075a842
10 files changed
+48 -33

No files matched your search

+7 -4
View File
@@ -38,7 +38,7 @@ later, it can move into a crate the way `rhema-cloud-agent` did.
- **Turn:** one agent run, started by a mention, made of steps.
- **Step:** one model exchange, the `Agent::step` primitive.
- **Sandbox target:** an account's remote machine, reached over ssh.
- **Provider config:** an account's model backend, model id, and key.
- **Provider config:** an account's model backend and key.
"Room" is the product word. "Session" stays reserved for
`rhema_core::Session`, the model's memory, and for the login session.
@@ -56,7 +56,7 @@ A room holds:
| workspace | the sandbox directory the room lives in |
| sandbox_target | the owner's ssh target |
| provider_config | whose model key pays |
| model | model id, may change per room |
| model | model id chosen for this room |
| max_turn_steps | runaway guard, default 48 |
| created_at, archived_at | |
@@ -535,7 +535,9 @@ One SQLite file in WAL mode.
```
accounts(id, handle, display_name, email, password_hash, created_at)
auth_sessions(token_hash, account_id, created_at, expires_at, last_seen)
provider_configs(id, account_id, kind, model, base_url, key_ciphertext)
provider_configs(id, account_id, name, kind, model, base_url, key_ciphertext)
-- model is an optional default kept for existing rows; rooms carry
-- the model that turns use
sandbox_targets(id, account_id, name, host, user, port, key_ciphertext,
workspace_root, host_key, created_at)
rooms(id, name, owner_id, workspace, cwd, sandbox_target_id,
@@ -667,7 +669,8 @@ 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.
id is always accepted. Adding a provider asks for its kind and key;
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.