Commit Graph
1 Commits
Author SHA1 Message Date
yetone bfddc9cfba routing: DimCode's requests read as DimCode, with its mark, by key too
Yayoi_no_yume on X, a Docker magpie (v0.1.4350): DimCode (dimcode.dev)
on another computer, calling with a gateway key named "Magpie", drew
the Routing page's client node as the cube and "Magpie", and the
request's story said "DimAgent asked for the routing group Step 5
Preview".

Two causes:
- DimCode was no client magpie knew, so usage.AgentOf named it by its
  product name: npm's dimagent 0.5.29 sends "DimAgent/<version>" to a
  provider set to send its identity (resolveDimOAuthIdentityHeaders)
  and "DimCode/<version>" otherwise (read from the published binary).
  A client "dimcode" (DimCode, UA dimagent/dimcode) now names it,
  apart from the Dim alpha magpie starts ("dima"/"dimcode-alpha" stay
  Dim's, by name first). Its icon is dim-color: dimcode.dev's favicon
  (dimagent-favicon.svg, "Official DimAgent mark") is the same artwork.
  Routes and ledger records kept before are named again through
  AgentOf (Route.routedAgain), so old "DimAgent" rows read as DimCode.
- A keyed request's node read the key's name alone (eadc6cdb9, for a
  script's key behind "Python-urllib"). An agent magpie knows now
  reads "agent · key", as Usage's ledger rows already do; a script's
  key keeps the key's name alone. The tooltip names the agent once.
  The tray panel's stage and rows share callerName and read the same.

The icon comes from the embedded assets, which the web (Docker) build
serves the same way; the GUI test checks the image loads.

Run on mote:
- go vet ./internal/agent, GOOS=linux -tags nogui and GOOS=windows:
  ok. go test -count=1 ./internal/agent ./internal/usage: ok (agent 463s, usage 124s)
- TestDimCodeByUserAgent is red with the dimcode entry taken out
  (AgentOf("DimAgent/0.5.29") = "DimAgent").
- GUI, chromium and webkit, every language, 1100 and 420:
  routing-agent-with-key.test.cjs (new), i18n-keys, i18n-en-no-cjk:
  30 of 30 pass. Earlier, on mica, with the same client.js: the 28 other
  files that read callerKey, .rt-src, .ps-name/.ps-ag or .pr-who pass
  but api-key-usage (#7083) and usage-ledger's return-to-live case
  (#5048), both red on origin/main 2416beed6 too.
  routing-agent-with-key is red on the old client.js ('Magpie' for
  'DimCode · Magpie').

Not tried: a real DimCode against a real Docker magpie; the
User-Agents come from the published binary and the reporter's log.
2026-11-18 18:03:16 +08:00