feat: edit existing model entries in the Model Registry

- Inline edit form per model row (label, model name/ID, host/account, context, tags)
- Fetch models button in edit form for local models — same live-picker UX as Add Model
- POST /settings/local/models/{id}/edit route in local_llm.py
- Admin role badge (ADMIN/USER pill) in Account Settings page
- HELP.md updated: new tools table with admin/confirm markers, PWA install section
- TODO updated: tool expansions marked done, distill review and Unsloth resolved,
  role-based access and admin badge added to completed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-29 21:08:09 -04:00
parent 334e7f0dea
commit a5658eb3c4
6 changed files with 289 additions and 41 deletions

View File

@@ -32,15 +32,12 @@ automatically. Remaining work is quality/reliability parity, not ground-up desig
### [Tools] Orchestrator tool expansions
New tools for `cortex/tools/` — higher-value additions that fill obvious gaps.
- [ ] **`cortex_restart`** — `systemctl --user restart cortex`; lets Inara apply her own
config changes without human intervention. Return last 10 log lines after restart.
- [ ] **`cortex_logs`** — `journalctl --user -u cortex -n N` — tail service logs for debugging
- [ ] **`http_fetch`** — fetch a URL and return content; for health checks, API probing,
webhook testing. Different from `web_search` — direct URL, returns raw response.
- [ ] **`file_list`** — list files and directories at a path; currently only `file_read` exists
- [ ] **`file_write`** — write content to a file (with path allow-list for safety)
- [ ] **`nc_talk_send`** — proactively send a message to the user via Nextcloud Talk
(outbound; complements the proactive notifications channel work)
- [x] **`cortex_restart`** — detached subprocess, 5s delay, admin-only, confirm-required — 2026-04-29
- [x] **`cortex_logs`** — `journalctl --user -u cortex -n N`, admin-only — 2026-04-29
- [x] **`http_fetch`** — direct URL fetch via httpx, 8192 char cap — 2026-04-29
- [x] **`file_list`** — directory listing with size, dirs first, 200 entry cap, admin-only — 2026-04-29
- [x] **`file_write`** — overwrite/append to home_root paths, admin-only, confirm-required — 2026-04-29
- [x] **`nc_talk_send`** — outbound NC Talk message via notification.py, admin-only — 2026-04-29
- [ ] **`email_send`** — send email via existing `email_utils.py` SMTP helper
- [ ] **`web_push`** — send a browser push notification (requires push subscription stored
per-user; pairs well with the PWA service worker already in place)
@@ -109,17 +106,6 @@ See `ARCH__Intelligence_Layer.md` for full design.
- Manually review `inara/MEMORY_LONG.md` — confirm quality before fully trusting
- Adjust distill prompts in `cortex/memory_distiller.py` if needed
### [Distill] Distill quality review
- Short/mid/long distill prompts live in `cortex/memory_distiller.py`
- After first few automatic runs, review quality and tune
### [Local] Unsloth Gemma 4 variants
- Unsloth Dynamic 2.0 Q4_K_M GGUFs fail with `500: unable to load model` on Ollama v0.20.0
- Root cause: Ollama's bundled llama.cpp doesn't recognize Gemma 4 GGUF architecture metadata from raw files
- Waiting on Ollama point release (v0.20.1+) — then switch Open WebUI to Unsloth variants
- Expected speedup: ~1020% smaller context footprint vs baseline, same quality
- `agent-support-gemma-small` → Unsloth E4B Q4_K_M; `agent-support-gemma-medium` → Unsloth 26B A4B Q4_K_M
---
## 🟢 Lower Priority / Future
@@ -216,6 +202,28 @@ other based on resources and specialisation. No central coordinator required.
## ✅ Completed
### [Tools] Role-based access control + confirmation gate — 2026-04-29
- `TOOL_ROLES` dict maps tool names to minimum required role (`admin`/`user`)
- `CONFIRM_REQUIRED` set blocks destructive tools; orchestrator injects confirmation prompt instead
- `get_tools_for_role(role)` filters both Gemini declarations and callables
- `get_user_role(username)` added to `auth_utils.py`; passed through both orchestrators
- `manage_passwords.py role <username> admin|user` — shell-only admin promotion
- Admin-only tools: `shell_exec`, `claude_allow_dir`, `cortex_restart`, `cortex_logs`,
`file_read`, `file_list`, `file_write`, `ae_task_list`, `nc_talk_send`
- Confirm-required tools: `cortex_restart`, `file_write`, `shell_exec`, `cron_remove`, `reminders_clear`
### [UI] Admin role badge in Account settings — 2026-04-29
- `GET /settings` now injects `user_role` from `auth.json` into settings page
- Role shown as a styled pill badge (purple ADMIN, muted USER) below username field
### [Local] Unsloth Gemma 4 variants — resolved 2026-04-29
- Ollama update resolved the `500: unable to load model` issue
- Unsloth Dynamic 2.0 Q4_K_M GGUFs loading correctly
### [Distill] Distill quality review — resolved 2026-04-29
- Short/mid/long output reviewed and quality confirmed acceptable
- No prompt tuning needed at this time
### [UI] Progressive Web App (PWA) — 2026-04-29
- `manifest.json`, `sw.js`, PNG icons (192/512) generated via rsvg-convert
- `/manifest.json` and `/sw.js` served at root via ui.py; exempted in auth_middleware