ae7dc10ae284f79042ddf8fcddbfb4becc3cdffe
3916
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ae7dc10ae2 |
docker: the image is Debian 12 slim, so the Cursor and Devin CLIs magpie installs at sign-in run in it (#2834, bborn2)
magpie installs a subscription's CLI at sign-in with its vendor's `curl … | bash` (internal/provider/install.go: Cursor, Devin, Grok Build). The distroless image had no curl and no /usr/bin/env (the installers' shebang), so that install couldn't run there, and only Grok Build had a native fallback. bborn2 reported that a Cursor CLI installed by hand failed with "cannot execute: required file not found". The image is now debian:12-slim with ca-certificates and curl. It keeps the nonroot user at uid/gid 65532, HOME and XDG under /config, the healthcheck, and magpie on PATH. Size: 157MB against 82MB for origin/main's image, both built here on arm64. Running a feature magpie offers is worth the 75MB. Changed in review: dropped the branch's GOPROXY build arg, a separate goal. The comments in install.go and install_test.go that said the image has no curl now say "had". docs/reference.md and the site's Docker page (en, zh, ja) say Debian with bash and curl instead of distroless with busybox. Run, with OrbStack's docker: - docker build of this tree and of d783df46c's Dockerfile: 157MB vs 82MB. - docker run of the new image: health "healthy", user nonroot (id 65532). `curl https://cursor.com/install -fsS | bash` exit 0, then `~/.local/bin/cursor-agent --version` printed 2026.10.16-e3cb207. Devin's install.sh installed devin v3000.11.92 (its trailing `devin setup` said "Login canceled" with no terminal, as on any host). `devin --version` printed 3000.11.92. bash and `magpie version` run. - Old image: `which curl` finds none, and /usr/bin/env doesn't exist. - A volume written by the old image (file owned 65532) was read and written by the new image. - gofmt -l clean; go vet darwin, linux (nogui) and windows clean. - Full `go test -tags nogui -timeout 45m ./...`: every package ok except internal/agent and internal/gateway, which timed out at 45m mid-test (TestConnectSaysHow, TestLargeRequestEndpoints) under a load average of about 200 from parallel suites. This commit changes no code those packages build, only comments in internal/provider, which passed (992s), so they weren't rerun. Not tried: a Grok Build install inside the image, and a full in-magpie Cursor/Devin sign-in with a real account in the container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ccb2eea159 |
provider: moved Zed users get plugin 0.1.9, which says why a never-read model list failed (plugins#229)
plugins 779388b published @magpie-community/opencode-zed-auth 0.1.9 at 13:45 (npm view --prefer-online: 0.1.9), but the zed mover's min stayed 0.1.8. keepMovedCurrent installs mv.min, so moved users, ReneXiong among them, kept 0.1.8 and its six pre-sign-in models shown as the account's own. Every other mover's min equals its npm latest (checked all eleven). Run at this tree: go test -timeout 30m ./internal/provider/ ok (1022s, sandbox HOME); gofmt -l clean; GOOS=linux and GOOS=windows go vet ./internal/provider/ clean. Not tried: a real Zed account, as the plugin commit says. |
||
|
|
d783df46cb |
plugin: a plugin's page adds items to a provider's and an agent's row menu (P6)
package.json's magpie.actions: [{id, menu, title, titles}] puts items in
the row menus magpie draws, after its own: a provider row's (right-click)
and an agent row's (its handle, or right-click). Picking one opens the
plugin's page and posts it {event: "action", data: {id, provider|agent:
{id, name}}}, nothing else of the row; the bridge's magpie.onAction(fn)
gets it, and an action picked before fn was given waits for it.
- plugin.Window reads them (page.go): menu one of ActionMenus (provider,
agent; a session's menu is left out, its title is user content), id
^[a-z0-9][a-z0-9-]{0,39}$, an id given twice is the first's, 8 at most,
none for a plugin with no page.
- /api/plugin-pages carries them on the page; a missing title is the
page's, in each language (pluginpage.go).
- pluginpages.js: magpie.actions(menu, context) gives the row menu's
items; openRowMenu draws a plugin's name as written (literal), not
through t().
- The Plugins page says which menus a plugin adds to (actionsLine),
translated in zh, zh-TW, ja and de.
- Docs: plugin-runtime.md's P6 section and verification; the site's
plugin docs (en, zh, ja) gain "Items in magpie's menus".
- The core's budget (TestCoreScriptBudget) is not raised (#2710): with
P6 the core came to 1,447,648 bytes, 648 over. pluginpages.js's header
now says P5's and P6's part in one paragraph and points to
plugin-runtime.md, which says it in full, and plugins.js's panels and
actions lines share whereLine: 1,446,845, 155 under.
Run:
- Full: this series (P5, the Plugins dot, the probe test, P6, and a
built-ins-on commit since dropped for main's own
|
||
|
|
d694d9bf8f |
agent: TestKeptAddressProbeNeverWaitedFor tests that Drift returns, not that it returns within a second
It went red in a full run at load average ~300 ("Drift waited for the
probe") because Drift, which reads the agent's files, took over a second.
The probe it starts is held until the test releases it, so a Drift that
waited for it would never return: the test now waits up to 30s for Drift
and fails only if it hasn't returned.
Run: broken by hand (Drift calls the probe before returning), red at
38.9s with "Drift waited for the probe"; restored, go test -count=3
-run TestKeptAddress ./internal/agent/ ok.
Full run, with the rest of its series:
this series (P5, the Plugins dot, the probe test, P6, and a
built-ins-on commit since dropped for main's own
|
||
|
|
8e44c2f351 |
gui: the dot on Plugins says what it is, and leads to the plugins with an update
The owner, on the sidebar's dot beside Plugins: no one can tell what it means, and once they click it, they should see which plugins need updating. It meant "a plugin update is waiting", said only in a hover title, and Plugins opened on whatever tab was last open. - Sidebar: under Plugins, Installed reads "1 update" / "N updates" in the dot's colour in place of its count, with a title saying where to update. - Opening Plugins while an update waits lands on Installed. - Installed names the plugins with a newer version in a bar above the list, with Update all beside them (moved there from the footer). Each row still shows its own "vX out" and Update. - Strings in zh, zh-TW, ja and de; the docs (en, zh, ja) say the same. Run: - plugin-updates.test.cjs: chromium and webkit, en zh zh-TW ja de, at 1024 (sidebar) and 600 (tab bar), 22 ok. Also ok in both engines: plugin-git, plugin-update-button, plugin-check-updates, plugin-card-update, plugin-prerelease, nav-sub-unroll, sidebar, builtins, i18n-keys. go test ./internal/gui/ -run 'TestCoreScriptBudget' ok. - Broken by hand, each red: no sidebar label (the 1024 cases), no jump to Installed, no bar (every case). - Looked at in WebKit screenshots, zh at 1024 and de at 600. Full run, with the rest of its series: this series (P5, the Plugins dot, the probe test, P6, and a built-ins-on commit since dropped for main's own |
||
|
|
b9f790d37b |
plugins: panels in magpie's pages, a page that replaces a built-in one, titles in the window's language, and a look that matches
P5 of the plugin runtime (docs/subsystems/plugin-runtime.md):
- Panels (magpie.panels): a plugin draws a frame into a slot of a
built-in page (a provider's editor, Settings, Usage); magpie.context
says where it is, and the frame is as tall as what it draws.
- A page can replace a built-in one (magpie.page.replaces); show() opens
it in that page's place, and the sidebar row goes to it.
- page.titles and a panel's titles name it in the window's language
({"zh": …}); a malformed map is dropped, the title kept
(TestWindowTitles).
- main's #2501 already names wails:// in the policy of a page in the
desktop window (through ownWindow), which is why the usage page drew as
bare HTML from v0.1.1259. TestPluginPageLoadsItsFilesInTheWindow loads
a page through ownWindow in a real WKWebView, which Playwright on http
can't; the subsystem page says how.
- The bridge adds magpie's look for what a page leaves unstyled, every
rule in :where() so any rule of the page's wins, and the theme's
colours as --magpie-* variables.
One commit: the panels, the replacing pages and the titles share hunks
in page.go, pluginpage.go, pluginpages.js and the docs, and couldn't be
split cleanly.
Run:
- Full: this series (P5, the Plugins dot, the probe test, P6, and a
built-ins-on commit since dropped for main's own
|
||
|
|
5380114da1 |
LESSONS: 10-17: runs recorded at another tree, "under load" reds left unowned, a body scan on every passing reply
Folds the review of 10-17 04:00 to 10-18 04:00 (77 commits, v0.1.1277 to v0.1.1283) into LESSONS.md, and moves two lessons seen a third day into docs/code-standards.md: - magpie's default never overrides a value the user set (10-05, 10-10, 10-17: 5a2414acd's Essentials to All, #2749), a row under "What a change contains"; - a checkout, worktree or log belongs to the session that made it (10-09, 10-12, 10-17: 7660399a1's worktree checked out by another session, 17557132c's log deleted), under Commits. New lessons, each seen once: - a named sibling left alone gets an issue ( |
||
|
|
7ac20247a9 |
gateway: a large passing reply is not read for why it failed, so a 24MB JSON reply reaches its client again (#2551)
|
||
|
|
b36819d349 |
redact: a long string already scrubbed is not run through the rules again
yetone/magpie-releases#24: ~19% of the profile was gateway
recordConversation -> conversationTurn -> redact.ScrubJSON -> mask. Codex
sends its whole history on every turn, and what is kept of each request
is scrubbed whole, so each turn ran every rule over the whole session
again: O(history) per turn.
Scrub now remembers, for strings of 256 bytes or more, what it made of
them, keyed by SHA-256 of the string and by knownGen. What Scrub returns
depends only on the string and on the values known (rules are static);
known.go bumps knownGen whenever that set changes (a value added or
replaced, a reindex after values are let go), and a result made at
another generation is never used. Nothing is kept but the hash and, when
the string changed, the scrubbed text. Two generations of at most 32,768
entries / 32 MB each. ScrubJSON's fallback for a body that isn't JSON is
unchanged, so a failed parse still scrubs line by line; nothing is
recorded unscrubbed.
Measured (Apple M4 Pro, BenchmarkScrubCodexTurn: turn 301 of a Codex
Responses history, 1.3 MB, each turn's tool output ~4 KB of code naming
tokens, keys and URLs, scrubbed after turn 300 was):
before (memo off): 2.81 s/op
after: 0.10 s/op, 5.4 MB and 21.6k allocs/op
TestScrubRunsTheRulesOnceAString: turn 41 after turn 40 runs the rules
over one long string (its new output); on the old behaviour (memo off)
it fails with "the rules ran over 41 strings for one new turn". It also
checks the output is the same as a fresh scrub.
TestScrubMemoForgetsWhenAValueBecomesKnown: a string remembered as clean
is redacted once a value in it is masked elsewhere (Scrub and ScrubJSON).
TestScrubMemoKeepsTheSecretOut, TestScrubMemoBounded.
Run: go test -tags nogui -count=3 ./internal/redact/ ok; the full suite
as in the sessions commit before this one (same tree). agent and gateway rerun at a lower load: ok; gui rerun: ok. (The first
rerun had TestPluginStreamLargeReplies red on time again, #2551, which
passes alone in 22s, and TestDiffLines at 2.04s against its 2s bound,
filed as #2766.)
gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui ./... ok.
Rebased onto
|
||
|
|
3b3bc359da |
sessions: a long Codex session being written is read on from where it was, not from its first line
yetone/magpie-releases#24 (LeiCheng42, v0.1.1280): a 30s profile while Codex ran shows magpie at about a core, ~24% of it in usage.prefetchSources -> sessions.ReadCallSource -> readCalls -> scanAt. The tray's usage loop (watchTrayUsage -> usage.QueryPage(Today)), the usage API and the Sessions page read every source whose size or mtime changed, and an active Codex rollout changes each turn. A Codex continuation's index weighs about six entries a call, so a session past ~1,365 calls was over the shared 8192-entry revision budget: its window was dropped, and every append parsed the whole rollout again from offset 0, for the Requests reader and the summary (List) alike. Now up to two (revisionActiveFiles) recently written Codex sessions keep their window past the shared budget, each up to 16x it (131,072 entries), and only while the file changed in the last revisionIdle (5 min). The full parse built the same index on every append anyway, so this costs no more at its peak; an idle session still loses it. Measured (Apple M4 Pro, BenchmarkLongCodexSessionAppend: a 2,000-call, 10.7 MB rollout, one turn appended, then ReadCallSource + List(0)): before: 0.87-1.09 s/op after: 26-60 ms/op TestLongCodexSessionAppendReadsOnlyTheAppend (via a scanAt hook) checks that each of three appends is read from the previous size by both readers, and that the result DeepEquals a fresh read of the whole file (calls and summary) after the caches are dropped. On the old code it fails: "append 0: read from 0, not where the last read ended (10691427)". TestRevisionEntryBudget covers the two-window cap and the idle/oversize drops. Run: go test -tags nogui ./internal/sessions/ ok; go test -tags nogui -timeout 45m ./... with the redact change on top, under a load average of 440-610 from other sessions' suites: 59 ok, and agent and gateway (45m timeout), gui (TestSetAnswersWhileDevinAndProvidersHang, set took 1m30s), edit (TestTOMLBigFileParsesInLinearTime, 1.0s) and middleware (TestStream, onEvent "took too long") failed on time. edit and middleware rerun alone: ok. agent and gateway rerun at a lower load: ok; gui rerun: ok. (The first rerun had TestPluginStreamLargeReplies red on time again, #2551, which passes alone in 22s, and TestDiffLines at 2.04s against its 2s bound, filed as #2766.) gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui ./... ok. |
||
|
|
b14784c03f |
gateway: a fallback too small for the request is asked once every account with room is out of its allowance (Kai on Discord)
Kai on Discord (0.1.1278): Claude Code to claude/claude-opus-5-5, the
Claude provider's two subscription accounts (Max, Pro) both at their
limit ("resets 5:58am", "resets Oct 18 at 3pm"), its Fallback
codex/gpt-6.1-sol. Routing said the second account's 429 had nobody left
to try, and Claude Code had the 429. The fallback was never in the
route's order.
Cause: roomy (
|
||
|
|
a3b48e0f74 |
gateway tests: TestTranslatedStreamKeepsClientAlive gives a loaded scheduler room (#2169, #2711, #2737)
The test's client hung up after 150ms of hearing nothing counted, while the gateway's keepalive gap is 10ms. Under load (300-600 on the dev box, CI's macOS race shard at |
||
|
|
e44b9aef33 |
middleware: onProvider changes what one provider a request is tried on is sent
A JS gateway middleware can export onProvider(body, ctx). The gateway
calls it on each try, just before the body goes to that provider, with
ctx.provider = {id, name, account, model}: account is the subscription's
kind (claude, antigravity, …), absent for a key. Every try starts again
from the body onRequest left, so a change for one provider never reaches
another in a routing group. null and ctx.reject turn nothing away there.
A hook that throws or runs past 250ms leaves the try's body as it was.
A plugin could act only before routing until now, by the model name the
agent asked for. Claude Desktop asks for opaque aliases, so a plugin
couldn't tell which vendor a request was going to. The first user is
@magpie-community/middleware-antigravity-cloak: it changes only what an
Antigravity account is sent, so that Antigravity stops refusing Claude
Code's system prompt (xzplzpl on X). magpie itself still sends every
prompt as the agent wrote it.
- gwmw.To and gwmw.Tried; middleware.Run.Tried runs the hooks.
- serveAgent puts the runs on the request's context, and serve's
candidate loop calls triedOn before the Antigravity foresight, so it
judges the body that will be sent.
- Docs: gateway-middleware.md, reference.md, integrating.md, and the
hooks table and community list in site docs plugins.html (en, zh, ja).
Run:
- go test ./... -timeout 45m in a sandbox HOME (macOS, at
|
||
|
|
de671719a0 |
provider: a retired built-in's failed move is tried again in 10 minutes, not 6 hours
A failed move waited moveRetry (6h) before KeepRetiringMoved tried it again. That was fine while the built-in carried on serving the accounts. A retired built-in serves nothing, so a move that failed for a moment (npm out of reach, or the plugin listed in plugins.json but not installed yet, which the real-account run on 85b8f6d4d hit with Command Code: the first Move failed, the second worked) left the user's subscription unserved for up to 6 hours unless they pressed Move. - retryWait(id) is retiredRetry (10 minutes) for a retired built-in, and moveRetry otherwise. MoveRetiring and HandOver both use it (retryDue). - KeepRetiringMoved's next run is brought forward to when a retired built-in's failed move is due (nextRetiringRun, at least a minute), instead of always an hour. - docs/subsystems/provider-plugins.md says so. TestMoveCutShort now also checks: - a failed move 11 minutes old waits while the built-in serves it, and the next run is an hour; - once retired, the next run is 10 minutes, it isn't tried at once, and it is moved after retiredRetry. Broken by hand, each red: - retryWait returning moveRetry for a retired built-in: "a retired built-in after retiredRetry: map[]" - nextRetiringRun always an hour: "the next run after a retired built-in's failed move: 1h0m0s, not 10m0s" Run: go test -tags nogui ./internal/provider -run TestMoveCutShort: ok. What was run for the stack, at load ~300 (it was rebased from |
||
|
|
3443d18c31 |
gui tests: keychain-retry waits for the status that comes after the state is read
keychain-retry.test.cjs was red under load, on origin/main
|
||
|
|
0718beb437 |
provider: FetchNew waits on no CLI for who is signed in; none feeds a list it fetches
cliIdentities() still held cursorStatus after Cursor's built-in was retired. Nothing FetchNew fetches waits on `cursor-agent about` any more: the Cursor plugin lists its own accounts (Listed), and cursorIdentity only names its carried-over account. But a page's FetchNewBehind still found the never-asked CLI unsettled and ran behind the page, so FetchingNew stayed up on a poll with nothing due, the same loop Devin's entry caused (TestFetchingNewOnceStarted and TestFetchingNewForgottenWhileListed red from the Cursor commit on). Removed: cliIdentities, awaitIdentities, asking, identitiesUnsettled and identitiesAnswered, and their branches in fetchNewGo and fetchNewHeld, which now list the accounts once. TestFetchingNewForgottenWhileListed (#2390) and the CLI half of TestFetchingNewOnceStarted (#1147, #1789) tested only that wait, and go with it. cursorStatus and devinStatus stay as cliIdentity, asked by the plugin's own-account name and the movers; left_alone_test names them itself. Run in magpie-wt-int (this commit on the retire stack): go test -tags nogui -count=1 -run 'FetchingNew|FetchNew|LeftAlone|Identit|Mover' ./internal/provider: ok go vet -tags nogui ./internal/provider; staticcheck -checks U1000 ./internal/provider: only sameAccount, unused on origin/main too The full suite at the stack's final head is recorded in the last commit's body. |
||
|
|
bd30b068d3 |
docs: every deprecated built-in is retired; AGENTS.md and gateway-routing say so
AGENTS.md: the table's subscriptions are retired, not moving; the plugin does everything, the built-ins' code is gone but for what the movers read; the "fix the built-in too" step is gone; the parity tests hold each plugin to what its built-in did. gateway-routing.md: no bridges to a vendor's own API are left, so the structured-output, tool-image and billing-line lists lose Cursor, Kiro, Qoder, Devin and Command Code; Kiro's image ordering is its plugin's. Run: docs only; the full suite runs at the stack's head. |
||
|
|
e431f71a89 |
gateway, provider: the code only the retired built-ins used is removed
With all eleven built-ins retired, staticcheck U1000 (diffed against |
||
|
|
be62bcf79e |
provider: Command Code's built-in is retired; its plugin serves it
commandcode-plan joins retiredBuiltins (migrate.go): PluginServes is true
for it moved or not, and @magpie-community/opencode-commandcode-auth does
its sign-in, models, requests and usage.
Removed
- Sign-in: the StartSignIn case (startCommandCodeSignIn, the Studio
callback, cmdOrigins, cmdWhoamiWait, commandCodeCallback/Keep) and the
pasted-key branch (commandCodeKey, cmdSignedIn).
- Accounts: commandCodeAccount, cmdProvider, cmdSide, cmdLoginList,
switch/on/forget (switchCommandCodeLogin, setCommandCodeLoginOn,
forgetCommandCodeLogin, commandCodeAlsoOn), the Logins case, and the
per-login usage (cmdLoginQuota, cmdQuota, the perLogin fetch). The
Logins("") list keeps {CommandCodePlanID, nil} so its order holds.
- The Go plan's path: CommandCodeGenerate, cmdGoModels/cmdGoFetch/
cmdGoRefused, cmdModels, cmdFree/cmdMarkFree, cmdPlansSeen's built-in
users (cmdRemember, cmdPlanKnown, cmdPlanNow), CommandCodeOutputOf, and
the account's generate field.
- asksOwnBackend's Command Code case.
- Gateway: the cmdGenerate/serveCommandCode dispatch and countOn's
cmdGoing clause; internal/gateway/commandcode.go (the /alpha/generate
translator) deleted.
- Built-in-only tests: gateway commandcode_test.go and
commandcode_place_test.go, TestBillingLineLeftOutOnCommandCode;
provider commandcode_go_test.go, commandcode_go_models_test.go,
commandcode_free_test.go, TestCommandCodePlan,
TestCommandCodeSignInWhoamiDown, TestCommandCodeSignInAgainToRemovedOwn,
TestCommandCodeSignInPastedKey.
- Docs: Command Code out of gateway-routing.md's bridge lists (the
2xx check, structured output, tool images, the billing line).
Kept, and why
- The mover and what it reads: cmdAuth, cmdOwn, cmdWho, cmdLogin,
cmdSaved, cmdLogins (migrate_side.go, plugin_accounts.go).
- cmdAPI/cmdStudio (plugin_usage.go's moved card), cmdKeysURL
(pluginsignin_paste.go), the plan and credit readers (cmdPlans,
cmdPlanOf, cmdPlanName, cmdWindows, cmdLeft, cmdQuotaOf, cmdTime,
cmdSubscription, cmdKeyWindows, cmdKeyPlanID): the keyed preset
"commandcode", planquota.go, balance.go and qoder_usage.go use them.
- CommandCodeMaxOutput (models.go caps the plugin's "commandcode-plan"
models with it), estimatedMoved, chat.go's plugin host cases, the
gateway parity tests, and the PLUGIN-SERVED notice in
commandcode_plan.go, now in the retired wording.
Tests whose meaning changed
- TestLoopbackSignInsTakePastedAddress no longer starts Command Code's
built-in sign-in; the plugin's (TestLoopbackPorts) says its key is
posted, never pasted as an address.
- The Go plan's free-model marks (TestCommandCodeFreeModels) were the
built-in's alone; the keyed preset never marked them.
Run (worktree magpie-wt-rt-a, on top of 9a64c4025)
- gofmt -l internal: clean
- go vet -tags nogui ./... (darwin, GOOS=linux, GOOS=windows): clean
- staticcheck U1000 on ./internal/...: no declaration unused that wasn't
unused at HEAD
- go test -tags nogui -count=1 ./internal/provider/ -run
'CommandCode|commandcode|Migrat|Move|Moved|Retir|SignIn|AsksOwnBackend|
SideLogin|Logins|Unmoved|Paste|Loopback|Account|PlanQuota|Balance|
FetchNew|FetchingNew|LeftAlone|Identit|Order': ok (100s)
- same, -run 'Usage|Card|Quota|Discovery|Exposed|Models|Output': ok
- ./internal/gateway/ -run 'CommandCode|commandcode|Plugin|Parity|Moved|
BillingLine|Search|ShapeFallback|GroupFails|CountTokens|Count|Format|
ToolImage|Cursor|Connect': ok (117s)
- ./internal/cli/ ./internal/gui/ -run 'CommandCode|commandcode|Plugin|
Retired|Moved|SignIn|Login': ok
- Not run: whole packages, the full suite, the GUI node suite (the
machine is loaded; the parent runs those).
|
||
|
|
07a445f42b |
provider: Devin's built-in is retired; its plugin serves it
"devin" joins retiredBuiltins, as Zed (c0605abc2) and Grok (60ecd598c)
did. @magpie-community/opencode-devin-auth serves it, moved or not.
Removed:
- Sign-in: the PKCE localhost listen and callback branch in signin.go,
devinExchange/devinExchangeURL. The exchange is Codex's alone again.
- Accounts: devinAccount and devinProvider in the account list, and the
Logins, switch, on and forget cases (devinSide, devinLoginList,
switchDevinLogin, setDevinLoginOn, forgetDevinLogin, removeDevinHome,
addDevinLogin, devinAlsoOn). "devin" keeps its place in Logins("") with
a nil list.
- Usage: devin_usage.go whole (perLogin fetch, usageLogins, loginQuota).
devinUsageVersion moved to devin_images.go, which still uses it.
- asksOwnBackend's "devin".
- Gateway: attempt()'s serveDevin dispatch and the Devin translator
(serveDevin, askDevin, buildDevin, decodeDevin, the Gemini schema and
tool-description rewriting, the call-id helpers). gateway/devin.go is
now connect_pb.go and keeps only the protobuf and Connect framing that
cursor.go uses.
- Tests of the built-in alone: gateway devin_test, devin_gemini_schema,
devin_sampling and devin_tool_ids; provider devin_usage_test,
devin_cli_signed_out_test, TestDevinSignIn, TestDevinSeveralAccounts,
TestSignInInstallsMissingCLI, TestDevinSignInUnseen, the Devin case of
the required-tools test, and TestDevinSplitParallelCallsKeepTheirResults.
Kept, because the plugin, the devin agent or the move uses them:
- The mover, devinLogins, devinIdentity/devinStatus, DevinAuthAt,
devinCredentialsAt, newDevinHome, devinCommand/devinProxy.
- DevinFamilies, DevinVariant and models.go's p.ID == "devin" shaping
(the plugin's provider id is "devin" too). internal/agent/devin.go
reads the families.
- The installer's "devin" case: the plugin's sign-in installs the CLI.
- The PLUGIN-SERVED notices in devin.go, devin_accounts.go and
devin_images.go, reworded as retired.
Also fixed:
- cliIdentities no longer lists devinStatus. No look at the accounts
asks it now, so it stayed unsettled, and FetchNewBehind told every page
that lists were on their way (TestFetchingNewOnceStarted went red).
- 60ecd598c (Grok) left TestFetchingNewForgottenWhileListed red: its
hook was GrokExecutable in the account listing. It and
TestFetchNewListsAgainForAnAnswerWhileListing now hook kiroCLIDB,
which is read after Cursor's account. Retiring Kiro will need another
hook.
Tests whose meaning changed:
- TestSignInInstallFails and TestSignInCanceledWhileInstalling go
through StartPluginSignIn("devin"), the plugin's install of the CLI.
- TestDevinCLIGoesThroughItsProxy seeds both accounts in logins.json
instead of signing one in. The sign-in's proxy is covered by
TestPluginSignInGoesThroughItsProxy.
- TestLeftAloneRunsNoCLI no longer expects `devin auth status` when the
subscription is switched on.
- TestFetchingNewOnceStarted's unanswered CLI is Cursor's.
- devinRawID moved to anthropic_call_ids_test.go. A Devin call id is
checked as safeCallID("dv_", ...).
Run:
- gofmt -l internal: clean.
- go vet -tags nogui ./... on darwin, GOOS=linux and GOOS=windows: clean.
- staticcheck U1000 on provider and gateway: no Devin leftovers.
- go test -tags nogui -count=1 -run '^(every test in provider, cli and
gateway that names Devin|TestFetchNew.*|TestFetchingNew.*|
TestLeftAlone.*|.*Identit.*)$' ./internal/provider ./internal/cli
./internal/gateway: ok.
- -run 'Migrat|Move|Moved|Retir|SignIn|AsksOwnBackend|SideLogin|Logins|
Unmoved|Install|Proxy|Account' ./internal/provider: ok.
- -run 'Devin|Required|Split|CallID|Cursor|Connect|Parity|ToolImage|
Format|BillingLine' ./internal/gateway: ok.
- -run 'Devin|Plugin|Retired|Moved' ./internal/gui ./internal/agent: ok.
- Not run: the whole packages, the full suite, the GUI node suite (the
machine is loaded).
|
||
|
|
2927a161ef |
provider: Grok's built-in is retired; its plugin serves it
Grok ("grok") joins Zed in retiredBuiltins. It is served by
@magpie-community/opencode-grok-auth, moved or not.
Removed, the built-in's own paths:
- the sign-in (startGrokSignIn) and the per-account homes it made;
- the Logins/switch/on/forget cases and the alsoOn branch;
- grokAccount and the account list entry;
- the usage fetch (grokSubscriptionUsage, grokLoginUsage, the windows);
- the model list (grokModels, grokContextModels, the window labels);
- the token refresh, the headers, the version probe, and routing's usage
clearing.
grok_usage_test.go is deleted, along with the six built-in-only tests in
grok_test.go and the four in grok_accounts_test.go.
Kept, because something still uses them:
- grokLogins and readGrokCredential, for the mover (migrate_side.go);
- grokBody, for the plugin's request bodies;
- GrokHome, the CLI install (pluginRunsCLI) and GrokBase;
- the gateway's grok draw, video, search and namespace code. It asks
PluginProvider()=="grok" too.
Each remaining grok file has a PLUGIN-SERVED notice.
Fixes the retirement needed:
- movedAgent asks Moved again, not PluginServes. A retired Grok that is
not moved yet still records the CLI's own sign-in, so the move takes it.
TestMoveGrok fails without this: only the second account moved.
- In Logins(""), a retired built-in keeps its place, with no list. Grok's
and Zed's accounts list where the built-ins' stood. Without this,
TestAllLoginsMovedKeepTheirPlace fails ("[zed grok]").
Tests whose meaning changed:
- The gateway's grokSignedIn now serves Grok through the fake plugin
moved onto "grok". It proxies to provider.GrokBase, read per request
and refused unless loopback, so no test reaches the network. It names
127.0.0.1 in fetchPrivate, because the vendor's own host is now the
fake's.
- TestVideoContentAtPrivateAddressNotFetched clears that setting. Without
the clear it fails with "200 secret-bytes".
- TestGrokAccountDraws checks the plugin's Authorization only. The real
plugin's headers are the plugin repo's to test.
- The Grok cases in TestVideosRedacted and TestMediaRedactedErrors reach
their echo through GrokBase (grokEcho).
- TestVideoModelByItsBareName's chat model is the fake's fake-1.
- TestGrokPluginSearchesItself expects "grok", not grok-plugin.
- TestGrokHideOwnSignIn is removed: hiding the CLI's own sign-in was the
built-in's ForgetLogin.
- grok_accounts_test.go keeps test-only newGrokHome and addGrokLogin
fixtures for the mover's tests.
Run in the worktree:
- gofmt -l internal: empty.
- go vet -tags nogui ./... on darwin, GOOS=linux and GOOS=windows: clean.
- go test -tags nogui -count=1 -run
'Private|Grok|grok|CallerUsageVideos|GatewayKeyModelsHoldTheImageAndVideoLists|RemoteMagpie|Video|Redact'
./internal/gateway: ok.
- go test -tags nogui -count=1 -run
'Grok|grok|Migrat|Move|Moved|Retired|Retir|SignIn|AsksOwnBackend|SideLogin|Hide|OwnRow|Logins|Unmoved'
./internal/provider ./internal/cli: ok, ok.
- go test -tags nogui -count=1 -run 'Grok|grok|Plugin|Retired|Moved'
./internal/gui: ok.
Not run: the full suite, the GUI node suite, and a real Grok account.
The machine is under heavy load.
|
||
|
|
1357236917 | docs: the retired built-ins leave the gateway and account pages | ||
|
|
6da19bf181 |
provider: Factory's built-in is retired; its plugin serves it
"factory" joins retiredBuiltins: every Factory account is served by
@magpie-community/opencode-factory-auth, and the hourly MoveRetiring
moves the ones still on the built-in.
Removed: the built-in's sign-in (factory_signin.go, WorkOS's device
flow), keeping the sign-in (renew, lapse, org reconcile and mend,
headers, factoryGet), its provider and account (factoryProvider,
factoryAccount, factoryAlsoOn), its login list, switch, on/off and
forget, its usage card (factoryLoginQuota), droid's prompt and body
rewriting (factory_client.go), and its rows in signin.go, logins.go,
logins_on.go, login_usage.go, subscription_usage.go and account.go.
zcodeDecode/Encode, kept in zcode.go only for factory_client.go, go
with it. An API key always goes to the plugin now (factoryAddKey), and
`magpie accounts import factory` keeps saying to add it with accounts
add factory; its dead import branches are gone.
Kept: the mover and what it reads (factoryLogins, factorySaved,
factoryCreds, factoryMu); ImportFactoryKeys, factory_key.go and
factoryWhoami, for "Use an API key instead"; droid's model table with
factoryAPIs and factoryCore, since the plugin's provider is named
"factory" (account.go APIs, FactoryGemini and servedByFactory still
answer for it); factoryAPI for the moved provider's host
(builtinHost); factory_usage.go's limits reader behind
FactoryAllowanceForTest, which the gateway's pool tests use; the
gateway's "factory" lists (estimatedMoved, the account check), as the
Zed commit kept zed's; the parity tests.
Tests:
- git rm'd, built-in only: factory_test.go (sign-in, refresh, accounts,
orgs), factory_client_test.go, gateway factory_agents_test.go
(droid's line on every wire, the generate route to chat) and
factory_think_off_test.go (TestPluginThinkingOff covers the plugin);
TestFactoryAPIKey, TestFactoryKeyAgainReadsUsageAfresh,
TestFactoryServesModelsAddedSinceItsFetch, TestUserAgentAccountUntouched
(TestUserAgentFor still covers an account's User-Agent).
- Changed meaning: TestGeminiEmptyReplyIsAnError,
TestGeminiEmptyRepliesAskedAgain and TestGeminiImageModelReturnsItsImage
used Factory's generate route as a fake-able Gemini upstream; they now
use a Gemini API of the user's own (saveGem), the same decoder, and the
image test checks :streamGenerateContent instead of /api/llm/g/v1/generate.
TestMovedShowsBuiltinHost's first check is now a plain plugin
(fakeco), and a retired Factory with no migration record shows
api.factory.ai. TestFactoryAPIKeyMoved checks factoryLogins() is empty
instead of the removed factoryLookup. factorySite/factoryJSON moved
into factory_key_test.go.
Run in this worktree:
gofmt -l internal: nothing
go vet -tags nogui ./internal/provider ./internal/gateway ./internal/cli
./internal/gui, GOOS=darwin, linux, windows: clean
staticcheck -checks U1000 -tests=false (darwin, windows) on
internal/provider: nothing new
go test -tags nogui -count=1 -run 'Factory|Gemini|PaymentRequired|
ResetsInWords|UserAgent|UsedWindow|Vertex|PayloadTooLarge|UsageCache|
AnthropicImage|ThinkingOff|Moved|Retired|Mover|Migrat|Move|
SayTheirPlugin|Allowance|Discovery|ClaudeModels|GrokPrice|
LoopbackSignIns|AsksOwnBackend|SideLogin|Import|Accounts|ZCode|MiMo'
on the four packages: ok (all four); TestFactoryAPIKeyMoved ran with
Bun (PASS), not skipped.
Not run: whole packages, the full suite, the GUI suite (machine load
~300). Not tried with a real Factory account. docs/subsystems not
changed, as for Zed.
|
||
|
|
09b9ae8c02 |
provider: ZCode's built-in is retired; its plugin serves it
"zcode" joins retiredBuiltins, as zed and mimo-app did: every ZCode
account is served by @magpie-community/opencode-zcode-auth, and the
hourly MoveRetiring moves the ones still on the built-in.
Removed: the built-in's sign-in (startZCodeSignIn, the team sign-in and
its route/key caches), Start Plan (zcode_start.go and its blocked hint,
which account.go Explain and test.go EdgeBlocked named), its client and
prompt (zcode_client.go, zcode_prompt.json), the models list
(zcode_models.go), the OS place readers (zcode_os_*.go), and its rows in
signin.go, logins.go (list, switch, forget), logins_on.go,
login_usage.go, subscription_usage.go and account.go. Tests that covered
only that code are git rm'd (zcode_accounts, _blocked, _client,
_device, _place, _quota, _start, _startmodels) with TestZCodeAccounts,
TestZCodeTeamSignIn, TestZCodeTeamNoSeat and TestZCodeFetchModels.
Kept: the mover (migrate_zcode.go) and what it reads (zcodeLogins,
zcodeSaved, the credential store readers, zcode_device.go's
zcodeDeviceMid); zcodeOwn, the plugin's own account; the Zhipu plan and
team-seat readers planquota.go uses (zcode_team.go, zcodeCall/Get);
zcodeDecode/Encode, moved into zcode.go because factory_client.go uses
them; the gateway's zcode countOn condition and zcode_blocked_test.go
(which builds its Provider directly), as the Zed commit kept zed's; the
StartSignInAt site parameter (generic); plugin_accounts and
account_seats cases; the parity tests.
Tests whose meaning changed: TestZCodePlanKeyFromConfig and
TestZCodeOwnTeam keep only their zcodeOwn checks (the quota, Start Plan
server, provider/Sign/LoginUsage parts were the built-in's).
TestZhipuKeyTeamWindows builds the team key directly instead of signing
in through the removed team sign-in. zcodeTestJWT moved to zcode_test.go
for migrate_movers_c_test.go.
Run in this worktree:
gofmt -l internal: nothing
go vet -tags nogui ./internal/provider ./internal/gateway ./internal/cli
./internal/gui, GOOS=darwin, linux, windows: clean
staticcheck -checks U1000 -tests=false (darwin, windows) on
internal/provider: nothing new (only the pre-existing unused ones)
go test -tags nogui -count=1 -run 'ZCode|Zcode|Zhipu|Migrat|Move|Moved|
Retired|LoopbackSignIns|AsksOwnBackend|Mover|SayTheirPlugin|SideLogin|
PlanKey' ./internal/provider ./internal/gateway ./internal/cli
./internal/gui: ok (all four)
Not run: whole packages, the full suite, the GUI suite (machine load
~300). Not tried with a real ZCode account.
|
||
|
|
b98f906b10 |
provider: a retired built-in's own account is still listed for its mover
movedAgent asked PluginServes(id) since cfa262509, so once a built-in
is retired sideLogins leaves the agent's own sign-in out as the
plugin's, though nothing has moved it. The mover's out() then never
lists it: MoveRetiring doesn't move it and MoveCandidates doesn't show
it in the Move line, so a user whose only account is the agent's own
(ZCode's, Kiro's, Grok's, ...) would be served by nothing once that
built-in is retired. movedAgent asks Moved(id) again: the own row is
set aside only after a real move.
New: TestRetiredOwnAccountStillMoves retires zcode in the test and
checks ZCode's own account is in its mover's list and in
MoveCandidates.
Run in this worktree (at 488ed5895 plus this change):
go test -tags nogui -count=1 -run TestRetiredOwnAccountStillMoves
./internal/provider: red with movedAgent back on PluginServes
("ZCode's own, retired and not moved: {User: ... Own:false}"),
green with the fix.
go test -tags nogui -count=1 -run 'Retired|Mover|Migrat|Move|
SideLogin|Own' ./internal/provider ./internal/gateway ./internal/cli
./internal/gui: ok (all four)
gofmt -l internal: nothing; go vet -tags nogui ./internal/provider
for darwin, linux, windows: clean.
Not run: whole packages, the full suite, the GUI suite (machine load
~300).
|
||
|
|
30fcbf684b |
provider: Xiaomi MiMo's built-in is retired; its plugin serves it
mimo-app joins retiredBuiltins (migrate.go), the way Zed did in
c0605abc2. @magpie-community/opencode-mimo-auth serves sign-in, refresh,
models, requests and usage.
Removed: the built-in's sign-in (mimo_signin.go), its usage fetch
(mimo_usage.go), its tests (mimo_test.go, built-in only), and its
cases in signin.go begin(), logins_on.go (SetLoginOn and alsoOn),
logins.go (Logins, the side list, switch, forget), login_usage.go
(builtinLogins, quota), subscription_usage.go and account.go. MiMo had
no gateway dispatch of its own.
Kept: mimo.go holds the PLUGIN-SERVED notice ("mimo-app" and the
package name, for TestMovedBuiltinsSayTheirPlugin), MiMoID, mimoCreds,
mimoSaved and mimoLogins, which migrate_mimo.go's mover and
migrate_movers_test.go still read. The GUI's MiMo account label stays
for plugin accounts.
Run in this worktree:
gofmt -l internal (nothing)
go vet -tags nogui ./internal/provider ./internal/gateway
./internal/cli ./internal/gui ok; also GOOS=linux,
GOOS=windows: ok
go test -tags nogui -count=1 -run 'MiMo|Mimo|Migrat|Move|Moved|
Retired|LoopbackSignIns|AsksOwnBackend|Mover|SayTheirPlugin'
./internal/provider ./internal/gateway ./internal/cli ./internal/gui
ok (all four)
Not run: whole packages, the full suite, the GUI node suite (machine
load ~300).
|
||
|
|
b7ceb53fe4 |
provider: WorkBuddy's built-in is retired; its plugin serves it
workbuddy and workbuddy-ai join retiredBuiltins, as Zed did in c0605abc2 and Qoder in 43cc3171d. @magpie-community/opencode-workbuddy-auth serves both, moved or not. Removed (built-in only): - provider: workbuddy_models.go (the model list); in workbuddy.go the sign-in, token renewal, usage/credits reading, request signing and the site's model fetch; the WorkBuddy cases in account.go (Accounts), logins_on.go, logins.go (list/switch/forget), login_usage.go, subscription_usage.go and signin.go; WorkBuddyBaseForTest, now unused. - The built-in tests: workbuddy_test, workbuddy_signin_test, workbuddy_accounts_test, workbuddy_ai_test, workbuddy_body_test, workbuddy_enterprise_test, workbuddy_free_test, workbuddy_names_test, workbuddy_spare_free_test, workbuddy_refused_test (provider), and gateway/workbuddy_refused_test. Kept, and why: - migrate_workbuddy.go (the mover) with what it reads: wbSite, wbCreds, wbOwn/wbAuthPath (the desktop's file, sent as a marker), wbLogins, wbTokens (back drops a renewed pair). - workbuddy_checkin.go: the daily check-in now walks the plugin's accounts only and sends through the plugin's fetch (a.via); wbCallVia, wbNum and the site's api() serve it, and plugin_usage's host. - WBRestricted/WBRestrictedHint: the gateway reads the plugin's 11140 by them. textOnly: applied to the plugin's lists. - draw_workbuddy and search_workbuddy in the gateway: they serve the plugin's provider. The PLUGIN-SERVED notice in workbuddy.go. - The WorkBuddy agent target (internal/agent) is untouched. Tests changed in meaning: - TestFetchNewAccount, TestFetchNewRetriedSoon and TestFetchingNewOnceStarted used WorkBuddy as the built-in signed in; they use Codex now (codexSignedIn, codexListedAt), same assertions. - TestFetchPlanWithoutList uses local models; TestWorkBuddyFetchModels, TestWorkBuddyAIGLMIsTextOnly and TestOwnStoreSignInAgainDropsTheReading (WorkBuddy case) are gone with the code. - Check-in: TestWorkBuddyCheckinSignedIn is gone; the fixture's account is a plugin account signing through via; PluginUnderItsOwnID became TestWorkBuddyCheckinPluginAccounts (plugin accounts listed, a built-in login left out). TestCheckinAccountsListed reads a moved plugin. - TestWorkBuddyMover seeds the desktop's logins.json row: retired, the built-in no longer writes it, and an existing user's row is what moves (red without the row). - Gateway: the WorkBuddy draw and search tests run through the fake plugin (besideFake), without the built-in's header checks; TestWorkBuddySearchesForItsModels folded into TestWorkBuddyPluginSearches (refusal and search-off checks kept); TestLoopEndsWorkBuddysReply is the plugin route only; TestWorkBuddyRestrictedRestsHours lost its built-in translation case. Run: - gofmt -l internal: empty - go vet -tags nogui ./...; GOOS=linux and GOOS=windows the same: clean - go test -tags nogui -count=1 -timeout 45m -run 'WorkBuddy|workbuddy|Checkin|CheckIn|FetchNew|FetchingNew|FetchPlan|Migrat|migrat|Mover|Moved|Retired|Retire|SignIn|Plugin|Draw|Search|Loop|Redact|Restricted|Images|TextOnly|Qoder|BuiltinsSay|AsksOwn|Loopback' ./internal/provider ./internal/gateway ./internal/cli ./internal/gui ./internal/qoder first run: gateway, cli, gui ok; provider red on TestWorkBuddyMover (above); after the fix provider ok (99s). - Not run: whole packages, the full suite, the GUI node suite. |
||
|
|
761556a0cc |
provider: Qoder's built-in is retired; its plugin serves it
qoder and qoder-cn join retiredBuiltins, as Zed did in c0605abc2. @magpie-community/opencode-qoder-auth serves both, moved or not. Removed (built-in only): - gateway: the Qoder dispatch in gateway.go and gateway/qoder.go (the translator), with its tests (qoder_test, qoder_busy_test, qoder_cn_test). - provider: qoder_usage.go; the Accounts() loop, builtinLogins case and loginQuota branch, the Logins/side-list/switch/forget cases, SetLoginOn and alsoOn, the sign-in case, the subscription_usage fetch, and qoder in asksOwnBackend; qoderLogins(); the built-in tests (qoder_test, qoder_cn_test, qoder_free_test). - internal/qoder: codec, cosy, models, oauth, usage, userinfo, ids, store and their tests. Kept, and why: - migrate_qoder.go (the mover) and the legacy qoder.json migration it reaches through qoderLoginsOf. It now reads a pair with qoderSaved. - qoder_checkin.go: the check-in walks plugin accounts (heldPlugins). - internal/qoder/endpoints.go: the provider keys, Site/SiteOf, the Credential the mover reads and NewMachineID, with the notice. - The PLUGIN-SERVED notice in provider/qoder.go and internal/qoder. - gateway's relayStatus/retryAfterOn, which commandcode.go uses, moved to relay_status.go; the tests' qoderRoundTrip is now roundTripFunc (roundtrip_test.go), no change in meaning. Tests changed in meaning: - TestOwnStoreSignInAgainDropsTheReading lost its qoder case. - New TestQoderLegacyFileMoves: a legacy qoder.json moves through the mover and is removed. Red when migrateQoder is skipped (tried by hand). Run (machine load ~300, so narrow by request): - gofmt -l internal: empty - go vet -tags nogui ./...; GOOS=linux and GOOS=windows the same: clean - go test -tags nogui -count=1 -timeout 45m -run 'Qoder|qoder|Migrat|migrat|Mover|Moved|Retired|SignIn|AsksOwnBackend|Plugin|Afresh|Checkin' ./internal/provider ./internal/gateway ./internal/cli ./internal/gui ./internal/qoder provider ok 114s, gateway ok 201s, cli ok 18s, gui ok 12s, qoder no tests Not run: the whole packages, the full suite, the GUI node suite. |
||
|
|
e405315d79 |
provider: Cursor's built-in is retired; its plugin serves it
"cursor" joins retiredBuiltins (migrate.go), so PluginServes("cursor")
holds moved or not, and the built-in's code goes, as Zed's did in
c0605abc2 and Kiro's in the commit before this.
Removed:
- gateway/cursor.go (the Connect/protobuf translator) and its tests
(cursor_test, cursor_conversation_test, cursor_maxmode_test,
cursor_precision_test, cursor_stepusage_test), and gateway.go's
Account.Agent == "cursor" dispatch to serveCursor;
- provider/cursor_usage.go (the usage card, cursorToken, cursorKeychain)
and provider/cursor_picker.go, with their tests;
- from cursor.go: the built-in account (cursorAccount), its model list
through `cursor-agent models` (cursorModels, parseCursorModels,
cursorModelL), its sign-in (startCursorSignIn, cursorLinkWhole,
cursorLoginUUID), the API client version (CursorClientVersion,
cursorVersionFallback, cursorVersionRe) and the token refresh
(CursorToken, cursorRefresh, tokenExpiry);
- StartSignIn's "cursor" case (signin.go), the usage fetch
(subscription_usage.go), the login-list case and quota (login_usage.go)
and the account (account.go);
- "cursor" from Native (provider.go) and asksOwnBackend (modelprefs.go).
Kept, because the mover, the plugin paths or other code need them:
- cursor.go's PLUGIN-SERVED notice (TestMovedBuiltinsSayTheirPlugin);
cursorIdentity, cursorStatus, parseCursorAbout, readCursorToken,
cursorTokenOf, cursorKeychainToken and cursorAuthFile: migrate_side.go
and plugin_accounts.go ask whose account the agent is through them;
- cursorLoginURL (grok.go and claude_signin.go use it), cursorContext and
withCursorContexts (the plugin's model contexts), CursorExecutable and
isCursorAgent (the Cursor agent itself);
- cursor_models.go whole: CursorBase (agent/legacy.go), CursorVariants
(groupfast.go, the plugin's fast pick), cursorPicks and the collapse
(provider.go, models.go);
- accountIDs, builtinOrder, models.go's "cursor" live branch and
servedByCursor, as Zed's and Kiro's commits left theirs. The live
collapse and cursorPicks now only ever meet a built-in list, which a
retired Cursor never has; they are left for a cleanup of their own.
- gateway/cursor_local_models_test.go (the Cursor agent, not the
built-in) and the gateway's plugin_*_test.go parity tests.
Tests changed in meaning:
- cursor_signin_test.go became cli_signin_test.go: its two generic
runCLISignIn tests stay (grok's), TestCursorSignInJoinsAWrappedLink
goes with cursorLinkWhole.
- cursor_test.go keeps parseCursorModels as a test helper (the old
parser, for the collapse tests' fixtures); TestParseCursorModels,
TestCursorClientVersion, TestTokenExpiry and TestCursorLegacyPicks go,
and cursor_names_test.go's TestCursorAvailableNames: they tested the
built-in account's list and picks. Cursor's plugin lists its own
picker models with their efforts (index.mjs), so magpie's collapse
never runs for it; moving the two tests onto the plugin showed that.
- TestFetchNewWaitsForASlowSignIn (#1789) and
TestFetchNewListsAgainForAnAnswerWhileListing (#1147) are gone: both
were about a CLI account whose models `cursor-agent models` lists,
and no built-in left lists its models through its CLI.
- internal/gui/providers_fetching_unix_test.go
(TestProvidersAnswerWhileListsComeIn, #541) is gone: its slow vendor
was the built-in's `cursor-agent models`. The guarantee (the
Providers page answers while an account's list comes in) has no test
now; re-homing it onto an HTTP-listed account (Antigravity, Copilot)
needs exported test hooks and is left as a follow-up.
- TestNative drops its Cursor case; TestLeftAloneRunsNoCLI fakes and
expects claude and devin only; isolate() and
TestAccountDiscoveryOffReadsNoSignIn no longer set cursorKeychain
(cursorTokenOf reads the Keychain on macOS only, as before).
- Dropped as built-in only: the Cursor case of the required-tools test,
TestCodexToolImageCursor, TestCursorSplitParallelCallsKeepTheirResults.
Run at this tree (load ~300, so narrow runs only):
- gofmt -l internal: clean
- go vet -tags nogui ./... ; GOOS=linux and GOOS=windows the same: ok
- staticcheck -tags nogui -checks U1000 ./internal/provider/: clean;
with -tests=false over provider and gateway: nothing Cursor or Kiro
- go test -tags nogui -count=1 -run 'Cursor|Kiro|Migrat|Mov|Retired|
SignIn|AsksOwnBackend|Plugin|HandOver|NoWayBack|Adopt|Hide|
RequiredTools|ToolImage|Split|Discovery|Account|Isolat' over
provider, gateway, cli, gui: gateway ok 446s, cli ok 67s, gui ok 51s;
provider failed TestCursorAvailableNames, TestCursorLegacyPicks,
TestFetchNewWaitsForASlowSignIn (above) and
TestSetUpstreamNameRefusesAnAccountBackend (Kiro's, fixed in that
commit)
- every other test naming "cursor" or cursor-agent, by name, over the
same four packages: gateway and cli ok; TestNative,
TestLeftAloneRunsNoCLI, TestFetchNewListsAgainForAnAnswerWhileListing
and TestProvidersAnswerWhileListsComeIn failed (above)
- after the changes: gofmt clean, vet ok on all three; -run 'Cursor|
Kiro|Migrat|Mov|Retired|SignIn|AsksOwnBackend|Plugin|HandOver|
NoWayBack|Adopt|Hide|Discovery|Account|Native|LeftAlone|SetUpstream|
FetchNew|Hold|DailyCredits|NotSignedIn|ModelTest|Providers': provider
ok 141s, gui ok 21s, cli ok 22s (gateway untouched since its ok run)
Not run: the whole packages, the full suite, the GUI node suite.
|
||
|
|
615732af65 |
provider: Kiro's built-in is retired; its plugin serves it
"kiro" joins retiredBuiltins (migrate.go, now one entry a line), so
PluginServes("kiro") holds moved or not, and the built-in's code goes,
as Zed's did in c0605abc2.
Removed:
- gateway/kiro.go (the CodeWhisperer translator) and its tests, and
gateway.go's Account.Agent == "kiro" dispatch to serveKiro;
- provider/kiro_signin.go and its test: StartSignIn's "kiro" case, the
AWS Location redirect in the pasted-address handler, kiroFlow and its
callback branches in signin.go;
- the built-in account (kiroAccount, kiroProvider, kiroAcct), its model
list (kiroModels, kiroModelList, KiroModel), its usage card
(kiroQuotaAt, kiroLimits.windows, kiroLoginQuota, the fetch in
subscription_usage.go), and its login-list, switch, on/off, forget and
also-on cases (logins.go, logins_on.go, login_usage.go, account.go);
- "kiro" from Native (provider.go) and asksOwnBackend (modelprefs.go).
Kept, because the mover, the plugin paths or other built-ins need them:
- kiro.go's sign-in readers (readKiroAt, readKiroCLI, readKiroIDE,
kiroCred), KiroAuthOf with its refresh and profile lookup, and
kiroUsageLimits: kiroOwnUser (plugin_accounts.go) and addKiroLogin
(the legacy-file adoption kiroLogins runs) ask Kiro whose account it
is through them;
- kiro_accounts.go's homes and kiroLogins, plus kiroSaved/readKiroFile
(moved there from kiro_signin.go), which migrate_kiro.go reads and
writes; side_logins.go and cards_kept.go's Kiro key are untouched;
- the Save branch that keeps a key on "kiro": the mover takes it;
- newUUID and joinNonEmpty moved from gateway/kiro.go to gateway/uuid.go
(Devin and others use them), and the said() test helper to
gateway/said_test.go;
- kiro_accounts.go's PLUGIN-SERVED notice (TestMovedBuiltinsSayTheirPlugin).
Tests changed in meaning:
- TestKiroMover: retired, the agent's own sign-in (kiro-cli's or the
IDE's) is the plugin's to read (movedAgent, since cfa262509), so it no
longer goes in the move; the test now says so, and the own marker's
way back is checked with a literal marker.
- TestKiroBuilderIDListsItsModels became
TestKiroBuilderIDTakesItsServiceProfile: the model list is gone, the
Builder ID profile KiroAuthOf finds (for whose-account) is still
checked; TestKiroBuilderIDFoundByKirosAnswer checks the profile, not
the models.
- Dropped as built-in only: TestKiroModelList, TestKiroAccount,
TestKiroLimits' windows half, TestSaveKeepsKirosKey's account check,
TestKiroHideOwnSignIn, TestKiroHideOnlySignIn, TestCodexToolImageKiro,
the Kiro case of the required-tools test, the kiro sign-in test file,
and "kiro" from TestLoopbackSignInsTakePastedAddress.
- TestSetUpstreamNameRefusesAnAccountBackend set up a Kiro account as
its account backend; Kiro is no longer one, so it now signs Claude in
(still in asksOwnBackend) and gives "claude/*", checking the refusal
is the own-account one. Found by a later wider run (the regexp above
didn't reach it); go test -run '^TestSetUpstreamName' ok 6s.
- kiro_test.go's reader tests call readKiroAt(key, "") where they
called readKiro(key) (same result with no magpie-signed accounts).
Run at this tree (load ~300, so narrow runs only):
- gofmt -l internal: clean (after formatting said_test.go)
- go vet -tags nogui ./... ; GOOS=linux and GOOS=windows the same: ok
- go test -tags nogui -count=1 -run 'Kiro|Migrat|Mov|Retired|SignIn|
AsksOwnBackend|Plugin|HandOver|NoWayBack|Adopt|Hide|RequiredTools|
ToolImage' ./internal/provider ./internal/gateway ./internal/cli
./internal/gui: gateway ok 266s, cli ok 24s, gui ok 25s; provider
failed TestKiroMover (the own sign-in, above), fixed, then
provider ok 145s (go vet ./internal/provider ok first)
Not run: the whole packages, the full suite, the GUI node suite.
|
||
|
|
21252f6a2c |
provider: Zed's built-in is retired; its plugin serves it
The first built-in taken out (the owner, 10-16: 陆续把内置Provider下线掉, 一定要下线完毕). @magpie-community/opencode-zed-auth serves Zed for everyone now; built-in accounts not moved yet are moved by the hourly loop, or from the Providers list's line (the commit before). Removed: the built-in's sign-in (zed_signin.go and its loopback paste branch), usage (zed_usage.go), its login list, switch, forget and account cases, its own-backend case in asksOwnBackend, the gateway's serveZed and zed.go, internal/zed, and the tests of only those. Kept, because the mover and the plugin path use them: zed.go's credential and login readers (migrate_zed.go's move), zed_body.go (plugins.go), and Zed in accountIDs, side_logins, cards_kept, plugin_usage's movedCards, the gateway's estimatedMoved and the CLI's account names, which name the plugin's accounts too. Zed the editor as an agent (internal/agent, the library's MCP target) is untouched. Tests changed: TestMovedBuiltinQuiet is TestRetiredBuiltinQuiet (no Zed card, its sign-in refused, the move still offered with the account); TestZedMoveCarriesItsModels compares the models without internal/zed; TestLoopbackSignInsTakePastedAddress and asksOwnBackend's set lose Zed. AGENTS.md and gateway-routing.md no longer name Zed's built-in client. Run on this tree over af08ecb27's parent tree: - go test -tags nogui ./... -count=1 -timeout 90m: 64 packages ok, internal/gui red only in TestCoreScriptBudget (the Move line; the budget is raised in af08ecb27). Rebased onto it: go test -tags nogui ./internal/gui -count=1: ok. - Earlier on wt6 before the three fixes: provider red in TestAsksOwnBackendAgreesWithTheGatewayDispatch and TestLoopbackSignInsTakePastedAddress (Zed still named), fixed here. - gofmt -l internal: nothing; GOOS=linux and GOOS=windows go vet -tags nogui ./...: clean. - GUI: retired-move, plugin-move, deprecation-notice and deprecated-subscriptions, both engines, en and zh: 20 pass. |
||
|
|
0f1666b387 |
provider: a built-in can be retired, its plugin serving it moved or not, and its unmoved accounts get a Move line
The owner (10-16) wants every deprecated built-in taken out of magpie,
one at a time. This is the ground for that; it retires nothing yet.
- retiredBuiltins / BuiltinRetired(id) in migrate.go name a built-in
whose code is gone. Only an id with a mover can be retired.
- PluginServes(id) is Moved(id) or retired. Every gate that asked
Moved(id) asks it now: sign-in, Factory keys, usage, logins, cards,
forget, accounts, check-ins, plugin sign-in, the CLI's accounts and
providers, the GUI's account label.
- A retired row's move.state is plugin, and its id is in onPlugins
once the plugin is installed.
- /api/providers lists a retired subscription's built-in accounts that
haven't moved in `unmoved` (MoveCandidate, now with the failed move's
error and why). The GUI shows a quiet line over the Providers list
for each, with Move / Try again (unmovedLine), in en, zh, zh-TW, ja
and de.
- AGENTS.md and docs/subsystems/provider-plugins.md say what a retired
built-in is.
Run at 270aa1c9c with this change:
- go test -tags nogui ./... -count=1 -timeout 90m: 66 packages ok.
- gofmt -l internal: nothing. GOOS=linux and GOOS=windows
go vet -tags nogui ./...: clean.
- GUI, both engines, en and zh: retired-move (new, 4/4), plugin-move,
deprecation-notice, deprecated-subscriptions, plugin-move-unserved,
plugin-movable-review, i18n-keys: 39 pass.
- TestRetiredBuiltinIsThePlugins -count=20 (it picks a mover at random).
The Move line is the Providers list's own, not a page that could be a
plugin. It took the core's scripts to 1,427,218 bytes, which the budget
main raised in
|
||
|
|
1acd79cdfc |
usage: a compaction window picked past the leanest band isn't called the leanest, and offers the band (yapechan on Discord)
yapechan (Discord #general, 10-17 05:21Z): after picking another auto-compact
threshold outside the cheapest range, Context still said "已是最适合你用法的
最省配置"; they asked for the hint to change and for a button that sets it.
Cause: /api/tune does read the value the user set (TuneRead -> Current). With
the agent's compactions timed, tune.Compact's advice never waits longer than
the window now, so a larger window comes back as its own advice (best ==
current) and the row's chip said "Already the leanest". A probe of
tune.Compact on TestCompactTimedWaitsLeast's fixture: 400K picked -> best
400K at +16% tokens over the cheapest (250K); 1M -> best 1M at +96%.
Fix (context.js, adviceRow): the leanest band is the curve's windows within
3% of its cheapest, tune's own sameCost. A timed row whose window costs over
3% past the cheapest now says "Not the leanest: {band} spends the fewest
tokens" (info chip, not the green one, also when magpie set the value), keeps
the caveat, and has a "Use {value}" button for the band's largest window, the
one of them that compacts least; its tooltip says it means more compactions
to wait on. A window inside the band still says it is the leanest, with no
button. Untimed rows are unchanged: their "same" already means within 3%.
New strings in zh, zh-TW, ja and de.
What was run (macOS, load average 300-375 throughout):
- New test context-tune.test.cjs "a window picked past the leanest band isn't
called the leanest": both engines x 5 languages x 360/1100px, 92/92 pass
for the whole file at this head. Broken by hand: old context.js -> FAIL
"expected 'Not the leanest: 230K–270K…' actual 'Already the leanest…'";
band test made unreachable -> same FAIL in WebKit; chip class back to
"applied is good" -> FAIL "expected 'ctx-chip info' actual 'ctx-chip good'".
- GUI files run one at a time, all ok: context-picks, context-scroll-end,
context-text, context-tune, context-window, gui-de, gui-ja, gui-zh-tw,
i18n-keys, usage-range, account-alias, account-arrange.
- Whole GUI suite NOT completed: a combined run of all 794 files died
partway (2358 test points, 37 not ok, all page.goto/90s timeouts in
unrelated pages under the load); a per-file rerun did ~33 files in 30
minutes and was stopped. Its two reds (account-alias, account-arrange,
timeouts) pass alone.
- gofmt -l: clean. go vet ./..., GOOS=linux and GOOS=windows go vet -tags
nogui ./...: clean.
- go test -tags nogui -timeout 45m ./... under pipefail at 161030972 (this
change on
|
||
|
|
45b8c725cf |
gateway: a legacy /responses/compact carrying another account's native compaction goes to that account, or is refused saying why (#2727, ggbdpq)
codexBackend's /responses/compact relayed to Codex's sign-in (or, with the sign-in paused, compactOn's account) before any seal check, so a compact whose input carries a compaction magpie recorded another account as the writer of reached an account that can't read it, and Codex got the backend's bare 400. Now sealedCompact judges it, as /responses already is (codexSealedFor -> serve, #2642): the writer on in magpie answers it, signed as the writer (codexUpstreamOn); a writer gone (signed out, lapsed, paused, switched off, kept from the model) is refused 400 with checkpointError's reason; the sign-in's own seal, a key's seal, a request naming its own chatgpt-account-id, and a sign-in state magpie can't read relay as before. Two Team seats of one email still read as one (the record holds the email). Review fix on top of ggbdpq's 781381f4: a gateway key held to some accounts (#905) was checked (compactSigninHeld) against the sign-in before the compact was handed to the writer, so a key held to me@ spent the writer biz@ (acct-2 asked, 200), and a key held to biz@ was refused 403 "goes through the account Codex is signed in to" though the compact would go to biz@. The hold is now asked of the account the compact goes to; a writer the key may not use gets 403 sealedCompactHeldError naming the writer, with nothing asked. The test's fake backend now records under a lock. Reviewed and run (reviewer, at this commit with the #2739 commit under it, on 89521b03d; rebased after onto origin/main, see the last line): - Each fix broken by hand, TestNativeCompactionCompactJudgesItsWriter: M0 codex_backend.go as on main: 3 subtests red (writer answers, gone refused, compactOn gone). M1 the key '#' skip dropped: "a seal a key wrote is not judged" red (400). M2 the chatgpt-account-id skip dropped: its subtest red (400). M3 the writer never relayed to: the healthy-writer subtest red (backend saw ""). M4 gone never refused: 2 red. M5 judged after compactOn's relay: the compactOn subtest red (backend saw acct-2). Each green with the code restored. - TestNativeCompactionCompactKeepsTheKeysAccounts (new) on ggbdpq's 781381f4: red both ways ("200, the backend saw acct-2" for a key held to me@; 403 "goes through the account Codex is signed in to" for a key held to biz@). Red again with the hold put back on the sign-in; green with this change. TestGatewayKeyAccountsHoldCodexCompact and TestGatewayKeyCompactOnCodexAPIKey still pass. - -race -count=3 on both tests: ok. - gofmt -l clean; go vet ./... and -tags nogui (darwin), GOOS=linux and GOOS=windows go vet -tags nogui ./...: clean; go build, GOOS=linux go build -tags nogui, GOOS=windows go build: ok. - Full suite, set -o pipefail, go test -tags nogui -count=1 -timeout 45m ./... at 519bcc843 (both changes, on |
||
|
|
0eab029ea7 |
provider: a ChatGPT account's turn is zstd-compressed with at most Codex's own 2 MiB window, not 8 MiB (#2739, pc418)
codexZstd (internal/provider/codex_zstd.go) set no window, so klauspost's
encoder declared its default 8 MiB (and, single-segment, up to the body
size below that) on every turn magpie re-compresses for the ChatGPT
backend: the accounts loop (forwardOnce), the native relay
(codexUpstreamOn) and warm-up all go through CodexCompressed. Codex's own
client never sends that: openai/codex ce0323f2
codex-rs/http-client/src/request.rs compresses with
zstd::stream::encode_all(Cursor, 3); zstd 0.13.3 (Codex's Cargo.lock)
copy_encode streams through Encoder::new(dest, 3) with the size unknown,
which libzstd 1.5.7 gives level 3's windowLog 21 (2 MiB). pc418's
15,173,526-byte image-heavy turn got 400 in the 8 MiB frame and 200 at
2 MiB; a later replay of the 8 MiB bytes was taken, so this matches the
client's envelope rather than proving a backend limit. Level and checksum
are unchanged. Cost: a large turn is bigger on the wire at 2 MiB with
SpeedDefault (pc418's turn 7.59 MB -> 12.44 MB; libzstd -3 gives 9.78 MB).
Reviewed and run (reviewer, at this commit on
|
||
|
|
5a2414acdd |
plugins: every built-in plugin starts on, a new install's too
The owner (10-17): "所有的内置插件默认都应该是开启的", "尤其对新用户来说…… 不然新用户都不知道有哪些功能". Since |
||
|
|
1e643ba7e1 |
provider: a model listed by its display name ("GPT-6 Sol") joins the group magpie found for gpt-6-sol (Chill on Discord)
Chill added a provider "Only through routing groups". Its Claude models
(tidy ids) were filed into the groups magpie found, but a model the relay
lists as "GPT-6 Sol" was not grouped with gpt-6-sol.
Cause: autoGroups buckets models by mergeKey, which is sameModel: it
lowercased and turned "_" into "-" but kept spaces. "gpt-6 sol" and
"gpt-6-sol" were two buckets of one provider each, so no group held
them, though the group id (Slug of the key) was auto-gpt-6-sol for both.
Siblings checked: AutoGroupOf (and AutoStandIn, reseat and group import's
Instead through it), GroupFor and groupNamed already compare by
Slug(sameModel(..)) and were right; setModelSame's "its own id" check and
the editor's Merge placeholder (MergeName) use sameModel raw and get the
same fix. Group Match patterns are the user's own globs, not a name
match, and are unchanged.
Fix: sameModel spells a run of spaces (a no-break one too), "_" and "-"
as one "-", after dropping the vendor's prefix. Every word still counts,
so gpt-6, gpt-6-mini, gpt-6-sol and gpt-6-sol-mini stay apart, as do a
:variant and a four-digit release. Two ids now merged already had the
same auto-… id, so no saved group id or agent config changes.
Not done on purpose: OpenAI's dashed date (gpt-4o-2024-08-06) is not
stripped. sameModel strips YYYYMMDD and Ark's YYMMDD, but keeps release
suffixes that are models of their own; an OpenAI dated id is a pinned
snapshot apart from the moving alias, and stripping it would change the
id of a group magpie has found for years (auto-gpt-4o-2024-08-06) that
agents and saved groups name. The test pins it apart.
Test: TestSameModelDisplayNameAsID (sameModel spellings, pairs that must
stay apart, and Chill's case end to end: provider x with gpt-6-sol and
gpt-6-mini, provider y Unlisted with "GPT-6 Sol", "GPT 6", "GPT-6 Sol
Mini"; auto-gpt-6-sol has x/gpt-6-sol and y/GPT-6 Sol, no other found
group forms, AutoGroupOf and GroupFor agree). With group.go put back it
fails: sameModel("GPT-6 Sol") = "gpt-6 sol", and auto-gpt-6-sol: [] false.
Docs: providers-accounts.md's Routing groups row says what the same
model is.
Run at this head (sandbox HOME, pinned caches): gofmt -l clean;
go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
-tags nogui ./..., go build: ok.
Full suite: go test -timeout 45m ./... at
|
||
|
|
48aae83b82 |
gateway: what Jev is told of a turn is masked unless Jev itself may have it unmasked
A routing group whose every member the user set to go unmasked
(unredactedRoute, provider.SkipsRedaction) hands its rules the body as the
agent wrote it. That was right for the members, but a group's Jev is none
of them: askJev sent the message, and since the commit before also the
user's message before it and the reply, to a remote decision provider
unmasked. The chat-model classifier was not affected (it goes through
serve, which masks).
askJev now masks the state's three texts with maskedText (maskedState)
unless Jev's own provider skips redaction, and fails closed when the
masker can't serve, as redacted does. Found by the agent writing the
commit before, on reading unredactedRoute's callers.
TestJevIsToldTheTurnMaskedWhenTheGroupGoesUnmasked: both members
Unredacted on local addresses, mask personal data on, an email in the
message and the one before; no state value Jev gets holds it. Broken by
hand (the SkipsRedaction check made `false &&`): red, "previous_user_message
went to Jev unmasked". gateway-routing.md says it beside unredactedRoute.
Full suite at bf2018807 (
|
||
|
|
6b5501027d |
gateway: Jev is told the user's message before and the reply to it, so a short follow-up routes like its turn (@HirotaNagai on X)
A follow-up like "继续", "yes" or "fix that" was classified alone, so it routed as a trivial turn. The decision classifier (Jev's state and the chat-model classifier's prompt) now also gets previous_user_message and previous_assistant_reply, when present. - Taken from the same parsed request as the classified message, after the gateway masks it, so the new fields are masked the same way. The answer cache key includes them. - The reply is the text of the latest assistant message after the previous user message. Never thinking, tool calls, tool results or system prompts; a tool-only reply gives nothing. - Caps: the message keeps 3000+1000. The previous user message is cut to its first 750 and last 250; the reply keeps its last 1000. Together at most half the message's cap. - The intent, level and effort instructions name the keys only when they are present, as context, not the thing being judged. Tests: TestTurnBeforeEachProtocol, TestTurnBeforeCuts, TestJevIsToldWhatCameBefore, TestChatClassifierIsToldWhatCameBefore, TestClassifyKeepsAnAnswerPerTurnBefore, TestJevSeesTheTurnBefore. Each was broken by hand and went red (10 breaks: reply taking thinking or tool arguments or a tool result, searched past the user message, no caps, jevState dropping the keys, priorAsk naming both always, writePrior not called, rules.go not setting prev, a cache key without the turn before, privacy off in the end-to-end test). Run at |
||
|
|
6690caaaec |
gateway: auto mode's review isn't asked of another subscription's Claude model, and Claude Code's set model is judged where it goes
Claude Code 2.1.302 tells a session behind magpie "this session isn't eligible because your requests go through 127.0.0.1:3425" and points the gateway at code.claude.com/docs/en/auto-mode-classifier-billing. That page asks a gateway to forward the dangerous-tool-use-2026-09-03 beta and the top-level `safeguards` field, and to return `safeguard_results` (message_delta.delta in a stream) with tool-use ids unchanged; one that can't should have clients set CLAUDE_CODE_AUTO_MODE_SERVER=0. magpie already does this on every route Anthropic answers (Claude subscription bridge, api.anthropic.com, relays, Bedrock, Vertex) and writes the 0 when no reachable model is reviewed ( |
||
|
|
c4aeaec740 |
provider: moved Cursor users get opencode-cursor-auth 0.2.19 (plugins #207)
The cursor mover's min goes from 0.2.18 to 0.2.19 (plugins 0a2496b,
nicegui's #207): when one step sends two different native tool counts
before any output and before a result was submitted, the plugin
rebuilds once from the history instead of failing the turn as
"inconsistent native tool count". keepMovedCurrent updates every moved
Cursor user to it.
npm view @magpie-community/opencode-cursor-auth version --prefer-online
shows 0.2.19.
Run at
|
||
|
|
72ed518bca |
gateway: an account's own list of models no longer refuses a ChatGPT account's GPT Image (heyiwei5 on X)
heyiwei5 on X: a Codex routing group's agent asked Magpie Image for
codex/gpt-image-2 and was told 403 "model "codex/gpt-image-2" is set not
to be served by any account or key of Codex: each one's own list of
models leaves it out. Add it to an account's models in magpie
(Providers → the account's Models)". That advice can't be followed: an
account's own list (#474) is picked in the editor from the provider's
chat models, and a ChatGPT account's GPT Image (like a Grok
subscription's Grok Imagine and a WorkBuddy plan's image models) is
never among them. So any account list kept for some chat models turned
every drawing away.
drawOnAccounts now treats those accounts as not listing the image model
(asked after those that do) rather than barred, for providers whose image
models magpie names itself (listsCantName: drawsCodex, drawsGrok,
drawsWorkBuddy). A capped account is still held. A key's own list, which
is picked from models that include its image ones (a relay's
gpt-image-2), still bars them, as nonchat_keys_test checks. Videos don't
go through account lists for Grok, so nothing to change there.
Run:
- TestCodexDrawsPastAccountModelLists on origin/main
|
||
|
|
be36009363 |
provider: moved Qoder and Qoder CN users get plugin 0.2.18 (plugins#179, plugins#185)
The qoder movers' min (shared by qoder and qoder-cn) goes from 0.2.16 to 0.2.18, so keepMovedCurrent updates every moved user's opencode-qoder-auth: - 0.2.17 (plugins#179): the daily check-in through auth.checkin. - 0.2.18 (plugins#185): a trimmed or wrapped 10605 is the model's queue busy, not a lapsed sign-in. npm view @magpie-community/opencode-qoder-auth@0.2.18 version --prefer-online printed 0.2.18 before the change. The checks run on the pushed head, which holds this commit, are in the DeepSeek search commit's body. |
||
|
|
d432920f02 |
search: DeepSeek's Search API as a search API vendor (TJHHHH on Discord)
DeepSeek's own Search API (api-docs.deepseek.com/guides/search) can now be added as a search API, with a DeepSeek API key: - provider.SearchVendors: deepseek, at https://api.deepseek.com, keys at platform.deepseek.com/api_keys, offered after You.com. - askSearchAPI: POST /v1/tools/search, Bearer key (the default), body {query, count: searchHits}. The query is cut to the 128 characters the docs allow (a longer one is a 400); need_content stays false. - readSearchAPI reads its summary (the docs' text "for a model", ~600-800 chars) as the page's text, since content is empty without need_content; its snippet stands in when there is no summary, and its date (RFC 3339 or null) is the page's age. Other vendors' fields are read as before; summary and snippet are only fallbacks after content. - 402 (no balance) and 429 (5 QPS per account) already rest a key as out of credit and rate limited (searchRestFor); the test pins it for deepseek. - Siblings: CLI usage (main.go, search_cli.go's api list and empty-state hint), README.md, README.zh-CN.md, gateway-routing.md's path list. The GUI takes its vendors from SearchVendors (no vendor list in app.js or i18n), so no GUI file changes. Not tried against the real DeepSeek API (no key in this run); the fake is built from the docs' response shape, with null site_name/date and empty summary/content. Note DeepSeek bills direct API calls ($0.75 per 1,000 non-empty searches). Run (worktree on origin/main |
||
|
|
b5c76935b9 |
provider: moved Factory users get plugin 0.1.33 (plugins#158, plugins#198)
The factory mover's min goes from 0.1.31 to 0.1.33, so keepMovedCurrent updates every moved Factory user's opencode-factory-auth: - 0.1.32 (plugins#158): each model carries droid's token multiplier, given to magpie as its rate, with a running promotion's discount struck through. - 0.1.33 (plugins#198): the update-config skill entry Factory refuses is adapted in a system prompt's configuration section too, including claude-code-guide's "- /update-config:" form. npm view @magpie-community/opencode-factory-auth@0.1.33 --prefer-online printed 0.1.33 before the change. Run at this commit's tree, with the DeepSeek search commit on top: see that commit's body for gofmt, go vet (darwin, linux, windows) and the full go test -tags nogui -timeout 45m ./... run on the pushed head. |
||
|
|
89521b03d6 |
cli, gateway: magpie cpu records the running magpie's CPU profile for 30s, for a report of high CPU (@LeiCheng42 on X)
@LeiCheng42 on X reports magpie using the most CPU while Codex runs. As with magpie heap ( |
||
|
|
2042123f43 |
provider: a provider switched off for a while stays in the groups magpie found, so agents on auto-<model> aren't rewritten to the one left (#2671)
timonwong (#2671, with the branch this is): a found group, auto-<model>,
was built from the providers that are on only, so switching off one of
its two providers took the group away. Every agent on group/auto-<model>
was reseated to the other provider's model (agent.Reseat → sameModel),
rules and groups naming it went 404, and switching the provider back on
brought the group back but not the agents' settings.
timonwong's change, ported as is (05927b833, 063fe15a2):
- models.go: entriesOf(of, off), and heldOffEntries(), the models of the
providers that are Ready and Off (a keyless one, a plugin not signed in,
finds no group), held per request like the other entries.
- group.go: foundGroups/foundFrom merge those back in the Providers order
before autoGroups, in groupsIn, DeleteGroup and RenameGroup. membersIn
already skips a switched-off member, and the Routing page already says
it as switched off (memberJSON.providerOff).
- A removed provider still leaves the group; NoAutoGroups and
ModelSameAs are honoured; a hidden found group stays hidden.
Side effect: a found group whose only usable member is left shows while
a provider is off, which is the point.
Reviewed line by line; nothing writes a user-set value, and Reseat now
has nothing to move for these agents, so there is nothing to restore when
the provider is on again.
Added here: TestReseatKeepsAFoundGroupWithAProviderOff (internal/agent:
Claude Code and Hermes on group/auto-gpt-5 are not moved when cop is
switched off, a model only cop served still is, the group resolves, and
switching cop on moves nobody) and TestFoundGroupMemberOfASwitchedOffProvider
(internal/gui: auto-x is on the Routing page with b/x said as switched
off). The docs row names the tests.
Red on bf931f82c's provider code (models.go and group.go from main): both
new tests, timonwong's TestFoundGroupWithAProviderOff (404 as in the
issue) and the updated TestProviderOff. Broken by hand (heldOffEntries
returning nil): the agent and gui tests and TestFoundGroupStaysWithAProviderOff
and TestFoundGroupRemovedWithAProviderOff go red.
Run at this change on
|
||
|
|
992f288e20 |
gateway: a Chat-only relay that refuses tools with reasoning and none too moves a group on (#2670, JJ-Lin)
JJ-Lin's analysis in #2670 found both causes and gave the mock upstream the tests use. A relay with a Chat URL alone answers tools with reasoning_effort with "use /v1/responses or set reasoning_effort to 'none'", and then refuses none ("Supported values are: 'low', ..."). - forwardTranslated: when none was #176's own and is refused naming the levels, offRefused is still remembered (it is true of the model), but the request isn't asked again at the lowest level (refused the same by the upstream's own word). The tools refusal is the answer. The #176 retry is gated on turnedAway(none) plus a per-request guard, so it can't loop. Before: the first request went [xhigh none low] and every later one [high], with the 400 going to the agent. - passthrough (a chat client's relayed request), the sibling: the same. It used to ask none on every request and hand back the confusing "'none' is not supported" error. - shapeRefused/retryable: a 400/422 that wrongEndpoint reads reaches the group only once the member has tried every API it has a URL for. The next member is now asked once, and this one doesn't rest (failShape). Before, the group stopped on it. - The agent's error still names the Responses URL the provider lacks (wrongAPINote via asksResponses). Reading supported_endpoint_types from /v1/models was left out: wrongAPINote already says what to set, and trying Responses on the Chat base unasked isn't clean. - docs/subsystems/gateway-routing.md says both. Plain chat without tools, and gpt-6-astra (where none is taken) are unchanged; TestToolsEffortNoneTaken pins both ([effort none] -> 200 three times in a row; no-tools [xhigh] -> 200). Tests (internal/gateway/tools_effort_none_test.go, JJ-Lin's mock): - TestToolsEffortNoneRefused: one Server, Codex xhigh/high/high asks [xhigh none], [high], [high]. Each answer is the tools refusal with the Responses-URL note. A chat client gets [high none], [high]. - TestGroupPassesOverToolsRefusedOnChat: group relay -> other. Three requests in a row are all 200 from other, tries[0] is failShape, no rest. Broken by hand: - fallback.go reverted: the group test is red (400 to the agent). - translated restore off: "request 1 asked [xhigh none low]". - passthrough check off: the chat client gets "'none' is not supported". - turnedAway gate off: "request 2 asked [high low]". Without the per-request guard too, it loops forever (seen, killed). Run on origin/main |
||
|
|
50a7031902 |
test: TestVisionWaitIsntTheDescribersTime gives the describer 2s, not 300ms, so a loaded run doesn't turn it red (#2444, ump45nose)
The test queues an image description behind a held request for twice the describer's limit, then needs the description back within that limit once the lane opens. At 300ms the fake's answer itself came in late on a loaded machine and on CI (main |
||
|
|
e183604f06 |
claude: a tool named with a dot comes back under the name the client declared (#2649)
tsy0716's client offers a tool named "spawn.agent". Through a Claude
subscription the reply's tool_use called "spawn_agent", a tool the client
never offered: Claude Code keeps only [A-Za-z0-9_-] of an MCP tool's name,
and magpie handed the call back under the name Claude Code used.
The MCP helper now offers each tool under bridgeToolName: a name Claude
Code keeps as it is (and at most 51, 64 with mcp__magpie__) is unchanged;
any other, or one ending as a changed name ends (_ and 12 hex digits), is
cut to 38 of [A-Za-z0-9_-] and given 12 hex digits of its SHA-256. So
"a.b" and "a_b" stay apart, and the name is the same in every run: a
resumed session, the history told to a new run (renderParts) and the
tool-choice line (toolChoiceAsk) name it as the run was offered it.
subscriptionRun.names maps it back to the declared name in toolStart (Claude
Code's streamed and whole messages, so every API the bridge serves) and in
mcpCall (what an agent like Cursor is told through onCall). A name Claude
Code already kept goes upstream exactly as before.
What was run:
- New TestClaudeToolNamesComeBackAsDeclared: tools "spawn.agent",
"fs/read", "has space", an 83-character name, "a.b" and "a_b", through
/v1/messages, chat/completions and responses, client stream on and off,
Claude Code's reply streamed and whole (12 cases); a fake Claude Code
that changes names as Claude Code does and calls every tool it was
offered. Checks the client gets exactly the declared names, and Claude
Code was offered six valid, unique names of at most 51; and the history
and tool-choice text use the offered name.
- Broken by hand: with the encoding taken out the test fails; with only
the decoding in toolStart taken out, every case fails ("the calls name
[a_b a_b_2e7336dc8eba fs_read_96379919f693 ...], want the declared").
- go test -run 'Claude|Bridge|MCP|Mcp|Tool' ./internal/gateway/
./internal/claudebridge/: ok.
- gofmt -l clean; go vet -tags nogui ./... on darwin, linux, windows: ok.
- Full suite at this head (8b1fad8f5 before the message change), as
recorded in the #2651 commit: ok but three timing reds outside this
change (#2719, #1889, and one fixed on main by
|