Repository navigation
Description
Overview
One daemon serves several databases, but its settings sit in one file per machine, ~/.nodespace/daemon.toml, and apply to every database: provider configs with their API keys, session capture, and whether external tools may be served. ADR-095 decides that every setting the daemon acts on is a field of the routed database's database-settings node, and that the file no longer exists.
Problem Statement
- A setup made for one database is the setup of every other: a work database and a personal one share provider endpoints and keys, and one capture choice.
- The file is a second store with its own reader, writer, lock, permission handling and gRPC service (
packages/daemon/src/services/settings_service.rs). database-settingsalready exists per database and holds one field,required_extensions.
Proposed Solution
Declare the settings as fields of database-settings, read and write them in the database a request is routed to, and delete daemon.toml with its reader, writer and gRPC service. Change the shape and reset the database; nothing reads an existing daemon.toml.
Documentation
- ADR-095 - the decision: the fields, one write path, what each consumer reads, new-database defaults, scope (the app's window preferences stay with the app).
- Node type sequence - mandatory: this adds fields to a core type and changes its kind.
- ADR-086 - closed schemas, the typed update, nested declarations, one definition per wire type.
- ADR-083 §2 - the settings singleton, its base bucket and retyping by another build.
- ADR-053 §3 - request routing to a database.
- ADR-056 - the routing probe and its cached verdict.
- ADR-038 (Trust Boundary) - explicit enablement of external tools.
- Updates, pushed just before the merge: the
database-settingssheet in Node Types (the merge gate compares it with the schema); daemon-cli-protocol.md and daemon-cli-lifecycle.md (state paths no longer list a settings file); agent-eval.md (what an isolated daemon lacks); ADR-056's sentence on where the verdict is cached.
Architecture Impact
Implements ADR-095, which supersedes ADR-053 §2 in part (no settings file beside the registry) and amends ADR-083 §2 (database-settings declares more than required_extensions) and ADR-056 (where probe verdicts are cached). The ADR is committed; no further decision change is needed.
Acceptance Criteria
The type
-
database-settingsdeclarescapture_enabled(boolean, defaultfalse),capture_content(enummetadata_only/summary/full, defaultmetadata_only),external_tools_enabled(boolean, defaultfalse) andproviders(list, default[]), besiderequired_extensions, all in its base bucket. - A provider config is a declared nested object:
id(UUID),name,base_url,api_key,model,routing_ok(map from served model to boolean). snake_case keys, norename_all,deny_unknown_fields. - The registry entry is a structured core type; it stays a leaf, a singleton with id
database-settings-singleton, and not embedded. - The wire type and the typed update in
nodespace-typescarry the new fields; TypeScript is regenerated (bun run gen:types) and committed. - The typed update writes, clears and rejects each field as the sequence's tests require: wrong type, an enum value outside the vocabulary, an unknown key in a provider config, a provider without an id.
- A database whose singleton has been retyped to an extension subtype still has its base-bucket settings read and written (fixture subtype, not a product name).
Consumers
- The local agent resolves
openai-compat:<uuid>against theprovidersof the chat's database; a config that exists only in another open database is not found. - The routing probe stores its verdict in that config's
routing_ok, and the verdict is dropped when the config's endpoint or model changes. - Session capture reads its choice from the session's database when the session starts.
-
nodespace mcpserves tools for a database only when that database'sexternal_tools_enabledis true;nodespace mcp installanduninstallset the flag in the database they are run for, and say which database that is. - Two databases open in one daemon with different settings each behave by their own, in one test.
- A new database starts with capture off, external tools off and no providers.
Removal
-
daemon.toml,DaemonConfig, its reader, writer, lock and permission handling, the settings gRPC service and its proto messages, and the Tauri commands that called it are deleted. Nothing reads an existingdaemon.toml. - The Settings screen reads and writes through the settings node's typed update.
- No compatibility code, no carry-over of file contents into a database.
Guidance and docs
- CLI guidance: the skill's CLI reference describes the
mcpcommands' per-database behaviour and how to read and change a database's settings; SKILL.md drift check passes. - The eval preflight's isolation message (
scripts/eval/preflight.ts) no longer mentionsdaemon.toml. - The docs listed above are updated;
bun run node-types:checkpasses. -
bun run test:changedpasses; code passesbun run quality:fix.
Technical Specifications
Reference Files
packages/daemon/src/services/settings_service.rs:DaemonConfig,CaptureConfig,OpenAiCompatConfig(withrouting_ok),McpConfig; the service to delete.packages/proto/proto/settings_service.proto: the messages to delete.packages/daemon/src/services/assembly.rs: wheredaemon.toml's path is handed to the local agent and capture.packages/daemon/src/services/local_agent_service.rs: provider lookup and model discovery.packages/daemon/src/services/capture_service.rs: reads the capture choice at session launch.packages/cli/src/commands/mcp.rs:enforce_enabled,install,uninstall.packages/nodespace-types/src/database_settings.rs:DatabaseSettingsNode,DatabaseSettingsNodeUpdate.packages/nodespace-types/src/core_type.rs: thedatabase-settingsregistry entry.packages/core/src/models/core_schemas.rs: the schema.packages/desktop-app/app-lib/src/commands/settings.rsandpackages/desktop-app/src/lib/stores/settings.svelte.ts: the Settings screen's commands and store.
Implementation Details
- The app's window preferences (
packages/desktop-app/app-lib/src/preferences.rs: theme, Markdown rendering, import sources) are out of scope and stay where they are. - An API key is node data: every surface that reads the settings node returns it. ADR-095 records that and adds no redaction; do not add one here.
- Removing the gRPC service and the Tauri commands changes nothing in the extension host API unless a watched file is touched; if one is, the push check requires an
EXTENSION_API_VERSIONbump. - The agent's prompt text is unaffected unless it names
daemon.toml; if a model-facing string changes, regenerate the prompt golden and review the diff.
Related Issues
- Three unverified checks on the OpenAI-compatible (BYO-key) path against a hosted provider #2189 (exercises the provider configs this moves)
- Make the daemon's settings file follow NODESPACE_HOME #3605 (made the settings file follow NODESPACE_HOME; the file goes)
Non-Goals
- Sharing or copying a setup between databases.
- Hiding provider keys from agents or other readers of the settings node.
- Moving the app's window preferences.
Activity
malibio commentedon Oct 6, 2026
Frontend: 5880 passed (322 files)