1e654d8ce fixed T3 Code's sync, which rewrote magpie's provider instance
whole. The same shape lost user-set keys in eight more agents. On every
Sync and every pick, each one rewrote magpie's own block in the agent's
config whole. Each app's schema was taken from its own source, never
guessed:
- Qoder 1.1.70 (@qoder-ai/qodercli bundle): providers.magpie lost routing
(the compact and subagent models), firstPayloadTimeoutMs,
streamIdleTimeoutMs, type, authType, anthropic and a displayName.
- fx (vercel-labs/fx configured_provider.zig): reviewer_model was lost,
and a tool_choice_mode of "omit" went back to "send". auth stays
magpie's whole, since fx refuses an env beside type none.
- Hermes (hermes_cli/config_providers.py): `hermes model` itself writes
default_model into providers.magpie. That was lost, as were key_cmd,
the timeouts, extra_body, a name and extra headers. This held in every
profile spread() writes.
- omp (models-config-schema-bundle.ts): modelOverrides, discovery,
disableStrictTools, headers and compat flags were lost. auth and
apiKey stay magpie's, or go, so a loopback's auth: none never sits
beside a WSL key.
- Kimi Code (configSection.ts ProviderConfig): SetTOMLTable replaced
[providers.magpie], losing inline custom_headers, env and
default_model. Its three keys are now set in place.
- Cline (local-provider-registry.ts): models.json lost the provider's
other keys, and the per-model overrides that the VS Code model editor
writes. A model magpie no longer lists still goes.
- Goose (declarative.rs): the custom provider file was rewritten whole,
losing display_name, timeout_seconds, toolshim, other headers and the
like. Goose's own editor carries those keys over.
- ZCode (provider-data-schema.ts, strict): the provider rule lost
providerName, logo, visibility, api.headers and
access.apiKeyManagementUrl. Only keys already in the file, which ZCode
accepted, are kept.
Each merge lays magpie's block over what is there. magpie's parts (the
address, the key, the format and the model list) are named, and a key
magpie stops writing goes with them. The JSON ones use theirsKept or
mergeKept. A new yamlKept does the same for Hermes and omp.
agent-wiring.md lists what each one keeps.
Tests: Test{Qoder,Fx,Hermes,Omp,Kimi,Cline,Goose,ZCode}KeepsTheUsersSettings.
Each one:
- connects;
- sets the user's keys the way the app writes them, plus a stale
address and a stale model;
- adds a provider, then syncs 3 times and picks again;
- checks that the user's keys stay, that magpie's parts are rewritten,
and that the stale model is gone.
All eight fail on origin/main's agent code (each reports "the user's
settings not kept") and pass with this change.
Run, in a sandbox HOME, with GOCACHE in the scratchpad and Go 1.26.8:
- gofmt -l on the changed files: clean.
- go vet ./... (darwin), GOOS=linux go vet -tags nogui ./... and
GOOS=windows go vet ./...: clean.
- go test -tags nogui -timeout 45m ./internal/agent: ok, 805s.
- go test -tags nogui -timeout 45m ./...: all ok.
Not tried: none of these apps was run against a real config written by
this change. Their schemas come from their source (Qoder's npm bundle,
fx, Hermes, oh-my-pi, kimi-code, cline, goose and ZCode at their current
heads), not from a live install.