#okay, got codex to review this. config
1 messages · Page 1 of 1 (latest)
Handover: Nix mode vs wizard/config UI (commit 53baba71)
Problem summary:
- Nix installs set CLAWDIS_NIX_MODE=1 and manage config declaratively.
- The new wizard RPC + Control UI config editor still write to CLAWDIS_CONFIG_PATH (usually
~/.clawdis/clawdis.json).
- In Nix installs the config file is immutable/read‑only, so wizard/config writes will fail
(EACCES) and users get confusing errors + drift risk.
Current behavior (from 53baba71):
- Nix mode only affects:
- startup: legacy config entries => hard error (no auto‑migration). src/gateway/server.ts:1372-
1387
- logging: “running in Nix mode”. src/gateway/server.ts:7247-7249
- Wizard RPC is still enabled and writes config:
- endpoints in gateway: src/gateway/server.ts:5435-5595
- writes config in wizard flow: src/wizard/onboarding.ts:426-432 (plus earlier writes)
- Config editor writes config:
- config.set handler: src/gateway/server.ts:2820-2912
- writeConfigFile: src/config/config.ts:1776-1782
- macOS app already disables onboarding/config UI in Nix mode:
- onboarding skipped: apps/macos/Sources/Clawdis/Onboarding.swift:18-24
- config settings disabled: apps/macos/Sources/Clawdis/ConfigSettings.swift:77-99
- Legacy keys now rejected in Nix mode:
- routing.groupChat.requireMention removed
- telegram.requireMention removed
- new schema prefers *.groups."*".requireMention + routing.groupChat.mentionPatterns
- legacy rules/migrations: src/config/config.ts:1348-1516
Recommendation (short-term):
- Explicitly disable wizard + config writes in Nix mode at the gateway layer:
- Reject wizard.start/next (and likely cancel/status too) with UNAVAILABLE + “Nix mode:
onboarding disabled; config is read‑only.”
- Reject config.set with UNAVAILABLE + “Nix mode: config is read‑only; edit via Nix.”
- Allow config.get + config.schema (read‑only) so UI can still display.
- Longer-term: wizard/config editor could generate Nix config (future work).
Why this matters:
- Current behavior gives confusing failures (immutable file) and undermines declarative
guarantees.
- macOS already treats Nix mode as “read‑only”; gateway should enforce the same policy.
Session context: prompts + findings
1) Prompt: “clone commit 53baba71… review intent… compare with nix‑clawdis.”
Finding: Commit unifies onboarding via shared wizard engine, adds config JSON Schema + UI
hints, exposes wizard RPC and config schema; Nix module currently emits legacy config keys that
upstream now flags, and Nix mode is only a startup check + log, not a write guard.
2) Prompt: “what’s the surface of interaction with NIX_MODE install?”
Finding: Wizard + config editor still write to CLAWDIS_CONFIG_PATH; macOS UI disables
onboarding/config in Nix mode; web UI does not; gateway doesn’t block writes.
3) Prompt: “nix‑managed files are read‑only immutable.”
Finding: config.set and wizard writes will fail with EACCES/EPERM, leading to confusing UX and
drift risk unless gateway blocks in Nix mode.
4) Prompt: “disable wizard/onboarding/config features; maybe later write Nix config.”
Finding: Agreed; short‑term should disable write endpoints in Nix mode with clear errors;
allow read endpoints only.
lol at long messages being paywalled btw
paywalled?
if you paste in a message > 2k chars it says "too long, you need discord nitro" (i guess discord premium), then you can do 4000 char messages lol