feat(settings): instance settings + preferences pane #18

Manually merged
lz merged 26 commits from feat/settings-pane into main 2026-05-23 22:28:02 +02:00
Owner

Summary

  • Adds a Settings tab to the header with two sub-tabs: Preferences (git identity, agent teams default) and Instance (worker image, session TTL, secure cookie flag)
  • Backed by two new Kysely migrations: preferences(user_id, key, value, updated_at) and instance_settings(key, value, updated_at)
  • Static SETTINGS registry is the single source of truth; instance settings follow env > db > default precedence with a "set by env" badge in the UI when an env var wins
  • Passphrase rotation endpoint (POST /api/auth/rotate-passphrase) re-encrypts all connection tokens atomically in a single transaction, destroys all existing sessions, and issues a fresh cookie
  • SessionStore TTL is now read lazily — changing session_ttl_hours in the UI takes effect on next login without a restart
  • Worker spawn reads GIT_USER_NAME/GIT_USER_EMAIL from preferences and worker_image from instance settings instead of hardcoded config
  • New session "agent teams" toggle is seeded from default_agent_teams_enabled preference on mount
  • Bool settings render as toggle switches; env-locked fields show an env-var chip instead of a Save button

Test plan

  • pnpm test in nexus/ — 246 passing, 65 skipped (SQLite skipped on Windows, run on Linux/CI)
  • pnpm typecheck — 0 errors
  • Docker Compose build succeeds: docker compose up -d --build
  • Navigate to /settings → Preferences tab: change git name → save → toast appears, value persists on refresh
  • Preferences → "Enable agent teams" toggle: flip it → auto-saves, new sessions default to new value
  • Preferences → "Change passphrase…" → rotate → redirected to unlock page
  • Instance tab: Session TTL field — change value → save → lock → unlock → cookie max-age reflects new TTL
  • Instance tab: set WORKER_IMAGE env var in compose → restart → field shows "set by env" chip, input is replaced by chip
  • Instance tab: Diagnostics section shows current env values (PORT, HOST, etc.)
## Summary - Adds a **Settings** tab to the header with two sub-tabs: **Preferences** (git identity, agent teams default) and **Instance** (worker image, session TTL, secure cookie flag) - Backed by two new Kysely migrations: `preferences(user_id, key, value, updated_at)` and `instance_settings(key, value, updated_at)` - Static `SETTINGS` registry is the single source of truth; instance settings follow **env > db > default** precedence with a "set by env" badge in the UI when an env var wins - **Passphrase rotation** endpoint (`POST /api/auth/rotate-passphrase`) re-encrypts all connection tokens atomically in a single transaction, destroys all existing sessions, and issues a fresh cookie - `SessionStore` TTL is now read lazily — changing `session_ttl_hours` in the UI takes effect on next login without a restart - Worker spawn reads `GIT_USER_NAME`/`GIT_USER_EMAIL` from preferences and `worker_image` from instance settings instead of hardcoded config - New session "agent teams" toggle is seeded from `default_agent_teams_enabled` preference on mount - Bool settings render as toggle switches; env-locked fields show an env-var chip instead of a Save button ## Test plan - [ ] `pnpm test` in `nexus/` — 246 passing, 65 skipped (SQLite skipped on Windows, run on Linux/CI) - [ ] `pnpm typecheck` — 0 errors - [ ] Docker Compose build succeeds: `docker compose up -d --build` - [ ] Navigate to `/settings` → Preferences tab: change git name → save → toast appears, value persists on refresh - [ ] Preferences → "Enable agent teams" toggle: flip it → auto-saves, new sessions default to new value - [ ] Preferences → "Change passphrase…" → rotate → redirected to unlock page - [ ] Instance tab: Session TTL field — change value → save → lock → unlock → cookie max-age reflects new TTL - [ ] Instance tab: set `WORKER_IMAGE` env var in compose → restart → field shows "set by env" chip, input is replaced by chip - [ ] Instance tab: Diagnostics section shows current env values (PORT, HOST, etc.)
lz force-pushed feat/settings-pane from f5026396a9
Some checks failed
ci / nexus (pull_request) Failing after 1m16s
ci / images (./nexus, agent-nexus) (pull_request) Has been skipped
ci / images (./worker, nexus-worker) (pull_request) Has been skipped
to f2dc07f6c2
Some checks failed
ci / nexus (pull_request) Failing after 1m18s
ci / images (./nexus, agent-nexus) (pull_request) Has been skipped
ci / images (./worker, nexus-worker) (pull_request) Has been skipped
2026-05-23 22:01:41 +02:00
Compare
lz force-pushed feat/settings-pane from f2dc07f6c2
Some checks failed
ci / nexus (pull_request) Failing after 1m18s
ci / images (./nexus, agent-nexus) (pull_request) Has been skipped
ci / images (./worker, nexus-worker) (pull_request) Has been skipped
to e904410f72
Some checks failed
ci / nexus (pull_request) Failing after 1m44s
ci / images (./nexus, agent-nexus) (pull_request) Has been skipped
ci / images (./worker, nexus-worker) (pull_request) Has been skipped
2026-05-23 22:06:44 +02:00
Compare
lz force-pushed feat/settings-pane from e904410f72
Some checks failed
ci / nexus (pull_request) Failing after 1m44s
ci / images (./nexus, agent-nexus) (pull_request) Has been skipped
ci / images (./worker, nexus-worker) (pull_request) Has been skipped
to 8142e46fef
All checks were successful
ci / nexus (pull_request) Successful in 2m23s
ci / images (./nexus, agent-nexus) (pull_request) Successful in 3m25s
ci / images (./worker, nexus-worker) (pull_request) Successful in 1m51s
2026-05-23 22:09:37 +02:00
Compare
lz manually merged commit 74847572a8 into main 2026-05-23 22:28:02 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lz/agent-nexus!18
No description provided.