connor_yang (Discord #help) asked that the Routing stage say which
session an account is serving next to its "answering…" / "answered this
request" status. The row now ends "· <title>", one line cut short with
the full title on hover, and only when the agent itself named that
session:
- Claude, Gemini and the other agents: sessions.Titles by agent:id, the
same source the By session list heads use.
- Codex: its own name index (session_index.jsonl) by thread id.
- A Codex request whose parent the server inferred from prompt and
reply fingerprints (parentMatched) shows nothing, since that parent
is a guess. An untitled session shows nothing too.
Cost: no new server path. The titles come from the existing
/api/gateway/session-titles calls that refreshSessionNames already makes
every 15s and on focus. A session id the page hasn't seen is asked for
once (marked asked before the fetch, 300ms debounce, never two calls at
once), and the ask is skipped when a read since then already covered it
(namesDue). The per-second render only reads two maps. The title sits in
its own nowrap span, because the narrow stage (.max560/.max460) wraps
the status.
A Codex names reply silent on a session no longer clears the title
the trace brought. CodexTitles leaves unknown ids out, and returns {}
when the index can't be read, so the old loop turned a failed read into
"no title". With the earlier ask it also raced the trace: routing-sessions'
"title helpers belong to the named parent" went red 3 of 6 runs under
--test-concurrency=4 until this change, then 6 of 6 green.
Run:
- routing-session-title.test.cjs (new): engines x claude/codex x en, zh,
zh-TW, ja, de x 1100/420px = 40 tests. Chromium 20/20 on mote.
WebKit 20/20 on the Linux box (wsl-run, magpie-desktop). On mote even
a bare webkit.launch() timed out at 60s under other sessions' load (21,
67 pw_run processes), so WebKit there tested nothing.
- 16 nearby routing GUI files (answered-still, row-reuse, row-two-lines,
stage-routes, sessions, reroute-title, tick-no-layout, live-patch,
busy, served, js, steady, steady-garbage, session-folder, live-calm,
request-model) in Chromium and WebKit on the Linux box, before the
rebase onto 82b45888a. The reds that came back were compared with
origin/main in a detached worktree:
- routing-steady "requests coming in leave the routing groups" is red
in both engines at main 03f609e3f (#3412).
- routing-request-model's 5 WebKit cases are red at main 82b45888a,
run alone (#4120 lists them).
- routing-sessions "background memory groups" WebKit en is red at
82b45888a, overflowing at 560px (filed #4538).
- routing-sessions "title helpers" was mine; fixed above.
- After the rebase and the last edits, routing-session-title,
routing-sessions, routing-session-folder and routing-rest-error
(82b45888a's test, whose lines in client.js this change meets), three
times per engine at --test-concurrency=4: Chromium 59/59 each time;
WebKit 59/59 once, then 58/59 twice, the one red being #4538.
Broken by hand:
- titleOf without the parentMatched check (and the Codex name loop
without it): the Codex cases go red, "a matched session's title is
not shown".
- askUnnamed asking again on every pass: red, "asked 4 more times in 3s"
(again on the final code).
- The silent-reply guard was not broken by hand on its own. What shows
it is the title-helpers race above (3 of 6 red without it, 6 of 6
green with it), not a deterministic test.
Not tried: a real app with a real agent's sessions, WebKitGTK in the
Linux app, and the whole GUI suite (it runs after the push).