Files
magpie/internal/gui
yetone 738ede4a70 agents: Speed beside Model and Effort, with what decides it (Tengs999 on X)
An agent whose model has a fast mode now shows Speed next to Model and
Effort: in the window's Details and in the tray panel's opened row. It
reads Usual, Fast (one bolt) or Ultrafast (two), and its menu (the app's
openProtoMenu, never a native select) offers Default, Fast and, where the
model has it, Ultrafast. It sets the very pick the model's bolt in the
picker sets: POST /api/agent-fast {for, ref, fast, ultra}; no new state.
A refused post puts the old pick back.

What decides the speed is said as the gateway decides it (speedNow): the
agent's own pick, else the model's own tier (ModelTiers) -> "Fast · model
setting", else for Codex its service tier in Settings -> "Fast · Codex
setting", or "As Codex asks" when that tier is unset. The tooltip says
it in a sentence, and Default's note in the menu says what Default gives.
Words in en, zh, zh-TW, ja and de.

speedNow and speedField live in agentspeed.js, imported when such a row
draws, and before a fast model's Details first slides open so it measures
the line. What is left in app.js (two helpers and three call sites) is
499 bytes; both script budgets go up by that, with the reason written.

Run (mote/mica, at this head):
- internal/gui/tests/agent-speed.test.cjs: Chromium and WebKit, en zh
  zh-TW ja de, window 1100px and panel 440px, all green. Broken by hand:
  dropping the model-tier line in speedNow turns it red ("Fast · model
  setting" expected, "Usual" actual); the panel's lazy line not taking a
  .field's place was found by it (0 Speed fields) and fixed.
- go test ./internal/gui/: ok (TestCoreScriptBudget included). gofmt -l
  clean.
- GUI files that reach the agent rows and the guards (agent-menu-label,
  fast-pick, fast-ultra, desktop-tiers, i18n-keys, kimi-subagent-pool and
  more) at this change and at origin/main 074614077, and
  agent-details-ready and old-webkit again at this head and origin/main
  7c3e68908 (the same tests red with the same numbers, e.g. 823.98 ->
  903.92): the same reds on both, each filed: agent-details-ready
  #6373/#6369, agent-menu-label (WebKit) #6371, aside-native #6212,
  codex-memories-settings #6372, desktop-tiers #6475, fast-pick/fast-ultra
  #6201, found-skill-pick-remove #5013/#4097, grip-inset #6293, i18n-keys
  ", with an image" #6877, old-webkit headerpresets.js #6030 and app.css
  :has() #5919.

Not tried: the whole GUI suite and go test ./... (both boxes were busy
with other sessions' suites); the real app, and Linux WebKitGTK.
2026-11-17 18:59:24 +08:00
..
…
…
…