memory + ticket #53 closed: /rzb admin routes done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cb55574 parent: a6959e4 added
.memory/handoffs/2026-11-26-v0-3-tui-admin-routes.md +18 -0 | new file mode 100644 | ||
| @@ -0,0 +1,18 @@ | ||
| 1 | +# Handoff — 2026-11-26 — v0.3 TUI: #53 admin routes done | |
| 2 | + | |
| 3 | +## State | |
| 4 | +- Branch `feature/v0.3-tui` (from main 7e968c5): #53 done and closed — `/rzb/status`, `/rzb/models/{id}/unload`, `/rzb/config/reload` + SIGHUP, loopback only. Tests Linux 217 / Mac 243, gate PASS (run #36), docs EN+FR, checked by hand on the Mac by the user. | |
| 5 | +- Commits 70660e3, ce6c870, 8eee7f3, cb5a310, a6959e4, plus the memory/ticket commit. Nothing pushed (user pushes from the Mac). | |
| 6 | + | |
| 7 | +## Next steps | |
| 8 | +1. #54 (TUI foundation): read the ticket and #51 (decisions), recover the v0.1 ANSI/termios TUI layer from tag `v0.1-agent` (`RazorbillTUI`), propose a methodical-dev plan, get approval. The TUI is a second `rzb` process: chat through `/v1`, dashboard by polling `/rzb/status`. | |
| 9 | +2. Later: #60 task 1 decisions (decision models) are still open. | |
| 10 | + | |
| 11 | +## Open questions | |
| 12 | +- 409 `model_busy` carries the running/waiting counts in its message only; the user has not said whether they want them as JSON fields. | |
| 13 | + | |
| 14 | +## Watch out for | |
| 15 | +- In tests, a request after a chat completion needs a new connection (`Connection: close`): use `freshRequest` / `fetchStatus` in `LocalRoutesTests.swift` (they connect to `localhost`, the host HummingbirdTesting binds). | |
| 16 | +- A real SIGHUP sent to the Linux test runner never reaches the trap: keep that test Darwin-only and test the reload logic with the injected signal stream. | |
| 17 | +- `pkill -f "rzb serve …"` from a shell whose own command line contains the pattern kills that shell: use the PID. | |
| 18 | +- `ModelManager.release` is now `async` (it may unload a slot a reload left without a declared id). | |
| new file mode 100644 | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | +# Handoff — 2026-11-26 — v0.3 TUI: #53 admin routes done | ||
| 2 | + | ||
| 3 | +## State | ||
| 4 | +- Branch `feature/v0.3-tui` (from main 7e968c5): #53 done and closed — `/rzb/status`, `/rzb/models/{id}/unload`, `/rzb/config/reload` + SIGHUP, loopback only. Tests Linux 217 / Mac 243, gate PASS (run #36), docs EN+FR, checked by hand on the Mac by the user. | ||
| 5 | +- Commits 70660e3, ce6c870, 8eee7f3, cb5a310, a6959e4, plus the memory/ticket commit. Nothing pushed (user pushes from the Mac). | ||
| 6 | + | ||
| 7 | +## Next steps | ||
| 8 | +1. #54 (TUI foundation): read the ticket and #51 (decisions), recover the v0.1 ANSI/termios TUI layer from tag `v0.1-agent` (`RazorbillTUI`), propose a methodical-dev plan, get approval. The TUI is a second `rzb` process: chat through `/v1`, dashboard by polling `/rzb/status`. | ||
| 9 | +2. Later: #60 task 1 decisions (decision models) are still open. | ||
| 10 | + | ||
| 11 | +## Open questions | ||
| 12 | +- 409 `model_busy` carries the running/waiting counts in its message only; the user has not said whether they want them as JSON fields. | ||
| 13 | + | ||
| 14 | +## Watch out for | ||
| 15 | +- In tests, a request after a chat completion needs a new connection (`Connection: close`): use `freshRequest` / `fetchStatus` in `LocalRoutesTests.swift` (they connect to `localhost`, the host HummingbirdTesting binds). | ||
| 16 | +- A real SIGHUP sent to the Linux test runner never reaches the trap: keep that test Darwin-only and test the reload logic with the injected signal stream. | ||
| 17 | +- `pkill -f "rzb serve …"` from a shell whose own command line contains the pattern kills that shell: use the PID. | ||
| 18 | +- `ModelManager.release` is now `async` (it may unload a slot a reload left without a declared id). | ||
modified
.memory/history.md +10 -0 | @@ -484,3 +484,13 @@ Then: user asked to commit and merge: nothing left uncommitted; main fast-forwar | ||
| 484 | 484 | Then (user): closed milestone v0.1. Its open tickets: #24 closed (Qwen3.5 reasoning verified by the |
| 485 | 485 | user through the server), #25 (thinking budget with Qwen3.5) taken out of the milestone and left |
| 486 | 486 | open, a comment on each. main fast-forwarded. |
| 487 | + | |
| 488 | +## 2026-11-26 — #53 local admin routes (/rzb) for the v0.3 TUI | |
| 489 | + | |
| 490 | +- **Goal**: user "attaque la v0.3" → #53 first (then #54), via methodical-dev on branch `feature/v0.3-tui`. User decisions: polling (`GET /rzb/status`, no SSE); unloading a busy model → 409 `model_busy`; reload applies everything except the network (host, port, api_key_env, cors_origin → `restart_required`), invalid config → 400 and old kept. 8-step plan approved ("go"), a checkpoint after each step. | |
| 491 | +- **Changes**: step 1 `LocalOnly.swift` + `ServerContext.remoteAddress` (swift-nio NIOCore as a direct dependency) — 70660e3; step 2 `GET /rzb/status` (`AdminRoutes.swift`, `RequestHistory.swift`, `ModelManager.status`, `ProcessMemory` + `EngineRegistry.memoryReporter`, MLX `Memory.*` in `MLXSupport`) — ce6c870; step 3 `POST /rzb/models/{id}/unload` (`ModelManager.unloadModel`) — 8eee7f3; step 4 `POST /rzb/config/reload` + SIGHUP (`ConfigReloader.swift`, `ModelManager.apply`, `ServerSettings.configFile/commandLine/restartRequired`, UnixSignals product, `ModelManagerTypes.swift` split for file_length) — cb5a310; docs + quality — a6959e4. | |
| 492 | +- **Decisions (mine, reported at checkpoints)**: `/rzb/` requests not kept in the history (polling would push real requests out); `keep_alive_left_seconds` null while a model is held or waited for; `port` is the configured one; uptime from router build; a repository id unloads chat and embedding loads, a declared id its own kind; the 409 keeps the plain OpenAI envelope (counts in the message only — user may want fields); explicit JSON nulls everywhere; reload compares network keys to the file the server started with; newly declared preload models load in the background. | |
| 493 | +- **Tests**: Linux 179 → 217, Mac 243 (host-runner, run from the sandbox). In the Linux test runner a real `kill(getpid(), SIGHUP)` never reached the trap, so the signal source is injectable (`eachSignalReloadsTheFile`) and the real-signal test is `#if canImport(Darwin)` — it passes on the Mac; a real `rzb serve` on Linux does reload on `kill -HUP` (checked by hand). Live tests that call after a chat need a new connection (chat answers `Connection: close`) on `localhost` (HummingbirdTesting binds localhost). User checked on the Mac by hand with Qwen3-0.6B-4bit: status (MLX memory, keep_alive countdown, request history), unload ×2, reload with restart_required ["port"], invalid file 400, SIGHUP — all as expected. | |
| 494 | +- **Quality**: gate PASS run #36 (0/0/0, complexity 548 → 588), no refactoring needed. | |
| 495 | +- **Docs**: EN+FR reference (http-api / api-http /rzb section, errors 403/409 + 4 codes, configuration "Reloading" / "Rechargement", SIGHUP under rzb serve), how-to `watch-and-steer-a-running-server.md` / `surveiller-et-piloter-le-serveur.md`, explanations (openai-compatibility: routes of our own under /rzb; model-lifecycle: unloading on demand and reloading), indexes, `packages.drawio` labels. `test_docs_curl.py` now runs `/health` and `/rzb` examples (22 pass on Linux). | |
| 496 | +- **Tickets**: #53 closed (tasks 1–4, comment 1). Mid-session the user asked for a structured-output ticket, then withdrew it ("au temps pour moi": #39 already covers it). No ticket created. | |
| @@ -484,3 +484,13 @@ Then: user asked to commit and merge: nothing left uncommitted; main fast-forwar | |||
| 484 | Then (user): closed milestone v0.1. Its open tickets: #24 closed (Qwen3.5 reasoning verified by the | 484 | Then (user): closed milestone v0.1. Its open tickets: #24 closed (Qwen3.5 reasoning verified by the |
| 485 | user through the server), #25 (thinking budget with Qwen3.5) taken out of the milestone and left | 485 | user through the server), #25 (thinking budget with Qwen3.5) taken out of the milestone and left |
| 486 | open, a comment on each. main fast-forwarded. | 486 | open, a comment on each. main fast-forwarded. |
| 487 | + | ||
| 488 | +## 2026-11-26 — #53 local admin routes (/rzb) for the v0.3 TUI | ||
| 489 | + | ||
| 490 | +- **Goal**: user "attaque la v0.3" → #53 first (then #54), via methodical-dev on branch `feature/v0.3-tui`. User decisions: polling (`GET /rzb/status`, no SSE); unloading a busy model → 409 `model_busy`; reload applies everything except the network (host, port, api_key_env, cors_origin → `restart_required`), invalid config → 400 and old kept. 8-step plan approved ("go"), a checkpoint after each step. | ||
| 491 | +- **Changes**: step 1 `LocalOnly.swift` + `ServerContext.remoteAddress` (swift-nio NIOCore as a direct dependency) — 70660e3; step 2 `GET /rzb/status` (`AdminRoutes.swift`, `RequestHistory.swift`, `ModelManager.status`, `ProcessMemory` + `EngineRegistry.memoryReporter`, MLX `Memory.*` in `MLXSupport`) — ce6c870; step 3 `POST /rzb/models/{id}/unload` (`ModelManager.unloadModel`) — 8eee7f3; step 4 `POST /rzb/config/reload` + SIGHUP (`ConfigReloader.swift`, `ModelManager.apply`, `ServerSettings.configFile/commandLine/restartRequired`, UnixSignals product, `ModelManagerTypes.swift` split for file_length) — cb5a310; docs + quality — a6959e4. | ||
| 492 | +- **Decisions (mine, reported at checkpoints)**: `/rzb/` requests not kept in the history (polling would push real requests out); `keep_alive_left_seconds` null while a model is held or waited for; `port` is the configured one; uptime from router build; a repository id unloads chat and embedding loads, a declared id its own kind; the 409 keeps the plain OpenAI envelope (counts in the message only — user may want fields); explicit JSON nulls everywhere; reload compares network keys to the file the server started with; newly declared preload models load in the background. | ||
| 493 | +- **Tests**: Linux 179 → 217, Mac 243 (host-runner, run from the sandbox). In the Linux test runner a real `kill(getpid(), SIGHUP)` never reached the trap, so the signal source is injectable (`eachSignalReloadsTheFile`) and the real-signal test is `#if canImport(Darwin)` — it passes on the Mac; a real `rzb serve` on Linux does reload on `kill -HUP` (checked by hand). Live tests that call after a chat need a new connection (chat answers `Connection: close`) on `localhost` (HummingbirdTesting binds localhost). User checked on the Mac by hand with Qwen3-0.6B-4bit: status (MLX memory, keep_alive countdown, request history), unload ×2, reload with restart_required ["port"], invalid file 400, SIGHUP — all as expected. | ||
| 494 | +- **Quality**: gate PASS run #36 (0/0/0, complexity 548 → 588), no refactoring needed. | ||
| 495 | +- **Docs**: EN+FR reference (http-api / api-http /rzb section, errors 403/409 + 4 codes, configuration "Reloading" / "Rechargement", SIGHUP under rzb serve), how-to `watch-and-steer-a-running-server.md` / `surveiller-et-piloter-le-serveur.md`, explanations (openai-compatibility: routes of our own under /rzb; model-lifecycle: unloading on demand and reloading), indexes, `packages.drawio` labels. `test_docs_curl.py` now runs `/health` and `/rzb` examples (22 pass on Linux). | ||
| 496 | +- **Tickets**: #53 closed (tasks 1–4, comment 1). Mid-session the user asked for a structured-output ticket, then withdrew it ("au temps pour moi": #39 already covers it). No ticket created. | ||
modified
.memory/summary.md +21 -2 | @@ -86,7 +86,7 @@ throws WrongModelKind); reuses `CompletionStream`, SSE and `CompletionEnvelope<C | ||
| 86 | 86 | chat chunks); suffix/logprobs/n/best_of/multi-prompt/token arrays → 400; max_tokens defaults to the |
| 87 | 87 | config (not OpenAI's 16). Shared field checks in `FieldChecking.swift`. Docs (#45): Diátaxis EN+FR rewritten around the |
| 88 | 88 | server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 explanation); the |
| 89 | -`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:7920/v1` are run by | |
| 89 | +`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:7920/` (`/v1`, `/health`, `/rzb`; since #53) are run by | |
| 90 | 90 | `Tests/Compatibility/test_docs_curl.py` (doc models `mlx-community/Qwen3-4B-4bit` / |
| 91 | 91 | `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and |
| 92 | 92 | only successful calls in ```bash blocks. v0.2 tickets #31–#45 closed; #47 (KV-cache spike) |
| @@ -118,6 +118,21 @@ layer: `ChatState`, `ScreenRenderer`, `PosixTerminal`, `TUIApp`), `RazorbillCLI` | ||
| 118 | 118 | parser commands, `CLIEnvironment` task-local for tests), executable `rzb`. Engines registered in |
| 119 | 119 | `Sources/rzb/main.swift`: `mlx` (Mac) then `fake`. |
| 120 | 120 | |
| 121 | +Local admin routes (#53, v0.3, branch `feature/v0.3-tui`): `AdminRoutes.swift` adds a `/rzb` group | |
| 122 | +behind `LocalOnlyMiddleware` (`LocalOnly.swift`: `ServerContext` is a `RemoteAddressRequestContext`; | |
| 123 | +loopback v4/v6/mapped and unix sockets pass, unknown address refused → 403 `local_only`; API key | |
| 124 | +still applies). `GET /rzb/status` (`ServerStatus`: models from `ModelManager.status(now:)`, last 50 | |
| 125 | +requests from `RequestHistory` fed by `RequestLogMiddleware` — `/rzb/` paths not recorded — and | |
| 126 | +`memory` from `EngineRegistry.memoryReporter`, set by `MLXSupport` from MLX `Memory.*`, null on | |
| 127 | +Linux). `POST /rzb/models/{id}/unload` → `ModelManager.unloadModel` (`UnloadOutcome`; busy → 409 | |
| 128 | +`model_busy`). `POST /rzb/config/reload` + SIGHUP → `ConfigReloader` (actor; `nil` without | |
| 129 | +`ServerSettings.configFile`) → `ModelManager.apply(_:)`: the catalog sits in a lock box | |
| 130 | +(`nonisolated var catalog`), `limits` is an actor var, slots no declared id points to are unloaded | |
| 131 | +now or in `release` once idle (`unloadWhenIdle`); `ServerSettings.restartRequired(by:)` compares the | |
| 132 | +started file's `server:` keys, ignoring those set on the command line (`ServerSettings.commandLine`). | |
| 133 | +`ConfigReloadSignalService` (UnixSignals, injectable stream) is added to the app's services by | |
| 134 | +`makeApplication(reloader:)`. Types around the manager moved to `ModelManagerTypes.swift`. | |
| 135 | + | |
| 121 | 136 | ## Decisions in force |
| 122 | 137 | |
| 123 | 138 | - #37 reasoning switches were chosen by Claude after the user's plain "go" (see the ticket's |
| @@ -132,6 +147,9 @@ parser commands, `CLIEnvironment` task-local for tests), executable `rzb`. Engin | ||
| 132 | 147 | file handled directly; local-only (loopback) `/rzb/*` routes for status, unload, config reload — |
| 133 | 148 | this amends the #31 "OpenAI-compatible API only" rule (still no Ollama `/api/*`). Unload in v0.3; |
| 134 | 149 | settings = TUI preferences + server config. Tickets #53–#59, #26/#28 moved to that milestone. |
| 150 | + #53 (user, 2026-11-26): the TUI polls `GET /rzb/status` (no SSE); unloading a model in use is | |
| 151 | + refused with 409 (no waiting, no cancelling); a reload applies everything but the network (host, | |
| 152 | + port, api_key_env, cors_origin → `restart_required`); invalid file → 400, old config kept. | |
| 135 | 153 | - Default port 7920 (user, 2026-11-26; was 8080, taken by llama-server / mlx_lm.server / Open WebUI). |
| 136 | 154 | `/`, `/v1`, `/v1/` answer the usual 404 `unknown_url` plus a hint that `/v1` is the base URL. |
| 137 | 155 | - Work stays local: no push to `origin` until the user says so. `origin` is `ssh://git@rickub.com/bots-garden/razorbill.git`: |
| @@ -233,7 +251,8 @@ Mac (MLX, Qwen3-4B + bge-small + Llama-3.2-3B): 45/46 before the #43 fixes; re-r | ||
| 233 | 251 | Tests 2026-11-25 after #43 fixes: Linux 155, Mac 178. After #44: Linux 161, Mac 185, compat on |
| 234 | 252 | Linux 34 pass / 21 skip (Mac compat not re-run after #44). After #48 (prompt cache): Linux 168, Mac 193, |
| 235 | 253 | compat on Linux 48 pass / 20 skip. After #49: Linux 172, Mac 198, compat Linux 51 / 20 (Mac compat |
| 236 | -not re-run since #44). | |
| 254 | +not re-run since #44). After #53: Linux 217, Mac 243 (host-runner; `sighupReloadsTheFile` runs on | |
| 255 | +macOS only), compat on Linux `-k docs_curl` 22 pass (whole compat suite not re-run). | |
| 237 | 256 | |
| 238 | 257 | Sampling (#49, user's rule: only what mlx-swift-lm implements): temperature, top_p, max_tokens, |
| 239 | 258 | stop, seed, presence/frequency_penalty (mlx window: last 20 tokens incl. prompt), plus extensions |
| @@ -86,7 +86,7 @@ throws WrongModelKind); reuses `CompletionStream`, SSE and `CompletionEnvelope<C | |||
| 86 | chat chunks); suffix/logprobs/n/best_of/multi-prompt/token arrays → 400; max_tokens defaults to the | 86 | chat chunks); suffix/logprobs/n/best_of/multi-prompt/token arrays → 400; max_tokens defaults to the |
| 87 | config (not OpenAI's 16). Shared field checks in `FieldChecking.swift`. Docs (#45): Diátaxis EN+FR rewritten around the | 87 | config (not OpenAI's 16). Shared field checks in `FieldChecking.swift`. Docs (#45): Diátaxis EN+FR rewritten around the |
| 88 | server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 explanation); the | 88 | server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 explanation); the |
| 89 | -`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:7920/v1` are run by | 89 | +`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:7920/` (`/v1`, `/health`, `/rzb`; since #53) are run by |
| 90 | `Tests/Compatibility/test_docs_curl.py` (doc models `mlx-community/Qwen3-4B-4bit` / | 90 | `Tests/Compatibility/test_docs_curl.py` (doc models `mlx-community/Qwen3-4B-4bit` / |
| 91 | `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and | 91 | `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and |
| 92 | only successful calls in ```bash blocks. v0.2 tickets #31–#45 closed; #47 (KV-cache spike) | 92 | only successful calls in ```bash blocks. v0.2 tickets #31–#45 closed; #47 (KV-cache spike) |
| @@ -118,6 +118,21 @@ layer: `ChatState`, `ScreenRenderer`, `PosixTerminal`, `TUIApp`), `RazorbillCLI` | |||
| 118 | parser commands, `CLIEnvironment` task-local for tests), executable `rzb`. Engines registered in | 118 | parser commands, `CLIEnvironment` task-local for tests), executable `rzb`. Engines registered in |
| 119 | `Sources/rzb/main.swift`: `mlx` (Mac) then `fake`. | 119 | `Sources/rzb/main.swift`: `mlx` (Mac) then `fake`. |
| 120 | 120 | ||
| 121 | +Local admin routes (#53, v0.3, branch `feature/v0.3-tui`): `AdminRoutes.swift` adds a `/rzb` group | ||
| 122 | +behind `LocalOnlyMiddleware` (`LocalOnly.swift`: `ServerContext` is a `RemoteAddressRequestContext`; | ||
| 123 | +loopback v4/v6/mapped and unix sockets pass, unknown address refused → 403 `local_only`; API key | ||
| 124 | +still applies). `GET /rzb/status` (`ServerStatus`: models from `ModelManager.status(now:)`, last 50 | ||
| 125 | +requests from `RequestHistory` fed by `RequestLogMiddleware` — `/rzb/` paths not recorded — and | ||
| 126 | +`memory` from `EngineRegistry.memoryReporter`, set by `MLXSupport` from MLX `Memory.*`, null on | ||
| 127 | +Linux). `POST /rzb/models/{id}/unload` → `ModelManager.unloadModel` (`UnloadOutcome`; busy → 409 | ||
| 128 | +`model_busy`). `POST /rzb/config/reload` + SIGHUP → `ConfigReloader` (actor; `nil` without | ||
| 129 | +`ServerSettings.configFile`) → `ModelManager.apply(_:)`: the catalog sits in a lock box | ||
| 130 | +(`nonisolated var catalog`), `limits` is an actor var, slots no declared id points to are unloaded | ||
| 131 | +now or in `release` once idle (`unloadWhenIdle`); `ServerSettings.restartRequired(by:)` compares the | ||
| 132 | +started file's `server:` keys, ignoring those set on the command line (`ServerSettings.commandLine`). | ||
| 133 | +`ConfigReloadSignalService` (UnixSignals, injectable stream) is added to the app's services by | ||
| 134 | +`makeApplication(reloader:)`. Types around the manager moved to `ModelManagerTypes.swift`. | ||
| 135 | + | ||
| 121 | ## Decisions in force | 136 | ## Decisions in force |
| 122 | 137 | ||
| 123 | - #37 reasoning switches were chosen by Claude after the user's plain "go" (see the ticket's | 138 | - #37 reasoning switches were chosen by Claude after the user's plain "go" (see the ticket's |
| @@ -132,6 +147,9 @@ parser commands, `CLIEnvironment` task-local for tests), executable `rzb`. Engin | |||
| 132 | file handled directly; local-only (loopback) `/rzb/*` routes for status, unload, config reload — | 147 | file handled directly; local-only (loopback) `/rzb/*` routes for status, unload, config reload — |
| 133 | this amends the #31 "OpenAI-compatible API only" rule (still no Ollama `/api/*`). Unload in v0.3; | 148 | this amends the #31 "OpenAI-compatible API only" rule (still no Ollama `/api/*`). Unload in v0.3; |
| 134 | settings = TUI preferences + server config. Tickets #53–#59, #26/#28 moved to that milestone. | 149 | settings = TUI preferences + server config. Tickets #53–#59, #26/#28 moved to that milestone. |
| 150 | + #53 (user, 2026-11-26): the TUI polls `GET /rzb/status` (no SSE); unloading a model in use is | ||
| 151 | + refused with 409 (no waiting, no cancelling); a reload applies everything but the network (host, | ||
| 152 | + port, api_key_env, cors_origin → `restart_required`); invalid file → 400, old config kept. | ||
| 135 | - Default port 7920 (user, 2026-11-26; was 8080, taken by llama-server / mlx_lm.server / Open WebUI). | 153 | - Default port 7920 (user, 2026-11-26; was 8080, taken by llama-server / mlx_lm.server / Open WebUI). |
| 136 | `/`, `/v1`, `/v1/` answer the usual 404 `unknown_url` plus a hint that `/v1` is the base URL. | 154 | `/`, `/v1`, `/v1/` answer the usual 404 `unknown_url` plus a hint that `/v1` is the base URL. |
| 137 | - Work stays local: no push to `origin` until the user says so. `origin` is `ssh://git@rickub.com/bots-garden/razorbill.git`: | 155 | - Work stays local: no push to `origin` until the user says so. `origin` is `ssh://git@rickub.com/bots-garden/razorbill.git`: |
| @@ -233,7 +251,8 @@ Mac (MLX, Qwen3-4B + bge-small + Llama-3.2-3B): 45/46 before the #43 fixes; re-r | |||
| 233 | Tests 2026-11-25 after #43 fixes: Linux 155, Mac 178. After #44: Linux 161, Mac 185, compat on | 251 | Tests 2026-11-25 after #43 fixes: Linux 155, Mac 178. After #44: Linux 161, Mac 185, compat on |
| 234 | Linux 34 pass / 21 skip (Mac compat not re-run after #44). After #48 (prompt cache): Linux 168, Mac 193, | 252 | Linux 34 pass / 21 skip (Mac compat not re-run after #44). After #48 (prompt cache): Linux 168, Mac 193, |
| 235 | compat on Linux 48 pass / 20 skip. After #49: Linux 172, Mac 198, compat Linux 51 / 20 (Mac compat | 253 | compat on Linux 48 pass / 20 skip. After #49: Linux 172, Mac 198, compat Linux 51 / 20 (Mac compat |
| 236 | -not re-run since #44). | 254 | +not re-run since #44). After #53: Linux 217, Mac 243 (host-runner; `sighupReloadsTheFile` runs on |
| 255 | +macOS only), compat on Linux `-k docs_curl` 22 pass (whole compat suite not re-run). | ||
| 237 | 256 | ||
| 238 | Sampling (#49, user's rule: only what mlx-swift-lm implements): temperature, top_p, max_tokens, | 257 | Sampling (#49, user's rule: only what mlx-swift-lm implements): temperature, top_p, max_tokens, |
| 239 | stop, seed, presence/frequency_penalty (mlx window: last 20 tokens incl. prompt), plus extensions | 258 | stop, seed, presence/frequency_penalty (mlx window: last 20 tokens incl. prompt), plus extensions |
modified
.tickets/issues/0053-local-admin-routes-status-unload-config-reload.yaml +40 -7 | @@ -1,12 +1,13 @@ | ||
| 1 | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | 2 | id: 53 |
| 3 | 3 | title: "Local admin routes on rzb serve: status, unload, config reload" |
| 4 | -state: open | |
| 4 | +state: closed | |
| 5 | 5 | author: |
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-11-26T08:00:00.000Z |
| 9 | -updatedAt: 2026-11-26T08:00:00.000Z | |
| 9 | +updatedAt: 2026-11-26T22:30:00.000Z | |
| 10 | +closedAt: 2026-11-26T22:30:00.000Z | |
| 10 | 11 | labels: |
| 11 | 12 | - "kind::feature" |
| 12 | 13 | - "area::server" |
| @@ -32,34 +33,66 @@ body: | | ||
| 32 | 33 | tasks: |
| 33 | 34 | - id: 1 |
| 34 | 35 | title: "Status route (and decide polling or SSE)" |
| 35 | - state: open | |
| 36 | + state: closed | |
| 36 | 37 | priority: high |
| 37 | 38 | author: |
| 38 | 39 | name: k33g |
| 39 | 40 | email: ph.charriere@gmail.com |
| 40 | 41 | createdAt: 2026-11-26T08:00:00.000Z |
| 42 | + updatedAt: 2026-11-26T22:30:00.000Z | |
| 43 | + closedAt: 2026-11-26T22:30:00.000Z | |
| 41 | 44 | - id: 2 |
| 42 | 45 | title: "Unload route" |
| 43 | - state: open | |
| 46 | + state: closed | |
| 44 | 47 | priority: medium |
| 45 | 48 | author: |
| 46 | 49 | name: k33g |
| 47 | 50 | email: ph.charriere@gmail.com |
| 48 | 51 | createdAt: 2026-11-26T08:00:00.000Z |
| 52 | + updatedAt: 2026-11-26T22:30:00.000Z | |
| 53 | + closedAt: 2026-11-26T22:30:00.000Z | |
| 49 | 54 | - id: 3 |
| 50 | 55 | title: "Configuration reload (route and SIGHUP), live vs restart keys" |
| 51 | - state: open | |
| 56 | + state: closed | |
| 52 | 57 | priority: high |
| 53 | 58 | author: |
| 54 | 59 | name: k33g |
| 55 | 60 | email: ph.charriere@gmail.com |
| 56 | 61 | createdAt: 2026-11-26T08:00:00.000Z |
| 62 | + updatedAt: 2026-11-26T22:30:00.000Z | |
| 63 | + closedAt: 2026-11-26T22:30:00.000Z | |
| 57 | 64 | - id: 4 |
| 58 | 65 | title: "Loopback-only access, tests, HTTP API reference EN + FR" |
| 59 | - state: open | |
| 66 | + state: closed | |
| 60 | 67 | priority: high |
| 61 | 68 | author: |
| 62 | 69 | name: k33g |
| 63 | 70 | email: ph.charriere@gmail.com |
| 64 | 71 | createdAt: 2026-11-26T08:00:00.000Z |
| 65 | -comments: [] | |
| 72 | + updatedAt: 2026-11-26T22:30:00.000Z | |
| 73 | + closedAt: 2026-11-26T22:30:00.000Z | |
| 74 | +comments: | |
| 75 | + - id: 1 | |
| 76 | + author: | |
| 77 | + name: k33g | |
| 78 | + email: ph.charriere@gmail.com | |
| 79 | + createdAt: 2026-11-26T22:30:00.000Z | |
| 80 | + body: | | |
| 81 | + Done on branch feature/v0.3-tui (commits 70660e3..a6959e4). Decisions (user, 2026-11-26): polling, | |
| 82 | + no SSE; unloading a busy model is refused (409); a reload applies everything but the network. | |
| 83 | + | |
| 84 | + - Access: LocalOnlyMiddleware on the /rzb group: loopback peers only (127.0.0.0/8, ::1, | |
| 85 | + ::ffff:127.x, unix socket; unknown address refused) -> 403 local_only, API key still required. | |
| 86 | + - GET /rzb/status: version, uptime, host/port, models loaded or loading (key, name, kind, state, | |
| 87 | + size, busy, queued, idle, keep_alive left or null while held), last 50 requests (the /rzb routes | |
| 88 | + are not recorded), MLX memory (active/cache/peak/limit; null on Linux). | |
| 89 | + - POST /rzb/models/{id}/unload: unloaded / not_loaded (200), model_busy (409), model_not_found | |
| 90 | + (404). A repository id frees its chat and embedding loads, a declared id its own kind. | |
| 91 | + - POST /rzb/config/reload and SIGHUP: models, defaults, locked, limits live; a loaded model no | |
| 92 | + declared id points to anymore is unloaded now or when idle; host, port, api_key_env and | |
| 93 | + cors_origin are reported in restart_required (command-line options never count); invalid file | |
| 94 | + -> 400 invalid_config (old one kept), no --config -> 409 no_config_file. | |
| 95 | + - Tests: Linux 217, Mac 243 (incl. a real SIGHUP test, macOS only); checked by hand on the Mac | |
| 96 | + with Qwen3-0.6B-4bit (status, unload, reload, invalid file, kill -HUP). Gate PASS (run #36). | |
| 97 | + - Docs EN+FR: HTTP API reference /rzb section, error codes, configuration "Reloading", how-to | |
| 98 | + "watch and steer a running server", explanations (routes of our own; unloading and reloading). | |
| @@ -1,12 +1,13 @@ | |||
| 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | id: 53 | 2 | id: 53 |
| 3 | title: "Local admin routes on rzb serve: status, unload, config reload" | 3 | title: "Local admin routes on rzb serve: status, unload, config reload" |
| 4 | -state: open | 4 | +state: closed |
| 5 | author: | 5 | author: |
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-11-26T08:00:00.000Z | 8 | createdAt: 2026-11-26T08:00:00.000Z |
| 9 | -updatedAt: 2026-11-26T08:00:00.000Z | 9 | +updatedAt: 2026-11-26T22:30:00.000Z |
| 10 | +closedAt: 2026-11-26T22:30:00.000Z | ||
| 10 | labels: | 11 | labels: |
| 11 | - "kind::feature" | 12 | - "kind::feature" |
| 12 | - "area::server" | 13 | - "area::server" |
| @@ -32,34 +33,66 @@ body: | | |||
| 32 | tasks: | 33 | tasks: |
| 33 | - id: 1 | 34 | - id: 1 |
| 34 | title: "Status route (and decide polling or SSE)" | 35 | title: "Status route (and decide polling or SSE)" |
| 35 | - state: open | 36 | + state: closed |
| 36 | priority: high | 37 | priority: high |
| 37 | author: | 38 | author: |
| 38 | name: k33g | 39 | name: k33g |
| 39 | email: ph.charriere@gmail.com | 40 | email: ph.charriere@gmail.com |
| 40 | createdAt: 2026-11-26T08:00:00.000Z | 41 | createdAt: 2026-11-26T08:00:00.000Z |
| 42 | + updatedAt: 2026-11-26T22:30:00.000Z | ||
| 43 | + closedAt: 2026-11-26T22:30:00.000Z | ||
| 41 | - id: 2 | 44 | - id: 2 |
| 42 | title: "Unload route" | 45 | title: "Unload route" |
| 43 | - state: open | 46 | + state: closed |
| 44 | priority: medium | 47 | priority: medium |
| 45 | author: | 48 | author: |
| 46 | name: k33g | 49 | name: k33g |
| 47 | email: ph.charriere@gmail.com | 50 | email: ph.charriere@gmail.com |
| 48 | createdAt: 2026-11-26T08:00:00.000Z | 51 | createdAt: 2026-11-26T08:00:00.000Z |
| 52 | + updatedAt: 2026-11-26T22:30:00.000Z | ||
| 53 | + closedAt: 2026-11-26T22:30:00.000Z | ||
| 49 | - id: 3 | 54 | - id: 3 |
| 50 | title: "Configuration reload (route and SIGHUP), live vs restart keys" | 55 | title: "Configuration reload (route and SIGHUP), live vs restart keys" |
| 51 | - state: open | 56 | + state: closed |
| 52 | priority: high | 57 | priority: high |
| 53 | author: | 58 | author: |
| 54 | name: k33g | 59 | name: k33g |
| 55 | email: ph.charriere@gmail.com | 60 | email: ph.charriere@gmail.com |
| 56 | createdAt: 2026-11-26T08:00:00.000Z | 61 | createdAt: 2026-11-26T08:00:00.000Z |
| 62 | + updatedAt: 2026-11-26T22:30:00.000Z | ||
| 63 | + closedAt: 2026-11-26T22:30:00.000Z | ||
| 57 | - id: 4 | 64 | - id: 4 |
| 58 | title: "Loopback-only access, tests, HTTP API reference EN + FR" | 65 | title: "Loopback-only access, tests, HTTP API reference EN + FR" |
| 59 | - state: open | 66 | + state: closed |
| 60 | priority: high | 67 | priority: high |
| 61 | author: | 68 | author: |
| 62 | name: k33g | 69 | name: k33g |
| 63 | email: ph.charriere@gmail.com | 70 | email: ph.charriere@gmail.com |
| 64 | createdAt: 2026-11-26T08:00:00.000Z | 71 | createdAt: 2026-11-26T08:00:00.000Z |
| 65 | -comments: [] | 72 | + updatedAt: 2026-11-26T22:30:00.000Z |
| 73 | + closedAt: 2026-11-26T22:30:00.000Z | ||
| 74 | +comments: | ||
| 75 | + - id: 1 | ||
| 76 | + author: | ||
| 77 | + name: k33g | ||
| 78 | + email: ph.charriere@gmail.com | ||
| 79 | + createdAt: 2026-11-26T22:30:00.000Z | ||
| 80 | + body: | | ||
| 81 | + Done on branch feature/v0.3-tui (commits 70660e3..a6959e4). Decisions (user, 2026-11-26): polling, | ||
| 82 | + no SSE; unloading a busy model is refused (409); a reload applies everything but the network. | ||
| 83 | + | ||
| 84 | + - Access: LocalOnlyMiddleware on the /rzb group: loopback peers only (127.0.0.0/8, ::1, | ||
| 85 | + ::ffff:127.x, unix socket; unknown address refused) -> 403 local_only, API key still required. | ||
| 86 | + - GET /rzb/status: version, uptime, host/port, models loaded or loading (key, name, kind, state, | ||
| 87 | + size, busy, queued, idle, keep_alive left or null while held), last 50 requests (the /rzb routes | ||
| 88 | + are not recorded), MLX memory (active/cache/peak/limit; null on Linux). | ||
| 89 | + - POST /rzb/models/{id}/unload: unloaded / not_loaded (200), model_busy (409), model_not_found | ||
| 90 | + (404). A repository id frees its chat and embedding loads, a declared id its own kind. | ||
| 91 | + - POST /rzb/config/reload and SIGHUP: models, defaults, locked, limits live; a loaded model no | ||
| 92 | + declared id points to anymore is unloaded now or when idle; host, port, api_key_env and | ||
| 93 | + cors_origin are reported in restart_required (command-line options never count); invalid file | ||
| 94 | + -> 400 invalid_config (old one kept), no --config -> 409 no_config_file. | ||
| 95 | + - Tests: Linux 217, Mac 243 (incl. a real SIGHUP test, macOS only); checked by hand on the Mac | ||
| 96 | + with Qwen3-0.6B-4bit (status, unload, reload, invalid file, kill -HUP). Gate PASS (run #36). | ||
| 97 | + - Docs EN+FR: HTTP API reference /rzb section, error codes, configuration "Reloading", how-to | ||
| 98 | + "watch and steer a running server", explanations (routes of our own; unloading and reloading). | ||