Make the pairing form fillable, and let a link carry the code `/computers` is where a person approves a computer pairing, and it is the only place that can. Three pairings expired unapproved during one working session, partly because of this form. `computers-pairing__form` was a two-column grid with three children, so the checkbox landed beside the code label and the button wrapped underneath into the same cell — the words "Approve pairing" rendered through the checkbox text. The mobile breakpoint already stacked it, which is why this only appeared at desktop widths. It is one row per control now, and the checkbox sits on a line with its own words. The page also told the reader to run `sarah-computer-controller pair`, which does not exist. Someone following the instructions could not obtain a code at all. It is `oa computer pair`. And a pairing link may now carry its code, as `/device` already does. That difference was not cosmetic: a device authorization was approved in seconds because the link carried the code, while pairing codes had to be read off the agent's terminal and retyped inside a ten-minute window. Only a code-shaped value is accepted, so a crafted link cannot put arbitrary text in front of the reader as though the server had issued it. Five tests: the command named, a code prefilled, lower case accepted, a script-shaped value refused, and no link meaning no prefill. Refs openagents#112.
Make the pairing form fillable, and let a link carry the code
Deploy story
What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.
- pushed
- by user · WAL seq 445 · 2026-08-26T10:53:01.656747Z
Changed files
-
modified
assets/css/openagents.css -
modified
lib/openagents_web/live/computers_live.ex -
modified
test/openagents_web/live/computers_live_test.exs
Diff
3 files changed, +97 -7
assets/css/openagents.css modified +28 -3
@@ -352,11 +352,36 @@
| 352 | 352 |
|
| 353 | 353 |
|
| 354 | 354 |
|
| 355 |
|
|
| 356 |
|
|
| 357 |
|
|
| 358 |
|
|
| 359 |
|
|
| 360 |
|
|
| 361 |
|
|
| 355 | 362 |
|
| 356 | 363 |
|
| 357 |
|
|
| 358 |
|
|
| 359 |
|
|
| 364 |
|
|
| 365 |
|
|
| 366 |
|
|
| 367 |
|
|
| 368 |
|
|
| 369 |
|
|
| 370 |
|
|
| 371 |
|
|
| 372 |
|
|
| 373 |
|
|
| 374 |
|
|
| 375 |
|
|
| 376 |
|
|
| 377 |
|
|
| 378 |
|
|
| 379 |
|
|
| 380 |
|
|
| 381 |
|
|
| 382 |
|
|
| 383 |
|
|
| 384 |
|
|
| 360 | 385 |
|
| 361 | 386 |
|
| 362 | 387 |
|
lib/openagents_web/live/computers_live.ex modified +21 -4
@@ -13,13 +13,13 @@ defmodule OpenAgentsWeb.ComputersLive do
| 13 | 13 |
|
| 14 | 14 |
|
| 15 | 15 |
|
| 16 |
|
|
| 16 |
|
|
| 17 | 17 |
|
| 18 | 18 |
|
| 19 | 19 |
|
| 20 | 20 |
|
| 21 | 21 |
|
| 22 |
|
|
| 22 |
|
|
| 23 | 23 |
|
| 24 | 24 |
|
| 25 | 25 |
|
@@ -34,6 +34,23 @@ defmodule OpenAgentsWeb.ComputersLive do
| 34 | 34 |
|
| 35 | 35 |
|
| 36 | 36 |
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 37 | 54 |
|
| 38 | 55 |
|
| 39 | 56 |
|
@@ -352,8 +369,8 @@ defmodule OpenAgentsWeb.ComputersLive do
| 352 | 369 |
|
| 353 | 370 |
|
| 354 | 371 |
|
| 355 |
|
|
| 356 |
|
|
| 372 |
|
|
| 373 |
|
|
| 357 | 374 |
|
| 358 | 375 |
|
| 359 | 376 |
|
test/openagents_web/live/computers_live_test.exs modified +48
@@ -173,4 +173,52 @@ defmodule OpenAgentsWeb.ComputersLiveTest do
| 173 | 173 |
|
| 174 | 174 |
|
| 175 | 175 |
|
| 176 |
|
|
| 177 |
|
|
| 178 |
|
|
| 179 |
|
|
| 180 |
|
|
| 181 |
|
|
| 182 |
|
|
| 183 |
|
|
| 184 |
|
|
| 185 |
|
|
| 186 |
|
|
| 187 |
|
|
| 188 |
|
|
| 189 |
|
|
| 190 |
|
|
| 191 |
|
|
| 192 |
|
|
| 193 |
|
|
| 194 |
|
|
| 195 |
|
|
| 196 |
|
|
| 197 |
|
|
| 198 |
|
|
| 199 |
|
|
| 200 |
|
|
| 201 |
|
|
| 202 |
|
|
| 203 |
|
|
| 204 |
|
|
| 205 |
|
|
| 206 |
|
|
| 207 |
|
|
| 208 |
|
|
| 209 |
|
|
| 210 |
|
|
| 211 |
|
|
| 212 |
|
|
| 213 |
|
|
| 214 |
|
|
| 215 |
|
|
| 216 |
|
|
| 217 |
|
|
| 218 |
|
|
| 219 |
|
|
| 220 |
|
|
| 221 |
|
|
| 222 |
|
|
| 223 |
|
|
| 176 | 224 |
|