bots-garden/razorbillpublic Fork
⑂ 783675c
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

TUI: Machine on two lines, status bar with the address last (#28 closed)

The GPU load shows on the user's Mac (#28 task 1), but the Machine line and
the status bar were too full and got cut. The Dashboard's Machine line is
now two lines (gpu, pressure, rzb footprint; then memory), and the status
bar puts version, gpu, pressure, memory and model first, the address last
(cut first on a narrow terminal). Docs EN+FR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
k33g committed 2026-11-27T08:00:26+01:00 Browse files
783675c parent: 5c534c9
modified .memory/handoffs/2026-11-27-v0-3-tui-foundation.md +1 -0
@@ -39,3 +39,4 @@
3939 - Open: the TUI download failure the user saw (message not known yet); #63 (reasoning colour, v0.3); #28 task 1 (GPU key); #62 (HF token spike, no milestone); user to run `scripts/compat.sh` on the Mac after the bump and to try Mellum.
4040 - User confirmed after the bump: "ok all good", `scripts/compat.sh` on the Mac 79 passed (93.6 s).
4141 - The Models screen download works (user, 2026-11-27): not a bug.
42+- #28 closed (GPU shows on the Mac). Machine line now two lines; status bar address last. v0.3 left: #63 (reasoning colour), then the 0.3.0 release.
@@ -39,3 +39,4 @@
39 - Open: the TUI download failure the user saw (message not known yet); #63 (reasoning colour, v0.3); #28 task 1 (GPU key); #62 (HF token spike, no milestone); user to run `scripts/compat.sh` on the Mac after the bump and to try Mellum.39 - Open: the TUI download failure the user saw (message not known yet); #63 (reasoning colour, v0.3); #28 task 1 (GPU key); #62 (HF token spike, no milestone); user to run `scripts/compat.sh` on the Mac after the bump and to try Mellum.
40 - User confirmed after the bump: "ok all good", `scripts/compat.sh` on the Mac 79 passed (93.6 s).40 - User confirmed after the bump: "ok all good", `scripts/compat.sh` on the Mac 79 passed (93.6 s).
41 - The Models screen download works (user, 2026-11-27): not a bug.41 - The Models screen download works (user, 2026-11-27): not a bug.
42+- #28 closed (GPU shows on the Mac). Machine line now two lines; status bar address last. v0.3 left: #63 (reasoning colour), then the 0.3.0 release.
modified .memory/history.md +1 -0
@@ -547,3 +547,4 @@ open, a comment on each. main fast-forwarded.
547547 - **Still to check by the user**: Mellum itself loads and answers; `scripts/compat.sh` on the Mac; the TUI download error message.
548548 - 2026-11-27, later: the user confirmed the 3.33.0 bump on the Mac ("ok all good"); `scripts/compat.sh` with real models: 79 passed in 93.6 s.
549549 - 2026-11-27, later: the TUI Models screen download works (user: "je me suis trompé"); nothing to fix there.
550+- 2026-11-27, later: GPU load confirmed shown on the Mac (#28 closed); the Machine line was too full → split in two, status bar reordered (version, gpu, pressure, memory, model, address last). Linux 336, Mac green.
@@ -547,3 +547,4 @@ open, a comment on each. main fast-forwarded.
547 - **Still to check by the user**: Mellum itself loads and answers; `scripts/compat.sh` on the Mac; the TUI download error message.547 - **Still to check by the user**: Mellum itself loads and answers; `scripts/compat.sh` on the Mac; the TUI download error message.
548 - 2026-11-27, later: the user confirmed the 3.33.0 bump on the Mac ("ok all good"); `scripts/compat.sh` with real models: 79 passed in 93.6 s.548 - 2026-11-27, later: the user confirmed the 3.33.0 bump on the Mac ("ok all good"); `scripts/compat.sh` with real models: 79 passed in 93.6 s.
549 - 2026-11-27, later: the TUI Models screen download works (user: "je me suis trompé"); nothing to fix there.549 - 2026-11-27, later: the TUI Models screen download works (user: "je me suis trompé"); nothing to fix there.
550+- 2026-11-27, later: GPU load confirmed shown on the Mac (#28 closed); the Machine line was too full → split in two, status bar reordered (version, gpu, pressure, memory, model, address last). Linux 336, Mac green.
modified .tickets/issues/0028-show-gpu-load.yaml +13 -3
@@ -1,12 +1,13 @@
11 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
22 id: 28
33 title: Show GPU load
4-state: open
4+state: closed
55 author:
66 name: k33g
77 email: ph.charriere@gmail.com
88 createdAt: 2026-11-24T05:48:30.000Z
9-updatedAt: 2026-11-27T06:40:00.000Z
9+updatedAt: 2026-11-27T10:30:00.000Z
10+closedAt: 2026-11-27T10:30:00.000Z
1011 labels:
1112 - "kind::feature"
1213 - "area::tui"
@@ -40,12 +41,14 @@ body: |
4041 tasks:
4142 - id: 1
4243 title: Read IOAccelerator PerformanceStatistics on the Mac and check the keys on this machine's GPU / macOS version
43- state: open
44+ state: closed
4445 priority: medium
4546 author:
4647 name: k33g
4748 email: ph.charriere@gmail.com
4849 createdAt: 2026-11-24T05:48:30.000Z
50+ updatedAt: 2026-11-27T10:30:00.000Z
51+ closedAt: 2026-11-27T10:30:00.000Z
4952 - id: 2
5053 title: Add GPU utilisation to the system monitor of #26 (Darwin implementation + fake)
5154 state: closed
@@ -82,3 +85,10 @@ comments:
8285 body: |
8386 Tasks 2-3 done (1dea285, docs bb36d60): SystemMonitor reads the highest "Device Utilization %" of the IOAccelerator services' PerformanceStatistics (IOKit, no root) on each status request; /rzb/status system.gpu_utilization, null when absent (Linux, or a GPU that does not publish the key); rzb tui shows "gpu N%" in the status bar and the Machine line, and hides it when null. The CLI stats part belonged to the removed agent.
8487 Task 1 stays open: the code compiles and runs on the Mac, but whether this Mac's GPU publishes the key (and its value under load) was not seen yet — check during the manual tests (Dashboard while generating, or curl /rzb/status | jq .system).
88+ - id: 3
89+ author:
90+ name: k33g
91+ email: ph.charriere@gmail.com
92+ createdAt: 2026-11-27T10:30:00.000Z
93+ body: |
94+ Task 1 checked by the user on the Mac (2026-11-27): the GPU load shows in rzb tui. The line was too full and got cut: the Dashboard's Machine line is now two lines (gpu, pressure, rzb footprint; then memory), and the status bar puts version, gpu, pressure, memory and model first, the address last (cut first on a narrow terminal).
@@ -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: 282 id: 28
3 title: Show GPU load3 title: Show GPU load
4-state: open4+state: closed
5 author:5 author:
6 name: k33g6 name: k33g
7 email: ph.charriere@gmail.com7 email: ph.charriere@gmail.com
8 createdAt: 2026-11-24T05:48:30.000Z8 createdAt: 2026-11-24T05:48:30.000Z
9-updatedAt: 2026-11-27T06:40:00.000Z9+updatedAt: 2026-11-27T10:30:00.000Z
10+closedAt: 2026-11-27T10:30:00.000Z
10 labels:11 labels:
11 - "kind::feature"12 - "kind::feature"
12 - "area::tui"13 - "area::tui"
@@ -40,12 +41,14 @@ body: |
40 tasks:41 tasks:
41 - id: 142 - id: 1
42 title: Read IOAccelerator PerformanceStatistics on the Mac and check the keys on this machine's GPU / macOS version43 title: Read IOAccelerator PerformanceStatistics on the Mac and check the keys on this machine's GPU / macOS version
43- state: open44+ state: closed
44 priority: medium45 priority: medium
45 author:46 author:
46 name: k33g47 name: k33g
47 email: ph.charriere@gmail.com48 email: ph.charriere@gmail.com
48 createdAt: 2026-11-24T05:48:30.000Z49 createdAt: 2026-11-24T05:48:30.000Z
50+ updatedAt: 2026-11-27T10:30:00.000Z
51+ closedAt: 2026-11-27T10:30:00.000Z
49 - id: 252 - id: 2
50 title: Add GPU utilisation to the system monitor of #26 (Darwin implementation + fake)53 title: Add GPU utilisation to the system monitor of #26 (Darwin implementation + fake)
51 state: closed54 state: closed
@@ -82,3 +85,10 @@ comments:
82 body: |85 body: |
83 Tasks 2-3 done (1dea285, docs bb36d60): SystemMonitor reads the highest "Device Utilization %" of the IOAccelerator services' PerformanceStatistics (IOKit, no root) on each status request; /rzb/status system.gpu_utilization, null when absent (Linux, or a GPU that does not publish the key); rzb tui shows "gpu N%" in the status bar and the Machine line, and hides it when null. The CLI stats part belonged to the removed agent.86 Tasks 2-3 done (1dea285, docs bb36d60): SystemMonitor reads the highest "Device Utilization %" of the IOAccelerator services' PerformanceStatistics (IOKit, no root) on each status request; /rzb/status system.gpu_utilization, null when absent (Linux, or a GPU that does not publish the key); rzb tui shows "gpu N%" in the status bar and the Machine line, and hides it when null. The CLI stats part belonged to the removed agent.
84 Task 1 stays open: the code compiles and runs on the Mac, but whether this Mac's GPU publishes the key (and its value under load) was not seen yet — check during the manual tests (Dashboard while generating, or curl /rzb/status | jq .system).87 Task 1 stays open: the code compiles and runs on the Mac, but whether this Mac's GPU publishes the key (and its value under load) was not seen yet — check during the manual tests (Dashboard while generating, or curl /rzb/status | jq .system).
88+ - id: 3
89+ author:
90+ name: k33g
91+ email: ph.charriere@gmail.com
92+ createdAt: 2026-11-27T10:30:00.000Z
93+ body: |
94+ Task 1 checked by the user on the Mac (2026-11-27): the GPU load shows in rzb tui. The line was too full and got cut: the Dashboard's Machine line is now two lines (gpu, pressure, rzb footprint; then memory), and the status bar puts version, gpu, pressure, memory and model first, the address last (cut first on a narrow terminal).
modified Sources/RazorbillTUI/AppRenderer.swift +9 -7
@@ -50,7 +50,7 @@ public struct AppRenderer: Sendable {
5050 let keys = "Ctrl-T next · Ctrl-Q quit"
5151 let (mark, text) = connectionText(state)
5252 let left = TextLayout.truncate(text, width: max(0, width - 2))
53- let room = width - 2 - left.count - keys.count - 1
53+ let room = width - 2 - TextLayout.visibleCount(left) - keys.count - 1
5454 let right = room >= 0 ? String(repeating: " ", count: room + 1) + style.dim(keys) : ""
5555 return mark + " " + left + right
5656 }
@@ -61,16 +61,18 @@ public struct AppRenderer: Sendable {
6161 case .connecting:
6262 return (style.dim("…"), "connecting to \(url)")
6363 case .connected(let version):
64- var parts = ["rzb \(version) at \(url)"]
65- if let model = state.model { parts.append(model) }
64+ // Most useful first: what is cut when the terminal is narrow is the address, which the
65+ // Dashboard also shows.
66+ var parts = ["rzb \(version)"]
67+ if let gpu = state.gpuUtilization { parts.append("gpu \(gpu)%") }
68+ if let pressure = state.pressure { parts.append(self.pressure(pressure)) }
6669 if let memory = state.memory {
6770 let used = Self.gigabytes(memory.used)
6871 parts.append("memory \(used) / \(Self.gigabytes(memory.limit))")
6972 }
70- if let gpu = state.gpuUtilization { parts.append("gpu \(gpu)%") }
71- var text = parts.joined(separator: " · ")
72- if let pressure = state.pressure { text += " · " + self.pressure(pressure) }
73- return (style.green("●"), text)
73+ if let model = state.model { parts.append(model) }
74+ parts.append(url)
75+ return (style.green("●"), parts.joined(separator: " · "))
7476 case .unreachable:
7577 return (style.red("○"), "no server at \(url) — start one with: rzb serve")
7678 case .unauthorized:
@@ -50,7 +50,7 @@ public struct AppRenderer: Sendable {
50 let keys = "Ctrl-T next · Ctrl-Q quit"50 let keys = "Ctrl-T next · Ctrl-Q quit"
51 let (mark, text) = connectionText(state)51 let (mark, text) = connectionText(state)
52 let left = TextLayout.truncate(text, width: max(0, width - 2))52 let left = TextLayout.truncate(text, width: max(0, width - 2))
53- let room = width - 2 - left.count - keys.count - 153+ let room = width - 2 - TextLayout.visibleCount(left) - keys.count - 1
54 let right = room >= 0 ? String(repeating: " ", count: room + 1) + style.dim(keys) : ""54 let right = room >= 0 ? String(repeating: " ", count: room + 1) + style.dim(keys) : ""
55 return mark + " " + left + right55 return mark + " " + left + right
56 }56 }
@@ -61,16 +61,18 @@ public struct AppRenderer: Sendable {
61 case .connecting:61 case .connecting:
62 return (style.dim("…"), "connecting to \(url)")62 return (style.dim("…"), "connecting to \(url)")
63 case .connected(let version):63 case .connected(let version):
64- var parts = ["rzb \(version) at \(url)"]64+ // Most useful first: what is cut when the terminal is narrow is the address, which the
65- if let model = state.model { parts.append(model) }65+ // Dashboard also shows.
66+ var parts = ["rzb \(version)"]
67+ if let gpu = state.gpuUtilization { parts.append("gpu \(gpu)%") }
68+ if let pressure = state.pressure { parts.append(self.pressure(pressure)) }
66 if let memory = state.memory {69 if let memory = state.memory {
67 let used = Self.gigabytes(memory.used)70 let used = Self.gigabytes(memory.used)
68 parts.append("memory \(used) / \(Self.gigabytes(memory.limit))")71 parts.append("memory \(used) / \(Self.gigabytes(memory.limit))")
69 }72 }
70- if let gpu = state.gpuUtilization { parts.append("gpu \(gpu)%") }73+ if let model = state.model { parts.append(model) }
71- var text = parts.joined(separator: " · ")74+ parts.append(url)
72- if let pressure = state.pressure { text += " · " + self.pressure(pressure) }75+ return (style.green("●"), parts.joined(separator: " · "))
73- return (style.green("●"), text)
74 case .unreachable:76 case .unreachable:
75 return (style.red("○"), "no server at \(url) — start one with: rzb serve")77 return (style.red("○"), "no server at \(url) — start one with: rzb serve")
76 case .unauthorized:78 case .unauthorized:
modified Sources/RazorbillTUI/DashboardScreen.swift +17 -8
@@ -44,6 +44,7 @@ public struct DashboardScreen: Sendable, Equatable {
4444 + " · \(snapshot.host):\(snapshot.port)",
4545 " Memory " + Self.memory(snapshot.memory),
4646 " Machine " + Self.machine(snapshot.system, style: style),
47+ " " + Self.machineMemory(snapshot.system),
4748 "",
4849 style.bold(" Models") + style.dim(" ↑↓ select · u unload"),
4950 style.dim(Self.modelHeader),
@@ -118,26 +119,34 @@ public struct DashboardScreen: Sendable, Equatable {
118119
119120 /// `pressure normal · 18.2 GB available of 32.0 GB · compressed 1.1 GB · swap 0.0 GB ·
120121 /// rzb 4.1 GB · gpu 87%`, each part only when measured.
122+ /// The machine's first line, what changes while a model works: `gpu 87% · pressure normal ·
123+ /// rzb 4.1 GB`; each part only when measured.
121124 static func machine(_ system: MachineState?, style: Style) -> String {
122125 guard let system else { return "not reported by this server" }
123126 var parts: [String] = []
127+ if let gpu = system.gpuUtilization { parts.append("gpu \(gpu)%") }
124128 if let pressure = system.pressure {
125129 parts.append(AppRenderer(style: style).pressure(pressure))
126130 }
131+ if let process = system.processBytes {
132+ parts.append("rzb \(AppRenderer.gigabytes(process))")
133+ }
134+ return parts.joined(separator: " · ")
135+ }
136+
137+ /// The machine's second line, its memory: `18.2 GB available of 32.0 GB · compressed 1.1 GB ·
138+ /// swap 0.0 GB`; empty when the server reports no machine.
139+ static func machineMemory(_ system: MachineState?) -> String {
140+ guard let system else { return "" }
127141 let total = AppRenderer.gigabytes(system.physicalBytes)
128- if let available = system.availableBytes {
129- parts.append("\(AppRenderer.gigabytes(available)) available of \(total)")
130- } else {
131- parts.append("\(total) installed")
142+ let available = system.availableBytes.map {
143+ "\(AppRenderer.gigabytes($0)) available of \(total)"
132144 }
145+ var parts = [available ?? "\(total) installed"]
133146 if let compressed = system.compressedBytes {
134147 parts.append("compressed \(AppRenderer.gigabytes(compressed))")
135148 }
136149 if let swap = system.swapUsedBytes { parts.append("swap \(AppRenderer.gigabytes(swap))") }
137- if let process = system.processBytes {
138- parts.append("rzb \(AppRenderer.gigabytes(process))")
139- }
140- if let gpu = system.gpuUtilization { parts.append("gpu \(gpu)%") }
141150 return parts.joined(separator: " · ")
142151 }
143152
@@ -44,6 +44,7 @@ public struct DashboardScreen: Sendable, Equatable {
44 + " · \(snapshot.host):\(snapshot.port)",44 + " · \(snapshot.host):\(snapshot.port)",
45 " Memory " + Self.memory(snapshot.memory),45 " Memory " + Self.memory(snapshot.memory),
46 " Machine " + Self.machine(snapshot.system, style: style),46 " Machine " + Self.machine(snapshot.system, style: style),
47+ " " + Self.machineMemory(snapshot.system),
47 "",48 "",
48 style.bold(" Models") + style.dim(" ↑↓ select · u unload"),49 style.bold(" Models") + style.dim(" ↑↓ select · u unload"),
49 style.dim(Self.modelHeader),50 style.dim(Self.modelHeader),
@@ -118,26 +119,34 @@ public struct DashboardScreen: Sendable, Equatable {
118 119
119 /// `pressure normal · 18.2 GB available of 32.0 GB · compressed 1.1 GB · swap 0.0 GB ·120 /// `pressure normal · 18.2 GB available of 32.0 GB · compressed 1.1 GB · swap 0.0 GB ·
120 /// rzb 4.1 GB · gpu 87%`, each part only when measured.121 /// rzb 4.1 GB · gpu 87%`, each part only when measured.
122+ /// The machine's first line, what changes while a model works: `gpu 87% · pressure normal ·
123+ /// rzb 4.1 GB`; each part only when measured.
121 static func machine(_ system: MachineState?, style: Style) -> String {124 static func machine(_ system: MachineState?, style: Style) -> String {
122 guard let system else { return "not reported by this server" }125 guard let system else { return "not reported by this server" }
123 var parts: [String] = []126 var parts: [String] = []
127+ if let gpu = system.gpuUtilization { parts.append("gpu \(gpu)%") }
124 if let pressure = system.pressure {128 if let pressure = system.pressure {
125 parts.append(AppRenderer(style: style).pressure(pressure))129 parts.append(AppRenderer(style: style).pressure(pressure))
126 }130 }
131+ if let process = system.processBytes {
132+ parts.append("rzb \(AppRenderer.gigabytes(process))")
133+ }
134+ return parts.joined(separator: " · ")
135+ }
136+
137+ /// The machine's second line, its memory: `18.2 GB available of 32.0 GB · compressed 1.1 GB ·
138+ /// swap 0.0 GB`; empty when the server reports no machine.
139+ static func machineMemory(_ system: MachineState?) -> String {
140+ guard let system else { return "" }
127 let total = AppRenderer.gigabytes(system.physicalBytes)141 let total = AppRenderer.gigabytes(system.physicalBytes)
128- if let available = system.availableBytes {142+ let available = system.availableBytes.map {
129- parts.append("\(AppRenderer.gigabytes(available)) available of \(total)")143+ "\(AppRenderer.gigabytes($0)) available of \(total)"
130- } else {
131- parts.append("\(total) installed")
132 }144 }
145+ var parts = [available ?? "\(total) installed"]
133 if let compressed = system.compressedBytes {146 if let compressed = system.compressedBytes {
134 parts.append("compressed \(AppRenderer.gigabytes(compressed))")147 parts.append("compressed \(AppRenderer.gigabytes(compressed))")
135 }148 }
136 if let swap = system.swapUsedBytes { parts.append("swap \(AppRenderer.gigabytes(swap))") }149 if let swap = system.swapUsedBytes { parts.append("swap \(AppRenderer.gigabytes(swap))") }
137- if let process = system.processBytes {
138- parts.append("rzb \(AppRenderer.gigabytes(process))")
139- }
140- if let gpu = system.gpuUtilization { parts.append("gpu \(gpu)%") }
141 return parts.joined(separator: " · ")150 return parts.joined(separator: " · ")
142 }151 }
143 152
modified Tests/RazorbillTUITests/AppShellTests.swift +13 -1
@@ -66,7 +66,7 @@ import Testing
6666 state.memory = MemoryUse(used: 1 << 30, limit: 32 << 30)
6767 #expect(
6868 text(state)[5].hasPrefix(
69- "● rzb 0.2.0 at http://127.0.0.1:7920 · qwen · memory 1.0 GB / 32.0 GB"))
69+ "● rzb 0.2.0 · memory 1.0 GB / 32.0 GB · qwen · http://127.0.0.1:7920"))
7070 }
7171
7272 @Test(arguments: [
@@ -80,6 +80,18 @@ import Testing
8080 #expect(text(state)[5].hasPrefix(expected))
8181 }
8282
83+ @Test func narrowTerminalCutsTheAddressFirst() {
84+ var state = AppState(serverURL: "http://127.0.0.1:7920")
85+ state.connection = .connected(version: "0.3.0")
86+ state.gpuUtilization = 87
87+ state.pressure = "normal"
88+ state.memory = MemoryUse(used: 1 << 30, limit: 32 << 30)
89+ state.model = "qwen"
90+ let status = text(state, columns: 60)[5]
91+ #expect(status.hasPrefix("● rzb 0.3.0 · gpu 87% · pressure normal · memory 1.0 GB"))
92+ #expect(status.hasSuffix("…") && !status.contains("http"))
93+ }
94+
8395 @Test func narrowTerminalDropsTheKeysThenCutsTheText() {
8496 var state = AppState(serverURL: "http://127.0.0.1:7920")
8597 state.connection = .unreachable
@@ -66,7 +66,7 @@ import Testing
66 state.memory = MemoryUse(used: 1 << 30, limit: 32 << 30)66 state.memory = MemoryUse(used: 1 << 30, limit: 32 << 30)
67 #expect(67 #expect(
68 text(state)[5].hasPrefix(68 text(state)[5].hasPrefix(
69- "● rzb 0.2.0 at http://127.0.0.1:7920 · qwen · memory 1.0 GB / 32.0 GB"))69+ "● rzb 0.2.0 · memory 1.0 GB / 32.0 GB · qwen · http://127.0.0.1:7920"))
70 }70 }
71 71
72 @Test(arguments: [72 @Test(arguments: [
@@ -80,6 +80,18 @@ import Testing
80 #expect(text(state)[5].hasPrefix(expected))80 #expect(text(state)[5].hasPrefix(expected))
81 }81 }
82 82
83+ @Test func narrowTerminalCutsTheAddressFirst() {
84+ var state = AppState(serverURL: "http://127.0.0.1:7920")
85+ state.connection = .connected(version: "0.3.0")
86+ state.gpuUtilization = 87
87+ state.pressure = "normal"
88+ state.memory = MemoryUse(used: 1 << 30, limit: 32 << 30)
89+ state.model = "qwen"
90+ let status = text(state, columns: 60)[5]
91+ #expect(status.hasPrefix("● rzb 0.3.0 · gpu 87% · pressure normal · memory 1.0 GB"))
92+ #expect(status.hasSuffix("…") && !status.contains("http"))
93+ }
94+
83 @Test func narrowTerminalDropsTheKeysThenCutsTheText() {95 @Test func narrowTerminalDropsTheKeysThenCutsTheText() {
84 var state = AppState(serverURL: "http://127.0.0.1:7920")96 var state = AppState(serverURL: "http://127.0.0.1:7920")
85 state.connection = .unreachable97 state.connection = .unreachable
modified Tests/RazorbillTUITests/DashboardAndChatTests.swift +8 -5
@@ -38,20 +38,23 @@ let plain = Style(colors: false)
3838 physicalBytes: 32 << 30, pressure: "warning", availableBytes: 8 << 30,
3939 compressedBytes: 1 << 30, swapUsedBytes: 0, processBytes: 4 << 30, gpuUtilization: 87)
4040 var dashboard = DashboardScreen()
41+ let lines = render(&dashboard, status)
42+ #expect(lines[2] == " Machine gpu 87% · pressure warning · rzb 4.0 GB")
4143 #expect(
42- render(&dashboard, status)[2]
43- == " Machine pressure warning · 8.0 GB available of 32.0 GB · compressed 1.0 GB"
44- + " · swap 0.0 GB · rzb 4.0 GB · gpu 87%")
44+ lines[3] == " 8.0 GB available of 32.0 GB · compressed 1.0 GB · swap 0.0 GB")
4545 #expect(DashboardScreen.machine(nil, style: plain) == "not reported by this server")
4646 let linux = MachineState(physicalBytes: 16 << 30)
47- #expect(DashboardScreen.machine(linux, style: plain) == "16.0 GB installed")
47+ #expect(DashboardScreen.machine(linux, style: plain) == "")
48+ #expect(DashboardScreen.machineMemory(linux) == "16.0 GB installed")
4849 var state = AppState(serverURL: "u")
4950 state.connection = .connected(version: "0.3.0")
5051 state.gpuUtilization = 87
5152 state.pressure = "critical"
5253 let colored = AppRenderer(style: Style(colors: true)).render(
5354 state, body: [], rows: 4, columns: 120)
54- #expect(colored.lines[3].contains("gpu 87% · \u{1B}[31mpressure critical\u{1B}[0m"))
55+ let critical = "rzb 0.3.0 · gpu 87% · \u{1B}[31mpressure critical\u{1B}[0m"
56+ #expect(colored.lines[3].contains(critical))
57+ #expect(colored.lines[3].contains("Ctrl-T next"))
5558 }
5659
5760 @Test func arrowsSelectAndUUnloadsTheSelectedModel() {
@@ -38,20 +38,23 @@ let plain = Style(colors: false)
38 physicalBytes: 32 << 30, pressure: "warning", availableBytes: 8 << 30,38 physicalBytes: 32 << 30, pressure: "warning", availableBytes: 8 << 30,
39 compressedBytes: 1 << 30, swapUsedBytes: 0, processBytes: 4 << 30, gpuUtilization: 87)39 compressedBytes: 1 << 30, swapUsedBytes: 0, processBytes: 4 << 30, gpuUtilization: 87)
40 var dashboard = DashboardScreen()40 var dashboard = DashboardScreen()
41+ let lines = render(&dashboard, status)
42+ #expect(lines[2] == " Machine gpu 87% · pressure warning · rzb 4.0 GB")
41 #expect(43 #expect(
42- render(&dashboard, status)[2]44+ lines[3] == " 8.0 GB available of 32.0 GB · compressed 1.0 GB · swap 0.0 GB")
43- == " Machine pressure warning · 8.0 GB available of 32.0 GB · compressed 1.0 GB"
44- + " · swap 0.0 GB · rzb 4.0 GB · gpu 87%")
45 #expect(DashboardScreen.machine(nil, style: plain) == "not reported by this server")45 #expect(DashboardScreen.machine(nil, style: plain) == "not reported by this server")
46 let linux = MachineState(physicalBytes: 16 << 30)46 let linux = MachineState(physicalBytes: 16 << 30)
47- #expect(DashboardScreen.machine(linux, style: plain) == "16.0 GB installed")47+ #expect(DashboardScreen.machine(linux, style: plain) == "")
48+ #expect(DashboardScreen.machineMemory(linux) == "16.0 GB installed")
48 var state = AppState(serverURL: "u")49 var state = AppState(serverURL: "u")
49 state.connection = .connected(version: "0.3.0")50 state.connection = .connected(version: "0.3.0")
50 state.gpuUtilization = 8751 state.gpuUtilization = 87
51 state.pressure = "critical"52 state.pressure = "critical"
52 let colored = AppRenderer(style: Style(colors: true)).render(53 let colored = AppRenderer(style: Style(colors: true)).render(
53 state, body: [], rows: 4, columns: 120)54 state, body: [], rows: 4, columns: 120)
54- #expect(colored.lines[3].contains("gpu 87% · \u{1B}[31mpressure critical\u{1B}[0m"))55+ let critical = "rzb 0.3.0 · gpu 87% · \u{1B}[31mpressure critical\u{1B}[0m"
56+ #expect(colored.lines[3].contains(critical))
57+ #expect(colored.lines[3].contains("Ctrl-T next"))
55 }58 }
56 59
57 @Test func arrowsSelectAndUUnloadsTheSelectedModel() {60 @Test func arrowsSelectAndUUnloadsTheSelectedModel() {
modified Tests/RazorbillTUITests/TUIAppTests.swift +1 -1
@@ -132,7 +132,7 @@ func waitForScreen(_ terminal: FakeTerminal, containing text: String) async thro
132132 try await waitForScreen(terminal, containing: "idle 7s, unloads in 9m 52s")
133133 #expect(
134134 terminal.lastText.last?.hasPrefix(
135- "● rzb 0.2.0 at http://127.0.0.1:7920 · qwen · memory 1.0 GB / 32.0 GB") == true)
135+ "● rzb 0.2.0 · memory 1.0 GB / 32.0 GB · qwen · http://127.0.0.1:7920") == true)
136136 terminal.press(.control("q"))
137137 await running.value
138138 #expect(terminal.enterCount == 1 && terminal.leaveCount == 1)
@@ -132,7 +132,7 @@ func waitForScreen(_ terminal: FakeTerminal, containing text: String) async thro
132 try await waitForScreen(terminal, containing: "idle 7s, unloads in 9m 52s")132 try await waitForScreen(terminal, containing: "idle 7s, unloads in 9m 52s")
133 #expect(133 #expect(
134 terminal.lastText.last?.hasPrefix(134 terminal.lastText.last?.hasPrefix(
135- "● rzb 0.2.0 at http://127.0.0.1:7920 · qwen · memory 1.0 GB / 32.0 GB") == true)135+ "● rzb 0.2.0 · memory 1.0 GB / 32.0 GB · qwen · http://127.0.0.1:7920") == true)
136 terminal.press(.control("q"))136 terminal.press(.control("q"))
137 await running.value137 await running.value
138 #expect(terminal.enterCount == 1 && terminal.leaveCount == 1)138 #expect(terminal.enterCount == 1 && terminal.leaveCount == 1)
modified docs/en/reference/tui.md +2 -2
@@ -13,7 +13,7 @@
1313 | Mark in the last row | Meaning |
1414 | --- | --- |
1515 | `…` | Waiting for the server's first answer |
16-| `●` | Connected: the server's version and address, the first loaded model, the engine's memory in use over its limit, the GPU load, the memory pressure (green normal, yellow warning, red critical) |
16+| `●` | Connected, in this order: the server's version, the GPU load, the memory pressure (green normal, yellow warning, red critical), the engine's memory in use over its limit, the first loaded model, the server's address. A narrow terminal cuts the end first |
1717 | `○` | No server answers; every screen shows the `rzb serve` command to run (with `--config` when `rzb tui` got one) |
1818 | `✕` | The server refused the API key (401), or it is on another machine (403 `local_only`) |
1919
@@ -32,7 +32,7 @@ Memory and sizes are in GB of 2³⁰ bytes.
3232
3333 ## Dashboard (F2)
3434
35-The server's version, uptime and address; the engine's memory as a gauge of active over limit, with cache and peak (`not reported by this engine` on Linux); the machine (memory pressure, available memory over installed, compressed memory, swap, the server's footprint as `rzb …`, GPU load; each part only when the server can measure it); the loaded models; the last requests.
35+The server's version, uptime and address; the engine's memory as a gauge of active over limit, with cache and peak (`not reported by this engine` on Linux); the machine on two lines (GPU load, memory pressure and the server's footprint as `rzb …`; then available memory over installed, compressed memory and swap; each part only when the server can measure it); the loaded models; the last requests.
3636
3737 | Models column | Content |
3838 | --- | --- |
@@ -13,7 +13,7 @@
13 | Mark in the last row | Meaning |13 | Mark in the last row | Meaning |
14 | --- | --- |14 | --- | --- |
15 | `…` | Waiting for the server's first answer |15 | `…` | Waiting for the server's first answer |
16-| `●` | Connected: the server's version and address, the first loaded model, the engine's memory in use over its limit, the GPU load, the memory pressure (green normal, yellow warning, red critical) |16+| `●` | Connected, in this order: the server's version, the GPU load, the memory pressure (green normal, yellow warning, red critical), the engine's memory in use over its limit, the first loaded model, the server's address. A narrow terminal cuts the end first |
17 | `○` | No server answers; every screen shows the `rzb serve` command to run (with `--config` when `rzb tui` got one) |17 | `○` | No server answers; every screen shows the `rzb serve` command to run (with `--config` when `rzb tui` got one) |
18 | `✕` | The server refused the API key (401), or it is on another machine (403 `local_only`) |18 | `✕` | The server refused the API key (401), or it is on another machine (403 `local_only`) |
19 19
@@ -32,7 +32,7 @@ Memory and sizes are in GB of 2³⁰ bytes.
32 32
33 ## Dashboard (F2)33 ## Dashboard (F2)
34 34
35-The server's version, uptime and address; the engine's memory as a gauge of active over limit, with cache and peak (`not reported by this engine` on Linux); the machine (memory pressure, available memory over installed, compressed memory, swap, the server's footprint as `rzb …`, GPU load; each part only when the server can measure it); the loaded models; the last requests.35+The server's version, uptime and address; the engine's memory as a gauge of active over limit, with cache and peak (`not reported by this engine` on Linux); the machine on two lines (GPU load, memory pressure and the server's footprint as `rzb …`; then available memory over installed, compressed memory and swap; each part only when the server can measure it); the loaded models; the last requests.
36 36
37 | Models column | Content |37 | Models column | Content |
38 | --- | --- |38 | --- | --- |
modified docs/fr/reference/tui.md +2 -2
@@ -13,7 +13,7 @@
1313 | Signe de la dernière ligne | Signification |
1414 | --- | --- |
1515 | `…` | En attente de la première réponse du serveur |
16-| `●` | Connecté : la version et l'adresse du serveur, le premier modèle chargé, la mémoire du moteur utilisée sur sa limite, la charge du GPU, la pression mémoire (vert normal, jaune warning, rouge critical) |
16+| `●` | Connecté, dans cet ordre : la version du serveur, la charge du GPU, la pression mémoire (vert normal, jaune warning, rouge critical), la mémoire du moteur utilisée sur sa limite, le premier modèle chargé, l'adresse du serveur. Un terminal étroit coupe d'abord la fin |
1717 | `○` | Aucun serveur ne répond ; chaque écran donne la commande `rzb serve` à lancer (avec `--config` quand `rzb tui` en a reçu un) |
1818 | `✕` | Le serveur a refusé la clé d'API (401), ou il est sur une autre machine (403 `local_only`) |
1919
@@ -32,7 +32,7 @@ Les mémoires et les tailles sont en Go de 2³⁰ octets.
3232
3333 ## Dashboard (F2)
3434
35-La version, la durée de fonctionnement et l'adresse du serveur ; la mémoire du moteur en jauge (active sur limite), avec le cache et le maximum (`not reported by this engine` sous Linux) ; la machine (pression mémoire, mémoire disponible sur installée, mémoire compressée, swap, empreinte du serveur sous la forme `rzb …`, charge du GPU ; chaque partie seulement quand le serveur sait la mesurer) ; les modèles chargés ; les dernières requêtes.
35+La version, la durée de fonctionnement et l'adresse du serveur ; la mémoire du moteur en jauge (active sur limite), avec le cache et le maximum (`not reported by this engine` sous Linux) ; la machine sur deux lignes (charge du GPU, pression mémoire et empreinte du serveur sous la forme `rzb …` ; puis mémoire disponible sur installée, mémoire compressée et swap ; chaque partie seulement quand le serveur sait la mesurer) ; les modèles chargés ; les dernières requêtes.
3636
3737 | Colonne des modèles | Contenu |
3838 | --- | --- |
@@ -13,7 +13,7 @@
13 | Signe de la dernière ligne | Signification |13 | Signe de la dernière ligne | Signification |
14 | --- | --- |14 | --- | --- |
15 | `…` | En attente de la première réponse du serveur |15 | `…` | En attente de la première réponse du serveur |
16-| `●` | Connecté : la version et l'adresse du serveur, le premier modèle chargé, la mémoire du moteur utilisée sur sa limite, la charge du GPU, la pression mémoire (vert normal, jaune warning, rouge critical) |16+| `●` | Connecté, dans cet ordre : la version du serveur, la charge du GPU, la pression mémoire (vert normal, jaune warning, rouge critical), la mémoire du moteur utilisée sur sa limite, le premier modèle chargé, l'adresse du serveur. Un terminal étroit coupe d'abord la fin |
17 | `○` | Aucun serveur ne répond ; chaque écran donne la commande `rzb serve` à lancer (avec `--config` quand `rzb tui` en a reçu un) |17 | `○` | Aucun serveur ne répond ; chaque écran donne la commande `rzb serve` à lancer (avec `--config` quand `rzb tui` en a reçu un) |
18 | `✕` | Le serveur a refusé la clé d'API (401), ou il est sur une autre machine (403 `local_only`) |18 | `✕` | Le serveur a refusé la clé d'API (401), ou il est sur une autre machine (403 `local_only`) |
19 19
@@ -32,7 +32,7 @@ Les mémoires et les tailles sont en Go de 2³⁰ octets.
32 32
33 ## Dashboard (F2)33 ## Dashboard (F2)
34 34
35-La version, la durée de fonctionnement et l'adresse du serveur ; la mémoire du moteur en jauge (active sur limite), avec le cache et le maximum (`not reported by this engine` sous Linux) ; la machine (pression mémoire, mémoire disponible sur installée, mémoire compressée, swap, empreinte du serveur sous la forme `rzb …`, charge du GPU ; chaque partie seulement quand le serveur sait la mesurer) ; les modèles chargés ; les dernières requêtes.35+La version, la durée de fonctionnement et l'adresse du serveur ; la mémoire du moteur en jauge (active sur limite), avec le cache et le maximum (`not reported by this engine` sous Linux) ; la machine sur deux lignes (charge du GPU, pression mémoire et empreinte du serveur sous la forme `rzb …` ; puis mémoire disponible sur installée, mémoire compressée et swap ; chaque partie seulement quand le serveur sait la mesurer) ; les modèles chargés ; les dernières requêtes.
36 36
37 | Colonne des modèles | Contenu |37 | Colonne des modèles | Contenu |
38 | --- | --- |38 | --- | --- |