Skip to content

config: split mecatui client settings out of the server settings.yaml into its own file #459

Closed

Description

@jbeda

Problem

mecatui (the TUI client) and mecated (the server) share ONE operator settings file, ~/.config/mecatl/settings.yaml. That file's schema is owned by the server (internal/adapter/permconfig/schema.go, parsed strictly), and the auto-generated reference (docs/configuration-reference.md) reflects ONLY the server's schema. mecatui reads exactly ONE key of its own from the same file — keymap: — via a SEPARATE lenient decoder (cmd/mecatui/keymap_wiring_yaml.go:16-56), which the server's parser silently drops (lenient top level, schema.go:51-54).

This is the early stage of the git regret model (one config namespace read by different binaries, operator can't tell scope from the file): two decoders, one file, and the generated reference shows only the server's view, so the client's keymap: key is invisible in the very doc an operator greps.

Prior art (investigated)

  • git is the cautionary tale: a unified namespace (receive.* read by the server side, the rest by the client) is widely seen as the thing to avoid; downstream tools (gitolite/gitea) layer separate server config on top to escape it.
  • VS Code Remote is the strongest analogue: the client owns the server's lifecycle but keeps its own config in a separate store and pushes nothing (or a narrow typed payload at spawn). Client UI settings (keybindings, theme) are never pushed to the server.
  • ssh/sshd, Docker CLI/daemon — total split, disjoint key sets, different files.
  • kubectl proves a single file is fine ONLY when ownership is unambiguous (kubeconfig is 100% client). Ours is ambiguous → split is lower-risk.
  • tmux reads one file at server-spawn, but ONLY because tmux has no genuine client-only concerns. mecatui does (keymap, theme, UI behavior) → the tmux shape doesn't transfer.
  • Client→server push, when needed, should be a typed one-time payload at spawn (LSP initializationOptions, devcontainer.json customizations.vscode.settings), never a shared schema or UI keys.

What would move

If mecatui got its own settings file (e.g. ~/.config/mecatui/settings.yaml — note the mecatui/ dir, matching the existing mecatui/themes/ content tree and mecatui/models.yaml state), exactly the groupUI set moves (cmd/mecatui/helpmeta.go:72-82):

  • keymap: (the one key the server already ignores; clean move)
  • Theme: --theme/MECATUI_THEME, --theme-dir, --list-themes → gain a settings-file home
  • UI behavior: --no-alt-screen/--inline, --no-mouse/MECATUI_NO_MOUSE, --no-banner, --terminal-title/MECATUI_NO_TERMINAL_TITLE
  • Env-only knobs: MECATUI_NO_EMOJI/MECATUI_FORCE_EMOJI, MECATUI_NO_KITTY/MECATUI_FORCE_KITTY, MECATUI_DEBUG_MOUSE, MECATUI_DEBUG_KEYMAP
  • --quiet is the ONE split input: its banner-suppression half moves client-side; its embedded-server-diagnostics-sink half stays server-side.

Everything else mecatui accepts is pass-through to the embedded mecated (inert under mecatui connect, marked connect: false in helpmeta.go) and STAYS in the server file: every provider/model/posture/guardrails/storage/soul/usermodel/skills/commands/perf flag, and every settings.yaml key the server reads (permissions:, guardrails:, posture:, models:, reasoning-effort:, plan-mode-auto-approve:).

Design questions to resolve

  • File location: ~/.config/mecatui/settings.yaml (own tree) vs a mecatui: subtree in a shared file (rejected — perpetuates the mixed-namespace problem).
  • Migration: an existing keymap: in settings.yaml must keep working (read both, new file wins) or warn-and-point. Don't break operators who set it under docs: mecatui keybindings are configurable but undocumented #455.
  • Schema + a generated reference for the client file (a mecatui sibling to the server's configgen reference — likely a separate document, since the server one is explicitly mecated-scoped).
  • Precedence: flag > env > client-settings-file, matching how the flags/env work today.
  • Whether the embedded-server lifecycle ever needs a typed client→server payload (the LSP pattern) — out of scope for v1, but note it.

Related

Activity

  1. added
    tui
    on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions