Files
magpie/internal/gui
yetone 618bfc1a95 kimi: pick Kimi Code's subagent pool and its effort (XiaoLing_Arisa on X)
XiaoLing_Arisa asked on X for Kimi Code's subagent pool (子代理池) on the
Agents page: which models its subagents may run on, and how hard they
think. Kimi Code 2.x keeps them in config.toml's [secondary_model]:
default_model (the legacy `model` stands for it), the pool
[secondary_model.models] ("alias" = "when to use it") and default_effort.

- internal/agent/kimi_secondary.go: three fields, subagent_model,
  subagent_pool and subagent_effort, written the way Kimi Code takes
  them. Its validator refuses a pool that lacks the default, a name with
  no [models."…"] table, and an effort a pool model can't take, so a
  default goes into the pool, a pool without the default gets its first,
  and only the levels every pool model takes are offered
  (kimiPoolLevels). A magpie model goes in only while [providers.magpie]
  is there. Keys are set in place; hints, other keys and comments stay.
  Before Sync or Unwire drops a magpie model table, its name leaves the
  section (kimiPruneSecondary). The default goes back to the user's own
  (stashed at kimi:<path>:secondary) or to the pool's first, and an empty
  section goes. The user's own pool of their own models is never touched.
  kimi-cli (legacy) has no such section. A stopped WSL distro shows none
  of the three, since each reads the config (#3896).
- GUI: the three fields form one Subagents line in the opened row: the
  model, then the effort (disabled until a model is set), then a
  multi-pick pool menu that stays open between ticks. The model's tick
  can't be removed. The picker's note says an unset model runs each
  subagent on the lead's model. The line is drawn by kimisub.js, which
  Details imports before its first slide so the sheet measures it.
- Size budgets +457 (reason in core_budget_test.go). Translations in
  zh, zh-TW, ja and de. kimisub.js is added to old-webkit's list of
  scripts loaded on demand. The Kimi bullet in agent-wiring.md is
  updated.

Run at this tree on mica (mica-run):
- go test -tags nogui -count=1 ./internal/agent ./internal/gui: ok,
  including TestKimiSubagentPool*, TestWSLColdPlaceOpensNothing and
  TestCoreScriptBudget. An earlier run of these packages found the cold
  read and the budget overrun; both are fixed here.
- go vet ./... on darwin, GOOS=linux go vet -tags nogui ./... and
  GOOS=windows go vet ./...: ok. go build: ok. gofmt -l .: empty.
- GUI: kimi-subagent-pool passes 20 of 20 (Chromium and WebKit, 5
  languages, 1100 and 560px). kimi-thinking passes. agent-details-ready,
  old-webkit and i18n-keys have 35 reds, and origin/main ff88ec264 has
  the same 35, all filed: #6373, #6369 (agent-details-ready), #6030,
  #5919 (old-webkit), #6877 (i18n-keys).
- Broken by hand: with Details not waiting for kimisub.js,
  kimi-subagent-pool goes 10 of 10 red in Chromium ("the Subagents line
  is there when Details first draws").
- Real Kimi Code 2.6.2 (npm) in a sandbox HOME with a fake SSE server:
  the pool and effort written here are read and used. A pool naming a
  model with no table is refused when a subagent starts. A bad effort is
  not refused at runtime, but magpie refuses it anyway, as the validator
  does.

Not run or tried:
- The full go test ./... and the full GUI suite: mica and mote were both
  past their load limits with other sessions' suites. Only the packages
  and GUI files above were run.
- A real Moonshot account. The subagent's "timed out" in the sandbox run
  came from the fake server.
2026-11-17 14:30:55 +08:00
..
…
…
…