Skip to content

Move the daemon's settings into each database's settings node and delete daemon.toml (ADR-095) #3649

Closed

Description

@malibio

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-settings already 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-settings sheet 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-settings declares capture_enabled (boolean, default false), capture_content (enum metadata_only / summary / full, default metadata_only), external_tools_enabled (boolean, default false) and providers (list, default []), beside required_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, no rename_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-types carry 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 the providers of 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 mcp serves tools for a database only when that database's external_tools_enabled is true; nodespace mcp install and uninstall set 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 existing daemon.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 mcp commands' 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 mentions daemon.toml.
  • The docs listed above are updated; bun run node-types:check passes.
  • bun run test:changed passes; code passes bun run quality:fix.

Technical Specifications

Reference Files

  • packages/daemon/src/services/settings_service.rs: DaemonConfig, CaptureConfig, OpenAiCompatConfig (with routing_ok), McpConfig; the service to delete.
  • packages/proto/proto/settings_service.proto: the messages to delete.
  • packages/daemon/src/services/assembly.rs: where daemon.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: the database-settings registry entry.
  • packages/core/src/models/core_schemas.rs: the schema.
  • packages/desktop-app/app-lib/src/commands/settings.rs and packages/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_VERSION bump.
  • 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

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

  1. malibio commented on Oct 6, 2026

    @malibio
    CollaboratorAuthor

    Frontend: 5880 passed (322 files)

  2. self-assigned this
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions