Commit Graph
2 Commits
Author SHA1 Message Date
yetone 250bdd5c4f gui: Names in agents' lists names the connected agents it changes nothing in (love1sbug on X)
love1sbug on X found Names in agents' lists seemed to do nothing. Claude
Code and Qwen Code follow it now; a sweep of every agent in a sandbox
HOME (each set to one relay model, the setting switched, the files
compared) found the rest that follow it, and those that can't:

- handed the models' ids alone, their formats having no name for one:
  Goose, jcode, Hermes Agent, Reasonix Studio, AtomCode, fx, Antigravity
  CLI, AstrBot, Mister Morph;
- with no list of magpie's models: Gemini CLI, Snow CLI;
- reading the gateway's /v1/models themselves, whose display_name is the
  name alone on purpose (a remote magpie relies on it): Empryo, Cursor
  Private Inference.

Those carry agent.NoNames (copied to an agent in WSL), sent to the GUI
as noNames. Where the setting is offered (Settings › Provider in model
names, Routing's Names in agents' lists, a provider's Names & levels) a
line names the connected ones: "Changes nothing in Goose, Hermes Agent:
magpie's names don't reach their model lists", in every language. With
none connected nothing is said, so the Settings row keeps no line under
its name (1ooogle on X, model-suffix-own's check). A page drawn before
the agents are read (Routing, an open provider editor) says it once they
are (redrawNoNames, beside redrawSuffix).

name-suffix-no-names.test.cjs checks the three places in chromium and
webkit, en/zh/zh-TW/ja/de, at 900px and 390px with no sideways scroll,
that an agent not connected or following it isn't named, that none
says nothing, and, with /api/state answered 1.5s late, that all three
still say it. On the old assets 12 of the first 13 chromium tests fail;
the late case failed on this commit's first version too (found when a
loaded run failed the editor's case; reproduced with the injected delay).

Run: that test and i18n-keys, gateway-mode, model-suffix-own,
name-suffix-remote, name-suffix-saved, name-suffix-where-named,
settings-general/groups/search/sections in both engines; go
test -tags nogui ./internal/agent ./internal/gui ./internal/provider ./internal/gateway (before the rebase);
gofmt -l; go vet darwin/linux/windows. With 11 files at once at load
80-120, webkit failed once on this test's "no page errors" check (ja
900px, the late case) beside settings-sections' "Settings in parts";
not reproduced in 3 runs since (10 files, then 8 copies at once), and
the errors weren't kept.
Not tried: the GUI against a real magpie with Goose connected.
2026-10-13 14:06:24 +08:00
yetone 9c11abbd00 agent: jcode is an agent magpie connects: a magpie profile with magpie's models, jcode started on the one picked (wani on Discord)
wani asked on Discord for jcode (1jehuang/jcode, a coding agent in Rust)
as an agent magpie connects. There was no earlier request in issues or
history.

What changed:
- internal/agent/jcode.go: a new agent for jcode's config.toml in
  $JCODE_HOME, else ~/.jcode (jcode-storage's jcode_dir). Detected by the
  file, the folder, or `jcode` on PATH.
  - Connecting adds a named profile, [providers.magpie], with the keys
    `jcode provider add` writes: type "openai-compatible", the gateway's
    /v1, an inline api_key naming jcode (magpie-jcode; jcode's requests
    carry nothing else that tells it apart) and requires_api_key = true.
    Without that key, jcode sends no key to a loopback base URL.
  - Its models list has one entry per model of magpie's: context_window
    (128000 when magpie doesn't know it; jcode would assume 200k), input
    text/image, and reasoning = true for a model with effort levels, so
    jcode's /effort offers them.
  - It sets [provider] default_provider = "magpie" and default_model, the
    model picked. What was there is stashed, and Disconnect puts it back.
  - Picking a model of jcode's own while it is on magpie takes magpie
    out: the profile goes and the user's provider comes back with that
    model.
  - Each key is set alone, so the user's other keys and tables stay, as
    do their own keys in magpie's profile (headers, extra_body) and a
    reasoning_effort they set on one of its models while the model has
    that level.
  - jcode writes a profile's models as [[providers.magpie.models]]
    tables when it rewrites the file itself (Config::save,
    to_string_pretty). Those are replaced by the one list.
  - A sync with nothing to change doesn't write.
  - Disconnect drops the profile whole, sub-tables included.
  - Check says when the profile is gone while jcode still starts on it,
    or when its base_url or key is off.
  - While jcode runs, the notice says to restart open jcode sessions,
    since it reads the file when it starts. The notice is a newNotice
    template, translated in i18n.js (zh-CN, zh-TW, ja, de) and listed in
    NOTICES, as TestEveryNoticeIsTranslated asks.
- agents.go, agentenv.go: registers it; JCODE_HOME joins the agent env.
- icons/jcode.svg: jcode's halftone mark (jcode.sh/favicon.svg) as a
  mask icon, every other dot of its lattice.
- docs/reference.md, docs/subsystems/agent-wiring.md, README.md,
  README.zh-CN.md: jcode's row and its place in the agent list.
- WSL isn't covered: jcodeAt reads the place's home and JCODE_HOME, but
  it isn't added to the WSL agent list (another session has wsl.go open).

What was run:
- go test -tags nogui ./internal/agent -run '^TestJcode'. The fixture is
  the bytes jcode 0.94.0 wrote for `jcode provider add`. The tests went
  red when, by hand, I:
  - made a no-op sync write;
  - dropped the user's reasoning_effort;
  - skipped the stash, so Disconnect wasn't byte-identical;
  - left jcode's [[providers.magpie.models]] tables in, which makes
    invalid TOML;
  - dropped requires_api_key.
- Real use:
  - jcode v0.94.0 (release binary, sha256 checked) ran under a sandbox
    HOME with JCODE_HOME set and JCODE_NO_TELEMETRY=1. Its config.toml
    was the one jcode wrote for its own "probe" profile.
  - A sandbox magpie (MAGPIE_ADDR 127.0.0.1:3671) with a fake OpenAI
    upstream on 3672 ran `magpie jcode magpie/fake/org/echo-1`, a model id
    with two slashes.
  - `jcode run 'Say hello in one word.'` answered with the upstream's
    reply, streamed. The upstream saw model org/echo-1, and usage.jsonl
    recorded the turn under agent "jcode".
  - `jcode provider add two …` while connected appended its own profile
    and left magpie's as it was.
  - `magpie jcode default` then gave back the file jcode wrote,
    byte-identical, with jcode's new [providers.two] kept.
- The icon rendered as a mask in Chromium and WebKit. The only GUI
  change is the notice's translations; TestEveryNoticeIsTranslated and
  internal/gui pass, and node --check accepts i18n.js.
- gofmt -l; go vet (darwin, GOOS=linux, GOOS=windows) on internal/agent
  and internal/agentenv; go test -tags nogui ./internal/agent
  ./internal/agentenv ./internal/gui; go test -tags nogui ./... under a
  temp HOME (load ~80): every package passed. After rebasing on
  origin/main, internal/agent and internal/agentenv were run again,
  along with internal/gui, gofmt and the linux/windows vet.
2026-10-11 04:33:53 +08:00