Tuanjie Cowork (Unity China's coworker app, dev.codelycowork.desktop,
2.1.6-stable) keeps the user's own models in ~/.codely/settings.json:
customModelProviders {id, name, baseUrl, apiKey, authType} and
customModels {id, model, providerId, displayName, roles, wireApi,
supportsMultimodal}, read afresh on every lookup. Read from the app's own
core (tZ/oE for the file, Mwi for a session's OPENAI_BASE_URL/KEY, BOe
for the model list, rha/sha for its startup migrations).
magpie adds a provider and a model of its own, both id "magpie": the
gateway's /v1 with Cowork's own magpie key, the model picked, wireApi
chat. The user's providers and models and every other key stay as
written; a name or roles given magpie's entries in Cowork are kept when
the model changes. Off takes both out, and the file too when magpie made
it and nothing else is in it. A provider or model with id magpie that is
the user's own is left alone, with an error. Which model a chat is on is
Cowork's own per-workspace pick, which magpie doesn't write; a notice
says to pick "<model> (magpie)" in its model menu while it runs. Skills
go to the shared ~/.agents/skills, which its core scans. Icon from the
app's icon.icns. Lists, READMEs, reference, agent-wiring doc, i18n.
Run:
- go test ./internal/agent ./internal/library ./internal/gui on mote;
TestTuanjieCowork* and TestHandWiredMagpieProviderSiblings on Windows
(win-run).
- gofmt; go vet darwin, linux -tags nogui, windows.
- GUI, chromium and webkit: i18n-keys, i18n-en-no-cjk,
agent-notice-lang, gui-de, gui-ja, gui-zh-tw, icon-one-tone,
icon-tile, routing-client-icons, usage-agent-filter-icons,
agent-connect, agent-models, agent-layout.
- Cowork's own code on magpie's output: its tZ, oE, rha, sha, cE, KGa,
Mwi, kOe and BOe, extracted from the 2.1.6 core, run in node on the
settings.json magpie wrote (with the user's own provider, and fresh).
Its migrations leave magpie's entries; cE("magpie") finds the model,
the picker label is "deepseek/pro (magpie)", a session gets
OPENAI_BASE_URL http://127.0.0.1:3425/v1 and magpie's key, the list
URL is /v1/models, and the user's glm-4.5 is still there.
Where: the packages, vets and GUI files above ran on mote at b834dc2a7
(this change on 4a9142ccd); at the pushed head (on 016763f23) internal/agent's
Cowork, HandWired, EveryAgent, Aliases and Icon tests, internal/library, and
the de, zh-TW and en-no-cjk i18n files ran on Windows. Reds not from this
change, both red on main already: gui-ja's {model} twice (#5943), and
TestEveryAgentInLibrary for obsidian and avibe (#5945).
Broken by hand, each red:
- rest() keeping magpie's entries: TestTuanjieCowork (two models) and
TestTuanjieCoworkMadeFile (file left behind).
- no check for a provider id magpie of the user's own:
TestTuanjieCoworkLeavesTheUsersMagpie/provider.
- unwire never removing a file magpie made: TestTuanjieCoworkMadeFile.
Not tried: the real app's GUI (picking magpie's model in its menu and a
chat through it), Windows detection (its NSIS per-user path isn't
known, so on Windows it shows once ~/.codely exists), Linux.