The listings got a request tag so a late answer could not be read as the
next request's; `models` was left out. A probe that outlived the client's
15 s timeout stayed in the socket and the following plain `models` read it
as its own answer - /model then drew the endpoint's models where the
configuration was asked for, and the picker's second request drew a stale
list.
Test: tests/test_remote_list.c, fake server answers the first models
request twice and never the second. Before the fix the second call
returned 2 rows (FAIL nm == 0), after it 0. Full suite green, ASan clean
on the 46 test binaries.
The listings were matched to their request by kind alone. A server slower
than the client's 5 s timeout left its answer in the socket, and the next
request of the same kind read it as its own: the /sessions picker drew one
source's sessions under another source's name. Seen live on 2026-11-22
against a --serve instance.
A request may now carry "tag":N, the server echoes it in the event that
answers it, and the client drops an event whose tag is not the one it waits
for. Without a tag both sides behave as before.
Test: tests/test_remote_list.c has the server echo the tag and send the
first sessions answer twice. With the tag check removed it reports
"the unanswered request still drew 2 row(s): erste zweite" and three FAILs,
with it green. make check: all tests passed.
Also in here: pick_match stops at SP_PICK_ROWS like pick_add does (the two
caps are the same constant, the write was only safe because of that).
The picker's two remote calls cleared their counters only when the
answer arrived. A served engine that did not answer within the 5 s
deadline therefore left the last answer in place, and /sessions drew
another folder's - or another source's - rows as the ones that were
asked for. The counters are now cleared before the request is sent.
tests/test_remote_list drives the remote backend against a fake server
that answers the first request of each kind and drops the second one.
Without the fix it prints "the unanswered request still drew 2 row(s):
erste zweite" and fails five checks; with it: ok.
Verified: test_remote_list ok, make check: all tests passed.