Configuration: 2.0 — the CLI uses its server's models

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HomerandClaude Opus 5.5 committed 2026-10-27 21:56:21 +00:00
1 parent d4cca47045
commit 5241eff7e0
1 file changed
+41 -11
+41 -11
@@ -14,7 +14,7 @@ may not set, and what to touch when adding a key.
| File | Scope | Notes |
|---|---|---|
| `~/.config/lembas/connections.yaml` | global only | Endpoints, dialects, models, keys. Written `chmod 600`. A project can never define or override a connection. |
| `~/.config/lembas/connections.yaml` | global only | **2.0: the login, and nothing else** — one `type: webui` entry naming the LLeMbas server, its key as `{file:}` to a 0600 file beside it, written by `lembas login`. Written `chmod 600`. A project can never define or override it. |
| `~/.config/lembas/config.yaml` | global | Everything else. |
| `<project>/.agent/config.yaml` | project | Read **only once the directory is trusted**. `.lembas/` is used instead when `.agent/` already belongs to another tool (`project/root.ts`). |
| `~/.config/lembas/{agents,commands,skills,memory}/` | global | Subagents, custom commands, skills, memory. The project's `.agent/agents`, `.agent/commands` and `.agent/skills` count only when trusted. |
@@ -39,18 +39,48 @@ the tests and the smoke test use (`config/paths.ts`).
an error, never an empty string. A URL field accepts a placeholder and is
checked again after substitution. `mcp`, `voice`, `search` and `update` are
filled one entry at a time, so one broken server or service turns off that
one thing, not the whole file. A connection whose substitution fails lands in
`broken` with the reason.
one thing, not the whole file. A login whose substitution fails (its key file
gone) lands in `broken` with the reason, and no model resolves until it is
made again.
4. **Merge**: objects key by key, everything else replaced, project over global.
**Permission rules stack** instead (global first, then project), and a
project's rule cannot loosen a global one.
5. **`webui` connections are expanded** (`lembas/webui.ts`): one entry naming a
LLeMbas instance becomes the OpenAI-chat connection it is spoken to as, with
the account's models from `/v1/models` — refreshed at every start, kept from
the last good read when the instance cannot be reached. The account's
personalization replaces the local keys while logged in
(`lembas/personal.ts`). Models get refs (`provider/refs.ts`): an instance's are
`<provider>/<model>`.
5. **The login is expanded** (`lembas/webui.ts`): the one `webui` entry becomes
the server's `/v1` as it is spoken to (an internal `Connection`, no longer a
schema anyone writes), with the account's models from `/v1/models` —
refreshed at every start, kept from the last good read when the server cannot
be reached. The account's personalization replaces the local keys while
logged in (`lembas/personal.ts`). A model's ref is the id the server serves it
under (`deepseek/deepseek-flash`, `provider/refs.ts`); the older forms
(`<login>/<id>`, `<login>/<model>`) still resolve, and config.yaml is
rewritten from them once (`migrations.json` in the state directory).
## Custom connections — removed in 2.0
LLeMbas CLI 2.0 is LLeMbas-server-specific (CLI rule 2). It talks to the server
it is logged in to and uses that server's models, and nothing else; there is one
client, `provider/openai-chat.ts`. What went with the custom connections:
- the `anthropic`, `gemini`, `ollama` and `responses` dialects, context
discovery and llama-swap unloading (`provider/discover.ts`);
- a connection's `dialect`, `base_url`, `auth`, `key_cmd`, `discover`,
`unload_url`, `unload_method`, `one_model_at_a_time`; a model's `fallback`,
`effort_map` and `cache`;
- several logins at once: a login to another server signs this machine out of
the previous one.
An entry of any other kind left in `connections.yaml` from 1.x is **read past
with a warning** naming it and saying how to log in, so an old file still starts.
Several logins left from 1.x: the one logged in to last is used, and the others
are named. Without a login there is no model: the error (`NOT_LOGGED_IN` in
`provider/index.ts`) and the first-run screen say `lembas login <address>`.
What the server says about a model is what the CLI knows: its context window
(`contextWindow`, no discovery), its efforts, vision, and its capacity
(`capacity.group`, `single_session` — the subagent capacity rule reads only
these). Embeddings go to the server's `/v1/embeddings`, by an embedding model's
served id. The entry's own `models:` may still adjust what the server says about
a model; it is rarely needed.
## Settings while running (`src/config/settings.ts`, `src/settings.ts`)
@@ -63,7 +93,7 @@ then the project's file, then the global file, then the fallback. Writing uses
`yaml`'s `parseDocument … setIn`, so the user's comments and layout survive.
**Not in the list, on purpose:** permission rules, the hardline, MCP servers,
connections, the update source and key, and `settings_tool` itself. Those are
the login, the update source and key, and `settings_tool` itself. Those are
edited by hand, never by the agent.
## JSON Schemas