Commit Graph
9 Commits
Author SHA1 Message Date
yetone a0ba8e1f2e grok: each model's context_window follows Long conversations, and one set by hand stays through a sync (uk.jent)
uk.jent (Discord #feedback) reported that magpie writes every Grok Build model's context_window as the model's whole window. They wanted about 300K without editing dozens of models, and they lost hand edits on each sync, because SetTOMLTables replaces the [model."magpie/..."] tables whole.

Grok Build now uses Long conversations, the mechanism Codex and Claude Code already use. grokWindow gives:
- min(window, Compact) when the model or provider has its own threshold;
- otherwise settings.Working(window): 272K by default on longer windows, the typed size, or the whole window with Full context.

What magpie wrote is stashed under grok:<path>:windows, and grokOwnWindow uses it to tell a hand edit apart:
- A value that differs from what magpie last wrote is the user's, and it stays.
- In a config written before the record, a value other than the model's whole window is the user's.
- Disconnect forgets the record.

The agent sheet's Long conversations row now shows for Grok Build (AGENT_PREFS). Its texts, the provider editor's hint, the Context tab's note and `magpie model compact` now name Grok Build, in en/zh/zh-TW/ja/de. setCompact and setAsync now share prefWrite. That dedupe keeps app.js under its budget, which is not raised.

Behaviour change: a Grok Build model whose window is over 272K now gets 272K by default, as Codex does, unless Full context is on.

Run on mote, at this head (c893c2229, rebased on fe05f0a72):
- gofmt -l: 0 files.
- go vet ./internal/{agent,gui,cli,settings}: darwin, plus GOOS=linux and GOOS=windows with -tags nogui. All ok.
- go test -tags nogui -timeout 45m ./internal/agent ./internal/gui ./internal/cli ./internal/settings: all ok.
- GUI agent-prefs, compact-at, compact-one-value, context-tune, context-window, gateway-mode, i18n-keys, settings-general: 202/202 in Chromium and WebKit. The new cases cover Grok's sheet in five languages at 1100 and 440, and in the 360 panel.
- At the pre-rebase head, 104 GUI files the change can reach: 1590/1622.
  - 29 of the reds were browserType.launch timeouts at load 85. Run again one at a time, every one passed, and so did usage-fold.
  - context-map's WebKit 420px "two tiles overlap" is red on origin/main fe05f0a72 too, run alone. It is recorded on #3488.

Broken by hand:
- With the keep logic removed, TestGrokKeepsAWindowSetByHand and TestGrokKeepsAWindowSetBeforeTheRecord go red ("pro 1000000 (set by hand to 300000)").
- With grokWindow returning the whole window, TestGrokKeepsAWindowSetBeforeTheRecord and TestGrokWindowFollowsLongConversations go red ("compact at 300K: pro 1000000").

Not tried:
- A real Grok binary reading the written config. Grok 1.0.67's own help documents model.<id>.context_window as driving auto-compact.
- Linux/WSL and Windows runs. Only cross-OS vet was run.
- Grok App still writes the whole window, and neither agent writes the context_windows choice list: #4117.
2026-10-29 04:43:22 +08:00
yetoneandchiperman 00d44d6928 routing: Codex's composer predictions story says their model is picked in Codex's row on the Agents page (#3425, chiperman)
Routing's Kind description for composer_predictions still sent users to
Settings › General › Codex composer predictions. That setting moved to
Codex's row on the Agents page. chiperman's commit (5e372e168) fixed the
Routing text in five languages. It is ported here with their zh, zh-TW
and ja; the de wording is mine.

Grepping for other texts that still name the old Settings place for a
setting that moved into an agent's row found four more, now fixed:
- app.js compactField, the provider editor's "Compact at": empty follows
  Long conversations, now "in their settings on the Agents page (else in
  Settings)". The field's text is one string now, and the header comment
  no longer repeats it, so app.js stays inside its budget (unchanged).
- gateway sealedWayOut: "Codex subagents on any model" is in Codex's
  settings on magpie's Agents page, not "magpie's Settings".
- gateway codex_titles: "Codex composer predictions are off" and "Codex
  titles are off" answers name the same place.
- cli `magpie model` help text.
Each gateway message has a test that fails on the old wording, and the
GUI files assert the new place and the absence of the old one.

Run on origin/main 46c418832 with this commit and #3429's after it (the
pushed pair; the Go and GUI runs below were at the pair's head):
- gofmt -l: nothing. go vet (darwin) of gui/gateway/cli,
  GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: clean.
- go test -count=1 -timeout 45m ./internal/gui/ ./internal/cli/
  ./internal/gateway/: ok (gui 133s, cli 39s, gateway 405s)
- GUI, both engines: compact-at, routing-kind, mobile-web, sidebar,
  refresh-page, gateway-port: 64/76; the 12 reds are sidebar's page list
  missing Insights › Masking, red on origin/main too (#3498). With that
  list given "masking" for the run only, sidebar is 18/18.
- Broken by hand: the old app.js/i18n text makes compact-at fail on
  "says where Long conversations is"; the old Routing text makes
  routing-kind fail.
- Whole GUI suite (both engines, -concurrency 4) at the pre-rebase pair
  c28576084: 12,519 tests, 12,350 pass, 169 fail in 31 files. Each red
  file was run alone at that head and at origin/main 641b1217f. All are
  red on main too or pass alone, and each has an issue: the 30 files of
  #3527's list (#3497, #3498, #3488, #3523, #2648, #3479, #3099, #3402,
  #3404, #3500, #3408-#3415, #3094, #2174, #3091, #3104, #3406),
  gateway-caller-keys (#2572, #1671), plugin-github (red alone on main,
  #3218), mobile-web (passes against the commit's base; after the rebase
  it passes at this head), codex-resets-used (#3535),
  routing-busy-frames (#3557) and zhipu-team (#3558). signin-port-blocked's
  11 were ENOSPC from a full disk mid-run; 40/40 alone.
- Not tried: a real Codex session hitting the sealed-task or titles
  message; the text was read in the tests only.

Co-authored-by: chiperman <34889778+chiperman@users.noreply.github.com>
2026-10-25 12:06:13 +08:00
yetone 4a3e07f1cf model: magpie model spec sets a model's window, output, vision and levels at once
Dani Ariyanto on Discord (#feedback, 10-24): a custom provider's models
(kenari/*:free) had no window, reply limit, vision or reasoning known,
and there was no one place to say them.

  magpie model spec <provider/model>                 what it has, and whose each value is
  magpie model spec <provider/model> [--context <n>] [--output <n>] [--vision on|off|auto] [--reasoning <levels>|off|auto]
  magpie model spec '<provider>/*' --context <n> --output <n>
  magpie model spec <provider/model> --reset
  magpie model specs

It writes the stores magpie model context/output/images/efforts write
(providers.json contexts; settings.json modelOutputs, modelImages,
modelEfforts, modelReasonless), so every reader that went by those goes
by a spec: entryFor/EntryOf/Served, /v1/models, max_tokens, the GUI's
/api/providers badges and chips, and the agents' model lists. Every
part is checked before anything is written; a refused command writes
nothing. Agents are told once.

Readers that bypassed the stores and now honour them:
- provider.Efforts returns the kept levels, so the gateway fits a
  request to them (fitEffort): xhigh asked of a model kept to low-high
  goes as high. This reverses #92 (47e12df41), which narrowed only the
  lists handed out; docs/subsystems/gateway-routing.md says so.
- entryFor: levels given a model with none known make it Reasoning.
- gateway AutoVision picks by the user's ModelImages (seesAt).
- GUI gateway client: a reasonless model offers no level chips.

Run at this tree (base a93190ae1):
- go test -count=1 -timeout 45m ./internal/{provider,cli,gui,gateway,
  settings,tui,agent,catalog}: all ok (gateway 505s, agent 360s).
- GUI: gateway-*.test.cjs, model-reasonless, plugin-gateway, i18n-keys
  (25 files, both engines, the new file at 1100 and 420 in en, zh,
  zh-TW, ja, de): 225/225 pass. app.js untouched.
- gofmt -l empty; go vet darwin, linux -tags nogui, windows clean.
- Sandbox HOME, built binary, `magpie web` on 47821/47820 and a fake
  Chat vendor on 47811: before, kenari/glm-5:free had no window or
  levels; after spec 128k/16k/on/low-high, /v1/models said 128000,
  16000, image input, [low medium high]; max_tokens 100000 went as
  16000, xhigh as high, low as low; qwen-x with --reasoning off was
  sent no reasoning field; /api/providers had context 128000, output
  16000, images/imageSet, kept [low medium high], reasonless for qwen-x.
  A models.dev sync during the run (GLM-5 202752/131072) didn't move
  the spec; after --reset the vendor's values came back. Bad values,
  an unknown flag and --help wrote nothing (files hashed).

Rebased onto a6a3dbde8 (the ZCode mover's min, one line): at the
pushed head 5af093d8b's tree, ./internal/provider and ./internal/cli
-timeout 45m ok, and the spec tests in gateway and gui ok.

Broken by hand, each went red: AutoVision on raw sees; Efforts on the
full list; the Reasoning line removed; output, vision or context not
written; ParseLevels skipped; agents told twice; --context 0 taken;
help printing modelUsage; old client.js; the GUI named() image and
reasonless branches.

Not tried / not changed: no full go test ./... (another session's
full GUI suite was running). Codex's ChatGPT-model /models pass-through
and the Codex effort dropdown read catalog.Codex(), not a spec. The
TUI shows no spec badges. A Context-tab trace keeps the window it was
recorded with. Pre-existing and the same on origin/main a6a3dbde8: a
GLM-5 relay with no levels known has xhigh sent as high.
2026-10-24 05:31:59 +08:00
yetone ea9454d2d8 usage: count two ids of one model as one, magpie model alias (SlouchyQuill507 on Discord)
A vendor names one model two ways (deepseek-v4.1-flash and deepseek-flash),
and Usage, Usage > Sessions and `magpie usage` showed two rows. Now:

  magpie model alias deepseek-v4.1-flash deepseek-flash
  magpie model alias deepseek-v4.1-flash            (what it is counted as)
  magpie model alias deepseek-v4.1-flash --reset
  magpie model aliases

kept as settings.json "usageAliases" {from: to}. Off until one is written.
Ids match as routing groups match them (provider.sameModel: vendor/ prefix,
case, "_", snapshot date), at every provider; a chain is followed to its
end; an alias to itself, a loop, or a flag as an id is refused. A loop
written into the file by hand counts each model under its own id.

Display only: requests, agents' model lists, /v1/models, routing groups,
Same as and prices never read it. Each call is priced by the id it was
made under and only then counted under the alias; the alias's own price
is never put on the other id's calls, and a merged row is priced only
when every id in it is. Applied in usage summarize/direct (Models
groups), the gateway sessions projection (alias read before
gatewayCache's lock; the cache key hashes usageAliases), and
sessions.List/Get/Find/Stats (read before storeMu/mu, merged into new
slices so the memo is untouched; ModelEffort rows merged too). A failed
settings.json read keeps the last aliases read, and SetUsageAlias refuses
to write over an unreadable file (EditUsageAliases under fileMu). The GUI
settings save carries usageAliases. No GUI control.

Not aliased: the Requests ledger's per-request model and its model
filter, which show each call's own id.

Run (worktree at f4640c0ae, rebased onto 2b4c0664e with no overlap):
- gofmt -l: clean. go vet ./... darwin, GOOS=linux -tags nogui, GOOS=windows: ok.
- go test -count=1 -timeout 45m (sandbox HOME) internal/usage,
  sessions, provider, cli, settings, gui, tui: all ok.
- Real binary in a sandbox HOME: two usage.jsonl calls priced $2 and
  $100 per M: `magpie usage` showed two model rows ($2.00, $100), and
  after `magpie model alias` one row, 2.0M, 2 calls, $102; the session
  row too. alias/aliases/--reset/loop/self output checked by hand.

Broken by hand, each red then restored:
- no alias in summarizeFrom: TestUsageAlias* red
- nil alias into the gateway projection: TestUsageAlias* red
- statsIn without aliasStats / List without aliasSession:
  TestSessionsCountAliasedModelsAsOne red
- merged usage row keeps Priced true: TestAliasStatsLeavesItsInputAlone red
- loop check off / self check by == / last-good read off / flag check off:
  TestUsageAliasRefusesSelfAndLoops, TestUsageAliasUnreadSettings,
  TestModelAliasCmd red
- GUI save drops UsageAliases: TestSettingsSaveKeepsWhatItDoesNotSend red

Not tried: the GUI pages in a browser (no app.js change; the Usage and
Sessions pages read the same rows), the full go test ./... before push,
Windows box.
2026-10-24 02:48:50 +08:00
yetone 357ffac7be usage: a model's Same as prices its calls when no list does (#2344, liuweifeng)
A model a provider serves under its own id (a WorkBuddy kimi-k3-1, a
relay's renamed gpt) had no price unless the user typed one, even when the
user had already told magpie in the editor's "Same as" box which model it
is. Its calls showed no API-price cost in Usage, window holds had no price
to weigh, and `magpie model price` said unpriced.

Now, when neither the user's prices, the provider's list nor models.dev's
maker price covers a model, provider.SamePriceIn takes the maker's list
price of the model it is the same as (settings.ModelSameAs), and the
provider's price rate still applies. A price the user set, or a list that
prices the model, always wins; nothing is inferred without a Same as.
The same fallback is used by priceOf (Usage costs, re-priced when the
ledger is read, so past calls pick it up), usage's apiPricer (window
holds), the model editor's greyed list price, and `magpie model price`,
which names where the price came from. The "Same as" tooltip says so in
en, zh, zh-TW, ja and de.

Run:
- go test -p 1 -tags nogui ./internal/provider ./internal/usage
  ./internal/cli ./internal/gui (focused: TestSameAsPricesAnUnlistedModel,
  TestHoldsPriceTheModelItIsTheSameAs, TestModelEditorShowsTheSameAsPrice,
  TestModelPriceCmdSaysWhereThePriceCameFrom, plus the packages): ok
- GUI (chromium + webkit): provider-same-as, i18n-keys, model-price-edit,
  11/11 pass
- gofmt -l clean; go vet -tags nogui for darwin, linux, windows: clean

Broken by hand, each went red:
- SamePriceIn dropped from priceOf: "kimi-k3-1 ... false; want $0.3"
- usage's apiPricer fallback removed: "wasn't its API price: <nil>"
- the GUI editor branch removed: "list <nil>"
- the CLI source line disabled: TestModelPriceCmd... FAIL
- the zh tooltip left untranslated: provider-same-as.test.cjs 0/2
A prefix-stripping branch passed when removed (MakerPrice already resolves
vendor-prefixed ids like moonshotai/kimi-k3), so it was dropped.

Not tried: a real WorkBuddy account's usage after the change.

Full suite: SUITE_LINE
2026-10-15 23:08:03 +08:00
yetone f074996d93 provider, gateway, gui: a model with none of its levels ticked is sent no reasoning field, on every route and in a routing group (yuexian7)
yuexian7 on Discord: models.dev lists their model as reasoning, and the
vendor answers any reasoning parameter with 422 while the same request
without it works. In a routing group they couldn't set an effort per
model, and the model editor refused to untick the last level ("Keep at
least one level"). The learned refusals (bed306ae, #1062) don't cover
this: they learn a refusal of reasoning *off* and of Gemini levels, and
optionalFields holds thinking/enable_thinking, not reasoning_effort.

- settings.ModelReasonless, set by provider.SetModelReasonless (the
  provider editor's Names & levels with every level unticked, saved as
  modelPrefs {reasonless: true}; `magpie model efforts <ref> off`).
  Ticking levels again or Restore default clears it (setModelEfforts);
  setting it drops the model's kept levels.
- entryFor and Efforts/Thinks/Levelless: the model offers no levels and
  is Quiet, so agents are given none for it.
- Gateway: the candidate loop strips the body with withoutAnyReasoning
  in the agent's protocol (Chat/Responses reasoning_effort, reasoning,
  thinking, enable_thinking, include's reasoning.encrypted_content;
  Anthropic thinking of any type and output_config.effort; Gemini
  thinkingConfig). The Anthropic relay doesn't add
  thinking:{type:disabled} for it, and forwardTranslated clears Effort,
  ThinkOff and Thinking for its other callers (continuation, search).
- A routing group with it as a member keeps the other members' levels
  (it `continue`s like a member whose levels are unknown, #597), and the
  member that reasons is still sent the effort asked.
- GUI: none ticked shows "No reasoning field sent" beside the levels, in
  zh, zh-TW, ja and de too; a model with one known level now shows its
  picker so it can be unticked. A model whose levels aren't known
  (m.given) keeps none ticked meaning no levels known.

Run (worktree on origin/main 82f3befd2, sandbox HOME, private GOCACHE):
gofmt -l clean; with set -o pipefail go vet ./..., GOOS=linux go vet
-tags nogui ./..., GOOS=windows go vet ./... all clean; node --check
app.js. go test -count=1 ./internal/provider ./internal/gateway
./internal/settings ./internal/cli: ok. ./internal/gui: ok except
TestMainWindowCorners/macOS_15_SDK killed at its 40s deadline under
load (AppKit window measurement, untouched here; #1936, noted there).
The run caught TestSettingsSaveKeepsWhatItDoesNotSend (ModelReasonless
added to it) and the CLI usage alignment tests (fixed).
New tests and what breaking the change does: TestReasonlessModelSentNoReasoning
(Chat, Chat+enable_thinking, Responses with include, Anthropic->Chat
translated; by name and through group/mix) and TestReasonlessAnthropicRelay
fail with gateway.go/quiet.go reverted; TestGroupReasonlessMemberKeepsLevels
fails with group.go's reasonless branch disabled; TestModelReasonless
needs the new API. model-reasonless.test.cjs in chromium and webkit, at
1100 and 420, in en, zh, zh-TW, ja, de: 20/20; on the old assets all
fail. Related GUI tests 418/418 (one model-copy-id failure on a first
run under load, passed alone; #2066).
Not tried against the reporter's real vendor: the 422 is taken from
their report.
2026-10-14 09:38:12 +08:00
yetone f71155591e provider: a provider at a vendor's own endpoint is priced from that endpoint's models.dev catalog (#2052, mengyianx)
A custom provider added by its address alone, with no catalog named, was
priced only by the model's maker. Qwen3.8-27B, whose maker (Alibaba) sells
no such model on any of its seven models.dev catalogs, read "no price is
known for it" even at AMD's own endpoint, where models.dev's amd lists it
at $0, a price.

- catalog: models.dev's provider "api" is read; AtEndpoint names the
  catalogs at a base URL (trailing slash and case ignored).
- provider: EndpointCatalog is the one catalog models.dev lists at one of
  a key's provider's endpoints (an Anthropic base, kept as its root, also
  with /v1), used by ListPrice when the provider has no catalog of its
  own. Never for a subscription's account, never when two catalogs share
  the address (minimax / minimax-coding-plan), never a plan's catalog
  (an id with -plan, or membershipCatalogs), whose $0 is the membership's.
  A user's price and a named catalog still come first; a relay's endpoint
  matches nothing and its model stays unpriced (no reseller guess).
- cli: `magpie model price p/m` with no price gives the two commands that
  set one (p/m and */m); a price from an endpoint's catalog names it.
- gui: the Catalog field's hint says it also sets list prices (en, zh,
  zh-TW, ja, de).
- docs: reference.md's "What a model costs", providers-accounts.md row.

What was run:
- Reporter's exact case, built binary (go build -tags nogui), sandbox
  HOME with a copy of this machine's models.dev cache (2026-10-14, same
  amd entry as the report), providers 001 (relay), 002 and amd at
  https://developer.amd.com.cn/radeon/api/v1:
    001/gpt-5.5      $5/$30, tiers, as before
    001/Qwen3.8-27B  no price, now with the two commands to set one
    002/Qwen3.8-27B  $0/$0, "what models.dev's amd lists at its endpoint"
    amd/Qwen3.8-27B  $0/$0
  The two suggested commands were run and took effect.
- TestEndpointCatalogPrices / TestEndpointCatalogOnlyItsOwn, fixture
  testdata/endpoint_catalog.json trimmed from the real models.dev cache.
  Break checks, each FAILs with the case named:
    ListPrice not using EndpointCatalog -> 002/amd/001 at AMD unpriced,
      EffectivePrice(002, Qwen3.8-27B) unpriced
    plan exclusion removed -> "a plan's endpoint: EndpointCatalog() =
      alibaba-coding-plan", qwen3.5-plus at $0 instead of $0.4/$2.4
    single-match rule removed -> "an endpoint two catalogs share:
      EndpointCatalog() = minimax"
    Account check removed -> "a subscription's account ... = amd"
    Anthropic /v1 match removed -> thinkingmachines unmatched
- GUI: internal/gui/tests/catalog-hint.test.cjs, chromium and webkit, en
  zh zh-TW ja de, widths 1100 and 420: 20/20 pass, plus i18n-keys; with
  the old app.js/i18n.js it fails "one hint names list prices".
- go test -tags nogui -timeout 45m ./internal/catalog ./internal/provider
  ./internal/cli: ok (provider 244s, cli 125s, catalog 3s). gofmt -l
  clean; go vet (darwin), GOOS=linux go vet -tags nogui and GOOS=windows
  go vet -tags nogui on those packages: clean.
2026-10-14 07:51:41 +08:00
yetone 841af36bfc gateway: models the user disabled are refused on every route, and leave every list (#1867)
oxsean asked for one place to turn a model (claude-fable-5) off for good:
not reached by a direct request, an old session, a routing group member,
a fallback, a sub-agent, count_tokens or a decision model.

What changed:
- settings.DisabledModels: patterns, an exact id or a glob (* any run, /
  included; ? one), matched ignoring case against provider/model, the
  bare id and its last segment (provider/disabled.go). Empty by default,
  so nothing changes for anyone who doesn't set it.
- Lists: buildEntries (entriesOff) leaves a disabled model out of the
  catalog, so /v1/models, agents' model files and pickers, Codex's list
  and every group go without it; membersIn skips it as a member, Deciders
  as a decision model; codexModels drops Codex's own disabled slugs and
  codexListTag changes so Codex refetches.
- Requests (gateway/disabled.go): 403 "model <id> is disabled in magpie"
  in each API's error shape, at #882's choke points: serve (idOff),
  perKeyBarred (no candidate: group next member, provider Fallback),
  count_tokens and Gemini :countTokens, serveSystemOne,
  serveDecisionGroup and postDecide, draw/video/embeddings, and
  codexBackend for Codex's own bare models. A group with a member left
  goes on without it; one with none left is refused naming them. A bare
  id the catalog no longer has is refused as disabled, not 404. A Codex
  sub-agent pick onto a disabled model stays on its lead's model.
- An unreadable settings.json is never "none disabled": the list read
  last stays; with none read, every request is refused; nothing is
  written over the file.
- CLI: magpie model disable <model|glob>..., enable ..., disabled
  (list-disabled).
- GUI: Settings > Models > Disabled models: each pattern with the models
  it matches now and Enable; Disable... opens the model picker, which
  also takes a typed glob. Says only requests through magpie are covered.
  POST /api/settings/disabled-models; POST /api/settings keeps the list.
  Strings in zh, zh-TW, ja, de.
- docs/subsystems/gateway-routing.md: Disabled models section.

What was run (worktree at origin/main 091593f7d, private GOCACHE, temp HOME):
- gofmt -l clean; go vet on darwin (touched pkgs), GOOS=linux -tags nogui
  ./..., GOOS=windows ./... clean; go build ./...
- go test -count=1 ./internal/provider ./internal/gateway ./internal/cli
  ./internal/gui ./internal/settings: all ok (gui after adding the field to
  TestSettingsSaveKeepsWhatItDoesNotSend's fixture, which it asked for).
- node --test internal/gui/tests/disabled-models.test.cjs: 16/16 (chromium
  + webkit, en/zh/ja/de, 1100/420); neighbouring Settings > Models tests
  and i18n-keys: 131/131.
- Broken by hand, each turned TestDisabled* red: serve's idOff (404
  instead of 403), perKeyBarred's filter (fallback reached spare), the
  catalog filter (/v1/models and Codex list), countOff (count_tokens 200),
  postDecide's check (decision call went out).
- Not tried with a real vendor account or a real agent.

Ref #1867
2026-10-13 05:34:13 +08:00
yetone 23e764d0e0 cli: magpie's commands move from the root into internal/cli; the root keeps only main.go
The root held 89 .go files (30 commands, 59 tests). They move as they are
to internal/cli (package cli), with git mv so history follows them. The
only code change is main() becoming cli.Main(version): the root's new
main.go keeps `var version` in package main, so -ldflags "-X
main.version=…" in the Makefile, the Dockerfile and magpie-releases, and
every workflow, work unchanged. go-winres's rsrc_windows_*.syso still land
next to package main in the root.

Tests that read testdata by a root-relative path now go up one level
(../plugin/testdata/fake, ../sessions/testdata). Five subsystem doc links
point at internal/cli/.

Run:
- go build ./..., gofmt -l, go vet on darwin, linux and windows (nogui)
- builds with tags production, dev, "production nogui"; windows
  -H windowsgui; linux CGO_ENABLED=0
- make release-cli TARGETS="darwin/arm64 linux/amd64 windows/amd64
  android/arm64" VERSION=9.9.9-tidy: all four built, binary prints
  "magpie 9.9.9-tidy"
- docker build --build-arg VERSION=7.7.7-tidy: container prints
  "magpie 7.7.7-tidy"
- go test ./internal/cli (default and nogui): 152 tests, the same count
  as the root on main
- go test ./...: all packages pass (agent, gateway, library, provider
  timed out at 10m under other sessions' load and passed rerun alone
  with -timeout 40m; none of them changed)
- the built binary in a sandbox HOME: version, help, ls, providers,
  claude, and an unknown command's error
2026-10-12 20:40:22 +08:00