Files
magpie/internal/gui/assets/icons/jcode.svg
T
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

2 lines
12 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><title>jcode</title><g fill="#000"><circle cx="358" cy="30" r="5.1"/><circle cx="374" cy="46" r="12.3"/><circle cx="390" cy="62" r="12.5"/><circle cx="406" cy="78" r="12.3"/><circle cx="422" cy="94" r="12.1"/><circle cx="438" cy="110" r="11.8"/><circle cx="454" cy="126" r="11.4"/><circle cx="470" cy="142" r="8.5"/><circle cx="309" cy="14" r="9.3"/><circle cx="325" cy="30" r="13.2"/><circle cx="342" cy="46" r="12.4"/><circle cx="358" cy="62" r="11.7"/><circle cx="374" cy="78" r="11.2"/><circle cx="390" cy="94" r="11"/><circle cx="406" cy="110" r="11.1"/><circle cx="422" cy="126" r="11.3"/><circle cx="438" cy="142" r="11.6"/><circle cx="454" cy="158" r="11.7"/><circle cx="470" cy="174" r="11.5"/><circle cx="486" cy="190" r="10.3"/><circle cx="277" cy="14" r="13.8"/><circle cx="293" cy="30" r="12.9"/><circle cx="309" cy="46" r="11.7"/><circle cx="325" cy="62" r="10.6"/><circle cx="342" cy="78" r="9.7"/><circle cx="358" cy="94" r="9.2"/><circle cx="374" cy="110" r="9"/><circle cx="390" cy="126" r="9.3"/><circle cx="406" cy="142" r="9.9"/><circle cx="422" cy="158" r="10.7"/><circle cx="438" cy="174" r="11.4"/><circle cx="454" cy="190" r="11.8"/><circle cx="470" cy="206" r="11.8"/><circle cx="486" cy="222" r="11"/><circle cx="502" cy="238" r="7.1"/><circle cx="245" cy="14" r="13.9"/><circle cx="261" cy="30" r="12.8"/><circle cx="277" cy="46" r="11.4"/><circle cx="293" cy="62" r="10"/><circle cx="309" cy="78" r="8.5"/><circle cx="325" cy="94" r="7.3"/><circle cx="342" cy="110" r="6.6"/><circle cx="358" cy="126" r="6.4"/><circle cx="374" cy="142" r="7"/><circle cx="390" cy="158" r="8.1"/><circle cx="406" cy="174" r="9.5"/><circle cx="422" cy="190" r="10.7"/><circle cx="438" cy="206" r="11.7"/><circle cx="454" cy="222" r="12.2"/><circle cx="470" cy="238" r="12.1"/><circle cx="486" cy="254" r="11.2"/><circle cx="502" cy="270" r="8"/><circle cx="213" cy="14" r="14"/><circle cx="229" cy="30" r="13.1"/><circle cx="245" cy="46" r="11.7"/><circle cx="261" cy="62" r="10"/><circle cx="277" cy="78" r="8.1"/><circle cx="293" cy="94" r="6.2"/><circle cx="309" cy="110" r="4.5"/><circle cx="325" cy="126" r="3.3"/><circle cx="342" cy="142" r="3.1"/><circle cx="358" cy="158" r="4"/><circle cx="374" cy="174" r="5.8"/><circle cx="390" cy="190" r="7.9"/><circle cx="406" cy="206" r="9.9"/><circle cx="422" cy="222" r="11.5"/><circle cx="438" cy="238" r="12.4"/><circle cx="454" cy="254" r="12.7"/><circle cx="470" cy="270" r="12.2"/><circle cx="486" cy="286" r="10.9"/><circle cx="502" cy="302" r="6.2"/><circle cx="181" cy="14" r="11.2"/><circle cx="197" cy="30" r="13.6"/><circle cx="213" cy="46" r="12.3"/><circle cx="229" cy="62" r="10.7"/><circle cx="245" cy="78" r="8.8"/><circle cx="261" cy="94" r="6.5"/><circle cx="277" cy="110" r="3.8"/><circle cx="358" cy="190" r="2.4"/><circle cx="374" cy="206" r="5.8"/><circle cx="390" cy="222" r="8.9"/><circle cx="406" cy="238" r="11.1"/><circle cx="422" cy="254" r="12.5"/><circle cx="438" cy="270" r="13.1"/><circle cx="454" cy="286" r="12.9"/><circle cx="470" cy="302" r="11.9"/><circle cx="486" cy="318" r="9.9"/><circle cx="165" cy="30" r="13.9"/><circle cx="181" cy="46" r="13.1"/><circle cx="197" cy="62" r="11.7"/><circle cx="213" cy="78" r="10"/><circle cx="229" cy="94" r="7.9"/><circle cx="245" cy="110" r="5.1"/><circle cx="358" cy="222" r="2.1"/><circle cx="374" cy="238" r="7.5"/><circle cx="390" cy="254" r="10.8"/><circle cx="406" cy="270" r="12.7"/><circle cx="422" cy="286" r="13.4"/><circle cx="438" cy="302" r="13.4"/><circle cx="454" cy="318" r="12.6"/><circle cx="470" cy="334" r="11"/><circle cx="486" cy="351" r="7.6"/><circle cx="133" cy="30" r="7.6"/><circle cx="149" cy="46" r="13.7"/><circle cx="165" cy="62" r="12.8"/><circle cx="181" cy="78" r="11.4"/><circle cx="197" cy="94" r="9.7"/><circle cx="213" cy="110" r="7.5"/><circle cx="229" cy="126" r="4.5"/><circle cx="358" cy="254" r="4.1"/><circle cx="374" cy="270" r="10.4"/><circle cx="390" cy="286" r="12.8"/><circle cx="406" cy="302" r="13.7"/><circle cx="422" cy="318" r="13.7"/><circle cx="438" cy="334" r="13"/><circle cx="454" cy="351" r="11.6"/><circle cx="470" cy="367" r="9.1"/><circle cx="117" cy="46" r="13.2"/><circle cx="133" cy="62" r="13.5"/><circle cx="149" cy="78" r="12.6"/><circle cx="165" cy="94" r="11.4"/><circle cx="181" cy="110" r="9.8"/><circle cx="197" cy="126" r="7.7"/><circle cx="213" cy="142" r="4.8"/><circle cx="358" cy="286" r="10"/><circle cx="374" cy="302" r="13.1"/><circle cx="390" cy="318" r="13.9"/><circle cx="406" cy="334" r="13.9"/><circle cx="422" cy="351" r="13.2"/><circle cx="438" cy="367" r="11.9"/><circle cx="454" cy="383" r="9.7"/><circle cx="470" cy="399" r="4"/><circle cx="101" cy="62" r="13.4"/><circle cx="117" cy="78" r="13.3"/><circle cx="133" cy="94" r="12.6"/><circle cx="149" cy="110" r="11.5"/><circle cx="165" cy="126" r="10.1"/><circle cx="181" cy="142" r="8.4"/><circle cx="197" cy="158" r="5.9"/><circle cx="342" cy="302" r="10.1"/><circle cx="358" cy="318" r="13.4"/><circle cx="374" cy="334" r="14"/><circle cx="390" cy="351" r="13.9"/><circle cx="406" cy="367" r="13.2"/><circle cx="422" cy="383" r="11.9"/><circle cx="438" cy="399" r="9.9"/><circle cx="454" cy="415" r="5.7"/><circle cx="85" cy="78" r="13.2"/><circle cx="101" cy="94" r="13.2"/><circle cx="117" cy="110" r="12.6"/><circle cx="133" cy="126" r="11.8"/><circle cx="149" cy="142" r="10.6"/><circle cx="165" cy="158" r="9.3"/><circle cx="181" cy="174" r="7.5"/><circle cx="197" cy="190" r="5"/><circle cx="325" cy="318" r="11.7"/><circle cx="342" cy="334" r="13.6"/><circle cx="358" cy="351" r="14"/><circle cx="374" cy="367" r="13.7"/><circle cx="390" cy="383" r="13"/><circle cx="406" cy="399" r="11.7"/><circle cx="422" cy="415" r="9.7"/><circle cx="438" cy="431" r="5.9"/><circle cx="69" cy="94" r="12.8"/><circle cx="85" cy="110" r="13.1"/><circle cx="101" cy="126" r="12.7"/><circle cx="117" cy="142" r="12"/><circle cx="133" cy="158" r="11.2"/><circle cx="149" cy="174" r="10.2"/><circle cx="165" cy="190" r="9.1"/><circle cx="181" cy="206" r="7.6"/><circle cx="197" cy="222" r="5.7"/><circle cx="293" cy="318" r="8.6"/><circle cx="309" cy="334" r="12.7"/><circle cx="325" cy="351" r="13.6"/><circle cx="342" cy="367" r="13.7"/><circle cx="358" cy="383" r="13.4"/><circle cx="374" cy="399" r="12.6"/><circle cx="390" cy="415" r="11.3"/><circle cx="406" cy="431" r="9.3"/><circle cx="422" cy="447" r="5.5"/><circle cx="53" cy="110" r="12.1"/><circle cx="69" cy="126" r="12.9"/><circle cx="85" cy="142" r="12.7"/><circle cx="101" cy="158" r="12.3"/><circle cx="117" cy="174" r="11.7"/><circle cx="133" cy="190" r="11"/><circle cx="149" cy="206" r="10.3"/><circle cx="165" cy="222" r="9.5"/><circle cx="181" cy="238" r="8.7"/><circle cx="197" cy="254" r="8"/><circle cx="213" cy="270" r="7.5"/><circle cx="229" cy="286" r="7.1"/><circle cx="245" cy="302" r="8.3"/><circle cx="261" cy="318" r="10.6"/><circle cx="277" cy="334" r="12.1"/><circle cx="293" cy="351" r="13"/><circle cx="309" cy="367" r="13.4"/><circle cx="325" cy="383" r="13.3"/><circle cx="342" cy="399" r="12.9"/><circle cx="358" cy="415" r="12"/><circle cx="374" cy="431" r="10.7"/><circle cx="390" cy="447" r="8.6"/><circle cx="406" cy="463" r="4.4"/><circle cx="37" cy="126" r="9.3"/><circle cx="53" cy="142" r="12.5"/><circle cx="69" cy="158" r="12.6"/><circle cx="85" cy="174" r="12.4"/><circle cx="101" cy="190" r="12"/><circle cx="117" cy="206" r="11.6"/><circle cx="133" cy="222" r="11.1"/><circle cx="149" cy="238" r="10.7"/><circle cx="165" cy="254" r="10.4"/><circle cx="181" cy="270" r="10.2"/><circle cx="197" cy="286" r="10.2"/><circle cx="213" cy="302" r="10.5"/><circle cx="229" cy="318" r="11.1"/><circle cx="245" cy="334" r="11.9"/><circle cx="261" cy="351" r="12.5"/><circle cx="277" cy="367" r="12.9"/><circle cx="293" cy="383" r="13"/><circle cx="309" cy="399" r="12.8"/><circle cx="325" cy="415" r="12.2"/><circle cx="342" cy="431" r="11.3"/><circle cx="358" cy="447" r="9.9"/><circle cx="374" cy="463" r="7.6"/><circle cx="390" cy="479" r="2.2"/><circle cx="37" cy="158" r="11.9"/><circle cx="53" cy="174" r="12.3"/><circle cx="69" cy="190" r="12.3"/><circle cx="85" cy="206" r="12.2"/><circle cx="101" cy="222" r="11.9"/><circle cx="117" cy="238" r="11.7"/><circle cx="133" cy="254" r="11.4"/><circle cx="149" cy="270" r="11.3"/><circle cx="165" cy="286" r="11.2"/><circle cx="181" cy="302" r="11.3"/><circle cx="197" cy="318" r="11.5"/><circle cx="213" cy="334" r="11.8"/><circle cx="229" cy="351" r="12.2"/><circle cx="245" cy="367" r="12.5"/><circle cx="261" cy="383" r="12.6"/><circle cx="277" cy="399" r="12.5"/><circle cx="293" cy="415" r="12.1"/><circle cx="309" cy="431" r="11.5"/><circle cx="325" cy="447" r="10.4"/><circle cx="342" cy="463" r="8.8"/><circle cx="358" cy="479" r="6.1"/><circle cx="21" cy="174" r="10.5"/><circle cx="37" cy="190" r="11.8"/><circle cx="53" cy="206" r="12.1"/><circle cx="69" cy="222" r="12.1"/><circle cx="85" cy="238" r="12"/><circle cx="101" cy="254" r="11.9"/><circle cx="117" cy="270" r="11.7"/><circle cx="133" cy="286" r="11.7"/><circle cx="149" cy="302" r="11.6"/><circle cx="165" cy="318" r="11.7"/><circle cx="181" cy="334" r="11.8"/><circle cx="197" cy="351" r="12"/><circle cx="213" cy="367" r="12.1"/><circle cx="229" cy="383" r="12.2"/><circle cx="245" cy="399" r="12.1"/><circle cx="261" cy="415" r="11.8"/><circle cx="277" cy="431" r="11.3"/><circle cx="293" cy="447" r="10.5"/><circle cx="309" cy="463" r="9.3"/><circle cx="325" cy="479" r="7.4"/><circle cx="342" cy="495" r="3.8"/><circle cx="21" cy="206" r="10.8"/><circle cx="37" cy="222" r="11.5"/><circle cx="53" cy="238" r="11.7"/><circle cx="69" cy="254" r="11.8"/><circle cx="85" cy="270" r="11.8"/><circle cx="101" cy="286" r="11.7"/><circle cx="117" cy="302" r="11.7"/><circle cx="133" cy="318" r="11.7"/><circle cx="149" cy="334" r="11.7"/><circle cx="165" cy="351" r="11.7"/><circle cx="181" cy="367" r="11.8"/><circle cx="197" cy="383" r="11.7"/><circle cx="213" cy="399" r="11.6"/><circle cx="229" cy="415" r="11.4"/><circle cx="245" cy="431" r="11"/><circle cx="261" cy="447" r="10.3"/><circle cx="277" cy="463" r="9.4"/><circle cx="293" cy="479" r="7.9"/><circle cx="309" cy="495" r="5.4"/><circle cx="5" cy="222" r="6"/><circle cx="21" cy="238" r="10.4"/><circle cx="37" cy="254" r="11"/><circle cx="53" cy="270" r="11.3"/><circle cx="69" cy="286" r="11.4"/><circle cx="85" cy="302" r="11.4"/><circle cx="101" cy="318" r="11.4"/><circle cx="117" cy="334" r="11.4"/><circle cx="133" cy="351" r="11.4"/><circle cx="149" cy="367" r="11.3"/><circle cx="165" cy="383" r="11.3"/><circle cx="181" cy="399" r="11.1"/><circle cx="197" cy="415" r="10.9"/><circle cx="213" cy="431" r="10.5"/><circle cx="229" cy="447" r="9.9"/><circle cx="245" cy="463" r="9.1"/><circle cx="261" cy="479" r="7.8"/><circle cx="277" cy="495" r="5.8"/><circle cx="5" cy="254" r="6.4"/><circle cx="21" cy="270" r="9.7"/><circle cx="37" cy="286" r="10.3"/><circle cx="53" cy="302" r="10.6"/><circle cx="69" cy="318" r="10.7"/><circle cx="85" cy="334" r="10.8"/><circle cx="101" cy="351" r="10.8"/><circle cx="117" cy="367" r="10.7"/><circle cx="133" cy="383" r="10.6"/><circle cx="149" cy="399" r="10.5"/><circle cx="165" cy="415" r="10.2"/><circle cx="181" cy="431" r="9.9"/><circle cx="197" cy="447" r="9.3"/><circle cx="213" cy="463" r="8.5"/><circle cx="229" cy="479" r="7.4"/><circle cx="245" cy="495" r="5.6"/><circle cx="261" cy="511" r="2"/><circle cx="5" cy="286" r="3.8"/><circle cx="21" cy="302" r="8.4"/><circle cx="37" cy="318" r="9.2"/><circle cx="53" cy="334" r="9.6"/><circle cx="69" cy="351" r="9.7"/><circle cx="85" cy="367" r="9.8"/><circle cx="101" cy="383" r="9.7"/><circle cx="117" cy="399" r="9.6"/><circle cx="133" cy="415" r="9.3"/><circle cx="149" cy="431" r="9"/><circle cx="165" cy="447" r="8.4"/><circle cx="181" cy="463" r="7.7"/><circle cx="197" cy="479" r="6.5"/><circle cx="213" cy="495" r="4.8"/><circle cx="21" cy="334" r="5.5"/><circle cx="37" cy="351" r="7.4"/><circle cx="53" cy="367" r="7.9"/><circle cx="69" cy="383" r="8.1"/><circle cx="85" cy="399" r="8.1"/><circle cx="101" cy="415" r="7.9"/><circle cx="117" cy="431" r="7.6"/><circle cx="133" cy="447" r="7.1"/><circle cx="149" cy="463" r="6.2"/><circle cx="165" cy="479" r="5"/><circle cx="181" cy="495" r="2.7"/><circle cx="53" cy="399" r="3.8"/><circle cx="69" cy="415" r="4.7"/><circle cx="85" cy="431" r="4.6"/><circle cx="101" cy="447" r="4.1"/><circle cx="117" cy="463" r="2.8"/></g></svg>