Skip to content

Expose backend settings in UI (System→Runtime tab) + fix config clobbering#262

Merged
ANonABento merged 2 commits into
mainfrom
expose-settings-ui
Jun 9, 2026
Merged

Expose backend settings in UI (System→Runtime tab) + fix config clobbering#262
ANonABento merged 2 commits into
mainfrom
expose-settings-ui

Conversation

@ANonABento

Copy link
Copy Markdown
Owner

From a settings-exposure audit. Two commits.

feat: System → Runtime tab

The backend AppSettings (global defaults, session/GC lifecycle, limits) had no UI — only hand-editable in settings.json, despite get_app_settings/update_app_settings already existing. The "raise mcp_max_recursion_depth" error even pointed at a setting with no control.

New Settings → System → Runtime tab exposes them all:

  • Global defaults: default agent CLI · model · session strategy · advance mode
  • Sessions & cleanup: max agent sessions · GC interval · idle sleep/kill · archive purge
  • Limits: MCP recursion depth · claude/codex min versions

Commits on blur (no settings.json write per keystroke). Extends the AppSettings IPC type; verified merge_update covers every exposed key.

fix: workspace-config clobbering (a real latent bug the audit found)

The workspace config JSON had two writers that overwrote each other (last-write-wins → silent settings loss): the Workspace tab preserved everything, but useSettingsSync serialized only its {agent,git,voice,model} slices and replaced the whole blob, wiping the flat keys (defaultModel, maxConcurrentAgents, autoAdvance, …). Now it re-reads + merges instead of replacing. Also reconciles the branchPrefix split-brain (feat/ vs kaitencode/ — three defaults → one).

Audit corrections

The audit overstated the "small gaps": the Voice tab already exposes language/hotkey/push-to-talk/sensitivity, and advanced.notesDebounceMs/outputBufferIntervalMs are dead settings (unused) — deliberately not surfaced.

tsc · lint · vitest (419) green.

… tab

A settings audit found the backend AppSettings (global defaults, session/GC
lifecycle, limits) had NO UI — they were only editable by hand-editing
~/.kaitencode/settings.json, even though the app already has
get_app_settings/update_app_settings commands. The "raise mcp_max_recursion_depth"
error even told users to change a setting with no control.

Adds Settings → System → Runtime exposing every previously-UI-less AppSettings,
grouped:
- Global defaults: default agent CLI, model, session strategy, advance mode.
- Sessions & cleanup: max agent sessions, GC interval, idle sleep/kill,
  archive purge.
- Limits: MCP recursion depth, claude/codex min versions.

Text/number fields commit on blur (no settings.json write per keystroke); selects
commit on change. Extends the AppSettings IPC type with claude_min_version /
codex_min_version / mcp_max_recursion_depth (all already handled by the backend
merge_update). Verified merge_update covers every exposed key.

Audit corrections: the Voice tab already exposes language/hotkey/push-to-talk/
sensitivity (audit was wrong), and advanced.notesDebounceMs/outputBufferIntervalMs
are dead settings (unused anywhere) so deliberately not surfaced.

tsc · lint · settings tests green.
The workspace `config` JSON has two writers and they overwrote each other's
keys (last-write-wins on the whole blob — silent settings loss):
- The Workspace tab spreads the full current config (`{...config, ...patch}`),
  so it preserved everything.
- `useSettingsSync` serialized ONLY its nested `{agent,git,voice,model}` slices
  and wrote that as the entire config — wiping the flat keys the Workspace tab
  sets (defaultModel, maxConcurrentAgents, defaultBaseBranch, autoAdvance,
  persistentAgentLifecycle, autoArchive…).

Fix: `useSettingsSync` now re-reads the current config and MERGES its slices in
(symmetric with the Workspace tab) instead of replacing the blob. The backend
`effective_pipeline_settings` already reads both the flat and nested shapes, so
they coexist safely.

Also reconciles the branchPrefix split-brain: DEFAULT_SETTINGS.git.branchPrefix
was 'feat/' while the backend DEFAULT_BRANCH_PREFIX and workspaceDefaults both
use 'kaitencode/' — three defaults for one concept. Aligned to 'kaitencode/'.

tsc · lint · vitest (419) green.
@ANonABento ANonABento merged commit 19c8971 into main Jun 9, 2026
3 checks passed
@ANonABento ANonABento deleted the expose-settings-ui branch June 9, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant