A rule can match a client magpie doesn't know, such as SillyTavern or
someone's own app with its own User-Agent. The gateway already names such a
client by its User-Agent's product name (usage.AgentOf), and a rule compares
agents in lower case (cleanRules, MatchesBesidesIntent, Pauses). Until now
the editor's agent picker listed only the agents magpie knows.
The picker now lists the agents magpie knows, then the agents
/api/usage?period=30d heard from that it doesn't know, leaving out "other"
and magpie. The note on those reads "heard from in the last 30 days". The
usage call is made once per editor and reads the cached SummarizeTop. A name
typed in the filter is read the way the gateway reads a User-Agent: the text
before the first "/", space or comma, in lower case. "MyApp/2.0 (Linux)" is
myapp. A typed name that is already an agent's id is that agent. The
picked name shows in the chip as the others do and is saved in agents:[…].
app.js's openPicker gains field.placeholder and field.typed for this; other
pickers are unchanged.
zh label: 筛选,或输入 Agent 名称… (notes: User-Agent 开头的名称, 近 30 天有请求).
Strings are added in en, zh, zh-TW, ja and de.
No backend change. The TUI takes rules as text (agents=…), so it already
accepts any name. A typed alias of a known agent (claude-cli) isn't mapped
to its id in the picker. Only an exact id is.
Run at 224ea7d5b plus this change, in a worktree with a sandbox HOME:
- routing-rule-agent-typed.test.cjs (new): 20/20, chromium and webkit, 5
languages, at 1100px and at 390px. With app.js and client.js reverted it
is red: the placeholder reads 'Filter agent…', and the phone test never
sees the typed row.
- whole GUI suite (concurrency 4, load 160-380 from other sessions): 11170
tests, 11062 pass, 108 fail across 27 files. Rerun alone at concurrency 2
on this tree and on base 224ea7d5b, the same files are red on both (87
here, 93 on base). The only extra red here is gateway-key-groups, once, a
load flake (#1974, commented; it passes alone 3/3). Also red on base:
codex-predictions (#2624), routing-bodies (#2559), lightweight (#2638,
commented), segs-glide (#2683), and routing-keys-fold/-model-rest/
-request-metrics/-wb-restricted, usage-*, quota-*, s3-sync (#1544, #2658).
- set -o pipefail; go test -timeout 45m ./...: exit=0, every package ok.
- gofmt -l: nothing (no Go files changed). go vet ./... on darwin,
GOOS=linux go vet -tags nogui ./..., and GOOS=windows go vet ./...: clean.
- Rebased onto ef655acb4. b0b076421 had added warn() to the agents
onPick, and the new onPick keeps it. After the rebase:
routing-rule-agent-typed, routing-rule-remove, routing-pause and
routing-pause-folder: 74/74 in both engines.