The owner, looking at Codex's New sessions line: two squares, subagents
and subagent model, read alike and nobody could tell them apart ("这两个
用户压根分辨不出来区别"). One was Codex's own [agents]
default_subagent_model, a model a subagent starts on only when its lead
names none; the other magpie's, which puts every subagent on one model
whatever the lead asks for. They are one setting now:
- Codex's card shows the subagent model alone. Unset it says "Same as
the lead" (跟主代理一样): each subagent runs on the lead's model, or on
another the lead picks for it. A model picked: every subagent runs on
it, whatever the lead asks for. Its picker opens on Same as the lead,
the lead's model in the note. With no model of magpie's to pick there,
Codex's own square stays as it was.
- Codex's sheet has the same setting as a row with a name, Codex
subagent model, beside Codex subagents on any model, as the memories
model got one when its square wasn't found (Hu9956).
- A model Codex's config still has in [agents] default_subagent_model
is said on the square, which is lit: "Codex's config still starts
subagents on {model} when the lead names none; picking here replaces
it."
For users who set default_subagent_model themselves: a pick in the
subagent model, Same as the lead too, removes it from Codex's config
(and a subagent effort the subagents' model no longer has), so the one
setting shown is the one that holds. Until they pick, it stays and is
said on the square. The CLI and profiles keep the subagents field.
Claude Code's, omp's and Claude Desktop's subagent squares are unchanged.
Every new string has zh, zh-TW, ja and de. app.js grows 4,011 bytes,
the Agents page's, which the tray panel draws too: the core budget is
raised to it, with no room added, and says why.
What changed:
- writeTiers (claude.go) wrote env.ANTHROPIC_AUTH_TOKEN = wiredKey() on
every model and tier pick, and putProvider beside the thread-provider
tables (codex.go) wrote experimental_bearer_token = at.gwKey() the same
way: a caller key of the gateway's own the user put in their place was
written over, and it was never stashed, so no Disconnect brought it
back. Both keep such a token now, as a sync keeps one (mergeKept,
keyHolds of #2510): only a value the gateway would refuse is wired
over. The sign-in field's own Set is unchanged, as that switch is the
user's own.
- The sharing key magpie itself made is never one of those: access.Default
says a secret is the default key ConfigureLAN keeps, sharing on or off,
and the two write points ask it before keeping what they hold. With
sharing off the key stays enabled in the store, Authenticate still took
it, and keyHolds held it for the user's — Rekey could no longer bring
gateway.Token back (TestRekeyGivesWSLAgentTheSharingKey, deterministic
red on the first cut of this patch, found in review). Claude has no WSL
twin: the sharing key reaches it by an address beyond loopback
(MAGPIE_ADDR), and a pick kept it the same way there, so
TestClaudeSharingOffWiresGatewayTokenBack holds a sharing on, then off,
to gateway.Token.
- docs/subsystems/agent-wiring.md's sentence about a hand-set key said
Check reports it; Check has taken one since #2510, and a pick keeps it
now too, the sharing key excepted.
Patch by ggbdpq (c809f7ad), the second cut after review: the first
(835d3bf8) turned TestRekeyGivesWSLAgentTheSharingKey red, as the
sharing key stays enabled with sharing off and was kept as the user's.
Applied unchanged on e085d6e92.
Run (landing worktree, sandbox HOME, private GOCACHE):
- Broken by hand: access.Default returning false: FAIL
TestRekeyGivesWSLAgentTheSharingKey (wsl_rekey_test.go:88, "sharing
off: key sk-magpie-key-…") and TestClaudeSharingOffWiresGatewayTokenBack
(claude_test.go:291). claude.go and codex.go put back to main's: FAIL
TestClaudePickKeepsAGatewayKeyOfTheUsers and
TestCodexPickKeepsAGatewayKeyOfTheUsers ("a model pick wrote over the
user's caller key"). Restored: all four and TestRekey* ok.
- gofmt -l: clean. go vet darwin (gui), GOOS=linux and GOOS=windows
-tags nogui: clean.
- Full suite, go test -tags nogui -timeout 45m ./... under pipefail at
7380d99e4 (this on e085d6e92), load ~180: every package ok except
internal/agent, which ran past 45m as a whole (2704s, the test at the
deadline 5s in; #2544, this run posted there). Alone at -timeout 45m
it ran out again (2702s, load ~210). Alone with -v -timeout 100m: ok,
854 tests passed in 3017s, the five above among them.
- Rebased on cb05dc2d1 (#2576, #2578, #2657: no internal/agent or
internal/access file): build and vet of both packages ok.
Not tried: a real WSL distro, or the real app's sharing toggles.
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
foobra asked for DevEco Code (npm @deveco/deveco-code), Huawei's
HarmonyOS coding agent. It is OpenCode underneath, so it joins through
openCodeLike as MiMo Code did (03a01a548):
- Config in ~/.config/deveco. magpie writes the first of deveco.jsonc,
deveco.json, config.json there (the one DevEco reads last wins its
merge), or DEVECO_CONFIG_DIR when that is an absolute folder; agentenv
carries DEVECO_CONFIG_DIR. Auth at ~/.local/share/deveco/auth.json.
- Its provider block carries the key magpie-deveco, not the plain one.
0.2.3 sends "deveco/0.2.3 ai-sdk/provider-utils/4.0.23 runtime/bun/1.4.2"
on chat, but parts of its code still send opencode/<version>, so the key
keeps its usage DevEco's whichever it sends. Check flags the plain key,
and Sync writes DevEco's back. OpenCode's own key is unchanged.
- The user's own provider, small_model, $schema and comments stay; the
model they were on comes back on Disconnect.
- Library: AGENTS.md instructions (with the "reads Claude Code's
CLAUDE.md" note, as OpenCode and MiMo Code), MCP in OpenCode's shape,
skills. No WSL folder.
- Install/update: npm @deveco/deveco-code on macOS and Windows only, as the
package has no Linux binary (new cliSpec.only); the self installer under
~/.local/share/deveco/versions updates with `deveco upgrade`.
- Icon: DevEco's own logo, byte for byte from its IntelliJ plugin's
pluginIcon.svg. Model picker /models. Route hue, READMEs (en, zh), site
agent lists (en, zh, ja), docs/reference.md, subsystem pages, CLI help.
What was run
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows.
- go test -tags nogui: internal/library, agentenv, proc, cli, gui, usage
pass; internal/agent passes in 559s with -timeout 40m;
its first run, at the default 10m with load average ~40 from other
sessions, was cut off by the timeout (no test had failed).
- New deveco_test.go: config lookup and DEVECO_CONFIG_DIR, the key, and
Connect/Check/Sync/Disconnect against a deveco.jsonc holding the user's
own model, provider, small_model, $schema and a comment. Made
openCodeKeyAt return the plain key by hand: TestDevEcoKeyNamesIt and
TestDevEcoConnectKeepsTheUsersOwn go red.
- GUI: new library-deveco.test.cjs (the note in en, zh, zh-TW, ja, de,
and the icon draws), chromium and webkit; red with deveco taken out of
library.js's note. library-instr-sets, library-instr-busy,
panel-routing, agent-connect, library-desktop-skills, getting-started,
filter-ime, routing-account-identity pass in both engines.
- Real use, sandbox HOME: npm-installed @deveco/deveco-code 0.2.3,
`deveco auth consent --accept` (sandbox only, no Huawei sign-in). magpie
serve on 127.0.0.1:3592 with a fake upstream; `magpie deveco fake/fake-1`
wrote provider magpie (magpie-deveco, http://127.0.0.1:3592/v1) beside
the user's own and kept the file's comment; `deveco run "Reply with one
word: ping"` answered from the fake, and `magpie usage today` counted it
under DevEco Code. The User-Agent above is what it sent.
Not tried
- Windows, and DevEco Studio's plugin mode; a Huawei-signed-in DevEco.
- `magpie deveco <model>` then `magpie deveco default` doesn't bring back
the model the user was on before: the CLI set path doesn't stash. It is
the same for OpenCode today; Connect/Disconnect in the GUI does.
Reported-by: foobra
codexHome, the helper TestDriftUnwiredEveryAgent and others start from,
pointed HOME, XDG_CONFIG_HOME and XDG_CACHE_HOME at the test's home but
left XDG_DATA_HOME at testenv's. On Linux grokAppDir (ee7a9b24a) reads
$XDG_DATA_HOME/grok-app, so the App's config was written outside the
home the test walks, its base_url never swapped, and no drift showed:
"applied_test.go:219: unwired: <nil>" on ubuntu CI (run 38162553532).
Run: with grokAppOS forced to "linux" in a throwaway file, the test fails
exactly so without this and passes with it. go test ./internal/agent/
ok on macOS; gofmt clean; GOOS=linux and GOOS=windows go vet ok.
The Agents page's Codex "subagent model" field (settings.CodexSubagentModel,
which the gateway puts x-openai-subagent collab_spawn requests on) listed
only the ChatGPT accounts' models, and its setter refused any other
provider's. A user whose lead runs on a chat provider (Token中心, 智谱Plan)
couldn't put its subagents there.
- provider: CodexSubagentModels is Codex's shown catalog
(CatalogFor("codex"), so hidden or unpicked models stay out), ChatGPT
accounts first, routing groups included. SetCodexSubagentModel takes any
provider/model or group id, refuses a bare Codex name.
CodexSubagentUnserved says "magpie doesn't serve it now" for a non-ChatGPT
id that isn't served. CodexAccountModel exported.
- gateway: codexSubagentPick gets the body. When the lead ran on the
ChatGPT backend the task arrives sealed (encrypted_content), and only a
ChatGPT account can open it: set to another provider, such a subagent
stays on the model asked for, with Kept = sealedKept in the route trace
(#1613's constraint; the reverse, a chat lead with a subagent on ChatGPT,
was already handled by 149ab950e). A plain task moves, and sealed
MESSAGE items are stripped as before.
- gui: i18n for both new reasons (zh, zh-TW, ja, de); the GUI test lists a
chat provider's model and shows the sealed reason in every language.
- docs: agent-wiring and gateway-routing say the same.
Run:
- go test ./internal/gateway/ ./internal/agent/ ./internal/provider/
./internal/gui/ (ok), gofmt -l clean, GOOS=linux and windows go vet
-tags nogui on the four packages.
- GUI node tests (codex-subagent-model, routing-kind, i18n-keys,
codex-start-model-field, gui-ja, gui-de, gui-zh-tw) in Chromium and
WebKit: 38/38.
- Broken by hand: without the sealed check,
TestCodexSubagentSealedTaskStaysOffAChatProvider fails with a 400;
options limited to ChatGPT entries, TestCodexSubagentModelTakesAnyProvider
fails; options from Served() instead of Codex's shown catalog,
TestAgentModelLineAllHidden and TestAgentModelsOnlyPicked fail.
- Sandbox HOME e2e with the built binary and a fake chat upstream:
`magpie codex subagent_model token/gpt-6.1-sol` set, a bare gpt-5.5
refused; a collab_spawn plain-task request on gpt-6-astra to
/backend-api/codex/responses was answered by token/gpt-6.1-sol and the
upstream got the task text.
Not tried: a real Codex CLI or ChatGPT account; the sealed case only in
unit tests.
Codex's sign-in, ChatGPT, keeps Codex signed in to ChatGPT with magpie's
models beside its own, but once the ChatGPT account is used up magpie
makes itself Codex's provider (#540): the Codex app sends nothing at all
on an account it knows is out, a magpie model's turn included. That move
went unsaid, and a user who chose ChatGPT expected Codex to stay there.
ChatGPT now says it, and a third way, Always ChatGPT (login "chatgpt"),
never makes the move, by a pick or by Sync; choosing it puts a Codex moved
before back beside the sign-in. What it costs is said beside it: the Codex
app may send nothing till the account has room, while Codex CLI's turns
still reach magpie by the base URL, its routing and other accounts serving
them.
ChatGPT Desktop 26.924.22138 is the Codex app renamed (bundle com.openai.codex, codex-cli 0.158.0-alpha.2.1): it reads ~/.codex and honours openai_base_url, model_provider and chatgpt_base_url; the error text comes from chatgpt.com. Codex keeps a thread on the provider it was started on, so an old ChatGPT conversation reopened while magpie is Codex's provider (signed out, allowance used up, or the sign-in set to api) stays on the built-in provider, and magpie removed openai_base_url in that mode, so a magpie model picked in it went to chatgpt.com, which refused it. Provider mode now sets openai_base_url to magpie's gateway too (whose /backend-api/codex serves "provider/model" and passes Codex's own models on), unless the user has one of their own; picking one of Codex's own models or a reset still removes magpie's. Sync adds it to configs an older magpie wrote in provider mode, when the catalog file is magpie's. Verified by driving ChatGPT Desktop's bundled `codex app-server` in a sandbox HOME with a fake ChatGPT auth.json and fake servers: before, a thread started on the built-in provider and reopened with model_provider = "magpie" went to the built-in base URL; now it reaches magpie's /backend-api/codex/responses, and a new thread /v1/responses. Tests: codex_thread_test.go (TestCodexProviderAlsoSetsBaseURL signed out and api, TestCodexProviderKeepsOwnBaseURL, TestCodexSyncAddsBaseURLToProvider; the first and third fail without the change), codex_route_test.go updated for the base URL in provider mode. go vet, go build -tags nogui (and GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. Not tried in the real ChatGPT Desktop window or with a real account; a thread already open in a running app keeps the settings it was loaded with, and cloud threads never read the local config.