feat(config): persist config.patch updates atomically

This commit is contained in:
William Valentin
2026-02-15 22:03:21 -08:00
parent c314e0f067
commit 0220ec10dd
13 changed files with 205 additions and 11 deletions
@@ -15,6 +15,7 @@ Scope: Production-risk-first audit of bugs, code improvements, and feature oppor
- ✅ F-009 addressed: gateway now enforces per-connection WebSocket ingress rate limits with deterministic throttle errors and close-on-repeated-violation behavior.
- ✅ F-008 addressed: WhatsApp Chromium launch is now sandboxed by default; no-sandbox mode is behind explicit `whatsapp.no_sandbox: true` opt-in.
- ✅ F-014 addressed: `ModelRouter.setOnTierChange` now preserves existing listeners instead of replacing them, removing destructive listener-setter behavior.
- ✅ F-002 addressed: `config.patch` now supports durable persistence via atomic write + backup when daemon has a concrete config path, and response includes `persisted`/`persistError` so UI can distinguish runtime-only vs disk-persisted updates.
## Executive Summary
+23
View File
@@ -2524,6 +2524,29 @@
"docs/plans/analysis/2026-02-16-codebase-audit-report.md"
],
"test_status": "pnpm test:run src/models/router.test.ts + pnpm typecheck passing"
},
"audit-followup-config-patch-persistence": {
"status": "completed",
"date": "2026-02-16",
"updated": "2026-02-16",
"summary": "Implemented durable config.patch persistence when config path is known: patches are applied to a draft, atomically written to disk with .bak backup, then committed to runtime config only on successful persist. Added persisted/persistError response fields and settings UI messaging for runtime-only saves.",
"files_created": [
"src/config/persistence.ts",
"src/config/persistence.test.ts"
],
"files_modified": [
"src/config/index.ts",
"src/gateway/handlers/config.ts",
"src/gateway/handlers/handlers.test.ts",
"src/gateway/server.ts",
"src/daemon/services.ts",
"src/daemon/index.ts",
"src/cli/start.ts",
"src/cli/setup.ts",
"src/gateway/ui/pages/settings.js",
"docs/plans/analysis/2026-02-16-codebase-audit-report.md"
],
"test_status": "pnpm test:run src/gateway/handlers/handlers.test.ts src/config/persistence.test.ts + pnpm typecheck passing"
}
},
"overall_progress": {