Files
magpie/internal/gui/assets/plugins/routing
yetone e62a1bc515 routing: a trail is drawn in its own agent's colour, and agents on screen don't share one (Pkh)
Pkh (Discord, 0.1.2509, Linux) saw trails in another agent's colour,
and different agents drawn alike, on the Routing page.

Causes, read in routing/client.js:
- Wrong colour: render() coloured a lit row by row.rid, the latest
  staged request that weighed the seat, not by the request actually on
  it. With Codex answering and ZCode's request staged later, Codex's
  trail was drawn in ZCode's colour, and the fold, group and flows
  layers copied it.
- Stale colour: --agent was set when a row lit and never cleared, so a
  reused row or fold wire kept the last agent's colour. The panel's
  ps-out wires did the same.
- Collisions: hueOf gave 15 makers their own colour and hashed the
  rest into 8 spares. 49 of 59 agent ids fell into those 8. QwenPaw,
  ZCode, Qwen Code and AstrBot were all #65a30d.

Change:
- A row's colour is the agent it answers now (trying), else the agent
  whose request is on its wire (flying), else the request it answered.
  It is cleared when the row is off. Folds and groups copy it through
  tint(), which clears too. A ps-out wire clears when its trip ends.
- One PALETTE of 12 quiet colours, same lightness and chroma around
  the wheel, none near --red. HUES is a maker's place in it. hueOf
  gives each agent the first colour from its place that no other
  agent has had, and keeps it while the page is open. hues() keeps
  the agents shown together apart once more than 12 have come.

Tests (red on the old client.js):
- routing-reused-row-hue: Codex then ZCode on reused rows. Lit and
  flows colours are each agent's own, and off wires carry no colour.
- routing-agents-apart: four agents on screen at least 20 degrees
  apart in OKLCH hue, and the same colours after a fifth request.
- Both run in Chromium and WebKit, in every language, at 1100 and
  420/390 widths.
- routing-agent-hue-not-red now reads PALETTE.

Broken by hand:
- Without the removeProperty, routing-reused-row-hue is red.
- With by = r.agent, it is red.

Run (all on mote, macOS 27):
- The whole GUI suite, Chromium and WebKit, at concurrency 6, at base
  b2145eac1: 17298 tests, 336 red in 57 files. No red is in a hue
  test.
- The 57 red files run again at a6217e83d, with A (plus every
  routing-* file) and without it. Each red file is red on main too,
  with three exceptions:
  - gateway-key-models webkit en (#4616) was green 3 of 3 alone on A.
  - routing-rules-line webkit 1100 was red on main as well, run
    alone (#4560, #4585).
  - group-found-skip and images-codex-one were red on main only.
- balance-fix (#4682, #4683) and agent-panel-name-width (#4203) are
  red on macOS too, in both engines. Noted on those issues.
- At the pushed tree, every routing-* GUI file, both engines: 2105
  ok, 29 red. All 29 are in files filed red on main: rule-remove,
  rule-drag, rules-line, row-swap, steady (#4585), many-keys
  (#4082), order-unknown (#4627), steps-cap (#4628), story-shrinks
  (#4629). The three hue tests are green.
- go test -timeout 45m ./internal/gui at the pushed tree: two reds,
  both red on origin/main too.
  - TestSettingsSaveKeepsWhatItDoesNotSend: BusyLoad (#4739).
  - TestMainWindowCorners/macOS_26_SDK (#3949).

Not tried:
- The real Linux app (WebKitGTK); only Playwright's WebKit.
- The hues() pass with more than 12 agents; no test covers it, and
  removing it leaves the tests green.
2026-11-01 14:40:57 +08:00
..