3d2567915417e144d0fd01debce690400fa8a0aa
2493
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3d25679154 |
accounts: a setup-token pasted into the Claude import is added as one, not taken for a refresh token
liukaybee on X asked whether the token `claude setup-token` prints can be pasted into Providers > Claude > Import accounts. It couldn't: the paste box read every bare line as a refresh token, and a Claude one with no email failed with "the file doesn't say which Claude account this is". parseLoginImport now reads each bare line (and a JSON string) through bareImport. A line that is a setup-token (sk-ant-oat..., bare, as CLAUDE_CODE_OAUTH_TOKEN=... or export CLAUDE_CODE_OAUTH_TOKEN="...") is checked by checkClaudeSetupToken and added by AddClaudeSetupToken, the same path as "Add an account by setup-token...": kept in logins.json, named by its hash, nothing asked of Anthropic. One magpie already has is "exists", twice in one paste is "in the files twice", an sk-ant-api key pasted there is refused as an API key. In the ChatGPT import a setup-token is refused as Claude's and never sent to ChatGPT's token endpoint. Refresh-token lines and JSON files in the same import work as before. No result row carries the token; nothing here logs. Run (mica, mica-run): - TestImportClaudeSetupToken red on origin/main's login_import.go (#2..#5 failed, setup-token lines "doesn't say which Claude account"), green with the fix. - go test ./internal/provider -run 'Import|SetupToken|Login': ok - go vet ./internal/provider: ok - go test -timeout 45m ./internal/provider ./internal/cli: ok, ok - gofmt -l internal/provider: clean Not tried: a real setup-token pasted in the real app (the add path it calls is the existing one, itself not tried with a real token). |
||
|
|
56c988cb5e |
gateway: /v1/realtime passes a Realtime API session on to its provider (Qwen Token Plan's realtime voice)
gaubeebangeel (X) set up Qwen's Token Plan in magpie and couldn't use its
realtime voice: magpie had no /v1/realtime, so the WebSocket upgrade got a
404. Token Plan does cover realtime: qwen-audio-3.0-realtime-plus at
wss://<plan host>/api-ws/v1/realtime?model=… with the plan's sk-sp- key,
OpenAI Realtime events
(platform.qianwenai.com/docs/token-plan/best-practices/realtime-voice).
GET /v1/realtime and /realtime upgrade to a WebSocket after the same Front
guards as every route (lanGuard, corsGuard, keys, the rebinding check),
plus a same-origin check on the socket's Origin. The model resolves as on
the other routes (a bare id unlisted anywhere goes to the one DashScope
provider that is on), with key, model and account holds, and each try is
dialled in turn with the account's key. A DashScope base ending
/compatible-mode/v1 dials /api-ws/v1/realtime; any other base dials
base+/realtime (OpenAI). Frames go both ways as they are; a close goes on
with its code and reason. Text frames are masked going up and restored
coming down (audio appends and deltas are not), failing closed. Each
response.done's usage is recorded as a "realtime" call (cached input as
cache read). openai-insecure-api-key / organization / project
subprotocols never go upstream. Shutdown ends open sessions with 1001.
/realtime is a client route on magpie web's port (and in the LazyCat
manifest), and a read-only key is refused it.
Run (mote, at this tree):
- TestRealtime* (fake upstream WebSocket, no network): Token Plan path,
echo, binary, close both ways, usage 60 in / 40 cache read / 20 out,
OpenAI-style path, subprotocol filter, masking; guards: 426, 400, 404,
Origin evil/null/localhost subdomain 403, rebound host, remote without
key 401, key held to another provider 403, vendor 401 passed on.
- Broken by hand, each went red: subprotocol filter removed, masking off,
cached tokens not subtracted.
- GOOS=linux and GOOS=windows go vet ./internal/gateway: clean.
- go test -count=1 -timeout 45m ./internal/gateway ./internal/masking
./internal/gui: the first run found TestClientPathCoversHandler,
TestReadOnlyKeyEveryRoute and then TestLazyCatManifestListsTheClientRoutes
red, all fixed here and rerun green. Otherwise ok. The log has one
recovered "close of closed channel" in continuation_test.go:781's
doneHold fake upstream (a test fake this change doesn't touch; in both
runs), already filed as #6505 (and its duplicate #6690).
- Rebased on origin/main
|
||
|
|
afd2df09b9 |
gateway: a Copilot Gemini conversation past the model's 10 images goes on with its oldest left out (yuushabu_buyinn on X)
Copilot refuses a Gemini request whose conversation holds more images than
the model takes ("too many images: maximum allowed for model
gemini-4-carbon is 10, got 12"), and it counts every image in the
conversation, not one message's. A long chat with screenshots stopped
working for good.
Now, on that 400 from a Copilot account, the gateway learns the cap the
error states (per provider and model), replaces the oldest images outside
the latest user message with a one-line placeholder until the count fits,
and sends again once. Later turns are fitted before they are sent. A
request under the cap is never changed. If the latest user message alone
is over the cap, the refusal is passed on as it came. Other vendors are
untouched (imageCapped: Copilot accounts only).
The cap is learned from the 400, not from /models' max_prompt_images:
Copilot lists 1 for gpt-* and 5 for Claude models but took 3 images on
gpt-4.1 and 7 on claude-sonnet-5 live, so the list is enforced only for
Gemini and would strip images that are fine.
Run (suite at the pre-rebase tree 4649e2269; after rebasing on
|
||
|
|
b9c385286b |
agent: the disconnect preview reads no sign-ins, so macOS never asks "Keychain Not Found"
jasonz3g on X (macOS, two Claude accounts): clicking Claude Code on the Agents page made macOS ask "Keychain Not Found — A keychain cannot be found to store …" (Cancel / Reset To Defaults), dozens of times. The Agents page loads a disconnect preview each time an agent's box shows: DisconnectPreview runs Disconnect on a copy, in a subprocess whose HOME is a temporary folder. Claude Code's Disconnect builds the model list (buildModels -> CatalogFor -> provider.All -> Accounts -> rememberLogins -> liveLogin), which read the Claude sign-in with `security find-generic-password`, and Cursor's too. On a Mac the keychain is found through HOME, and the temporary one has none. With a copy of real ~/.claude and ~/.config/magpie, the dry run ran security three times under the temporary HOME, started Devin's CLI there, and rewrote held/lapsed in the copy's logins.json. previewEnv now sets MAGPIE_NO_ACCOUNTS=1, which every keychain read and write, liveLogin and askClaudeStatus already honour. The dry run of the same real copy then runs no security and no CLI, and the agent's ~/.claude files come out byte for byte the same as before (diff -r), so the preview shows the same changes. Run: - TestDisconnectPreviewReadsNoSignIns (new), red on the old code (security find-generic-password -s Claude Code-credentials ... twice), green after; its second half checks the fixture does reach the keychain out of the dry run. - go test ./internal/agent -count=1 -timeout 45m: ok on mica (macOS) and on WSL Ubuntu (magpie-desktop); GOOS=linux and GOOS=windows go vet ./internal/agent ok; gofmt -l clean. - Real binary, dry run of `claude` on a copy of real ~/.claude and ~/.config/magpie with logging security/claude stubs: 3 security calls before, none after. Not tried: the GUI dialog itself (no display over ssh); the reporter's own accounts. |
||
|
|
50f7a8e01f |
routing: a Smart row behind one renewing sooner says so; Smart says new conversations go there too
YsiCing on X: in Smart, every conversation went to one Codex account (pro,
74% of its week) while Business and team, both at 0%, said "已用 0% · 会话留在另一个账号" ("0% used · the conversation stays on another account").
That is what Smart is meant to do. It sends every request, new
conversations included, to the one account whose quota renews soonest, and
only Stays: Session or Strict spreads new conversations. But the row blamed
a kept conversation, and the Smart description said "one account at a time"
without saying that covers new conversations, plus "at 90%", which is wrong
for a week since
|
||
|
|
1aa348d145 |
gateway: Claude Code's /advisor works through a Claude subscription (#6804, #6813)
The Claude subscription bridge runs the real Claude Code with magpie's
tools only, so Claude Code's advisor (Anthropic's server tool
advisor_20260301) was read like a translation without one: dropped from
the request and its instructions rewritten to "The advisor tool is no
longer available". /advisor did nothing (recih on X, #6813; swordencao's
group advisor, #6804).
bridgeRequest now reads a Claude Code request whose advisor model magpie
serves (advisedInBridge: provider.Resolve takes it, groups and [1m]
included) as readAdvised does: Request.Advisor is set, the instructions
stay as Claude Code wrote them. The run is offered advisorToolDef beside
magpie's tools; mcpCall answers a call by asking the advisor model
(adviceRound, 55s), and the client is told a server_tool_use and an
advisor_tool_result as Anthropic's server tells it, max_uses_exceeded
past three a reply. Claude Desktop and an advisor magpie doesn't serve
go as before. Nothing about the request's identity changes: the run is
still the real Claude Code, and the advisor tool goes to no upstream.
adviceFor, shared with the vendor route, now cuts Claude Code's advisor
instructions from what the advisor model is asked (advisorCut). With
them, or advisorGone in their place, the advisor answered as the executor
that it had no advisor; seen in the reporter's exact #6804 run.
Not changed: Claude Code's Code Mode (read in 2.1.325) needs ANTHROPIC_BASE_URL
on api.anthropic.com, first-party auth with no auth token or helper, and
a GrowthBook flag; no gateway can serve it without faking Anthropic.
Run:
- go test ./internal/gateway -run 'Advis|ClaudeTUIAdvisor|BridgeRequest'
ok (mote). Red on the old code: TestBridgeRequestKeepsTheAdvisor
("the advisor is \"\""); with advisorCut a no-op,
TestAdvisorServedForAVendorModel and TestClaudeTUIAdvisorAnsweredHere
("the advisor was told of itself").
- go vet ./internal/gateway on darwin, linux, windows; go test
./internal/gateway -timeout 45m at 7abbfac34 (rebased on origin/main
2026-11-16): ok, 946s (mote). At d54abb292, rebased on
|
||
|
|
b1dd96ab14 |
agents: a client of a Remote magpie starts its agents on the remote's models and follows them (KoiLx0 on X)
KoiLx0 runs several computers on one remote magpie and had to set every agent's models again on each of them, and again whenever the remote changed. Routing groups already reach a client (a group is a model of the remote's list, TestRemoteMagpieNewGroupServedBesidePicks); the agents' picks did not. - The remote tells, per connected agent, each model field's catalog ref at GET /v1/magpie/agent-models (gateway.SharedAgentModels, agent.SharedModels). Guarded as the Library is: this computer, or a full-access key of a magpie shared on the network; a held key is refused (readonly_test), and another machine without a key gets 401 (TestNetworkGatewayGuardsEveryRoute). - An agent connected here starts on those picks where this magpie lists them as <remote id>/<ref> (How "remote", after "again" and "joined"; the Agents page says "as on the remote magpie", in all five languages). - A field taken from the remote, or found on its pick, is recorded in the stash and follows the remote's change every 5 minutes (FollowRemotePicks from library.KeepLinked). A model picked here is the user's: the record goes, and the field is left alone until it is on the remote's pick again. A pick this magpie doesn't list is skipped. - app.js budget: no raise. The new line's 76 bytes come from same and alike sharing one string (CONN_WAS) and the native joined case returning plain instead of the same t() again. Run at this head (rebased on |
||
|
|
c38753a7ee |
search: Settings can ask every search API at once, results merged (heyiwei5 on X)
The search APIs are asked in order: the next only when one fails or
finds nothing. Asking several together, with their pages merged and
repeats dropped, has existed since #2845 but only through
`magpie search mix`. Settings › Models › Web search now has an Advanced
fold, shown with two or more search APIs on, holding "Ask the search
APIs: In order | All at once". All at once marks every API on as mix
(POST /api/settings/search-api {"mix":[...]}, provider.MixSearchAPIs);
In order clears the marks. In order stays the default. A mix of some of
the APIs, set from the CLI, opens the fold with neither choice on and
names the APIs it asks.
Run (mote, at this tree):
- go test ./internal/gui -count=1: ok.
- TestSearchAPIsMixedFromSettings at origin/main's api.go: build fails
(searchAPIJSON has no Mix), so it is red on the old code.
- node --test search-mix, search-count, search-api, i18n-keys:
72/72 pass, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 560px.
- search-mix.test.cjs at origin/main's assets: 0 of 30 pass (red).
- gofmt -l: clean.
- After rebasing on
|
||
|
|
b010fba05b |
gui: the pages go in the reader's own order, in the sidebar and a phone's tab bar (chet030714 on X)
Settings › General › Sidebar pages, where pages are hidden, now also puts them in order: a row is dragged by its grip (shown on hover, always on a touch screen), or moved with Alt+↑/↓. The order is kept for this browser in localStorage magpie.navOrder, beside magpie.navHidden. The sidebar and the header's tabs follow it at once, and a phone's tab bar (phonetabs.js) shows the first four with the rest under More. Providers is listed (it can be moved, never hidden). While the order isn't the home one the sidebar's group names (Work, Models, ...) are left out, since a reordered list breaks the groups; Default order (shown only then) removes the key and puts the pages and their names back. A page the kept order doesn't name (new in an update) goes after the page it follows at home. Plugin pages keep their place in their group. A reader who never reorders sees nothing change. navOrder and navArrange live in the new navorder.js, imported by navHides only once an order is kept (and by navpages.js with the menu), so what is left in app.js is that one line: +107 on both core budgets, explained there. old-webkit's list of on-demand scripts names navorder.js. Built on the unpushed WIP 10b9ee22c (page-order worktree), cherry-picked onto origin/main; the WIP test clicked the aria-disabled Providers row without force, and its reload checks now wait for the async import. Run: - nav-pages-order.test.cjs (new): Chromium and WebKit, en/zh/zh-TW/ja/de, 10/10 pass. Red on origin/main (no menu opens), 5/5 chromium. - The whole GUI suite (make test-ui) on mote at the first, inline version (navArrange ran on every start; the final version runs nothing new for a reader with no order), stopped after 4,171 ok / 171 not ok, none in a nav, sidebar or phone file. Five of the red files (agent-switch-accounts, gateway-key-arrange, first-untick, data-folder, api-key-theme) rerun on mica at this tree and at origin/main |
||
|
|
c1ab9a4946 |
gateway: an input item a Responses upstream has no type for is translated, and a compaction refused so is asked as text (cyberestro on X)
cyberestro on X: a Codex subagent on a local Qwen server's Responses API (qwen, http://127.0.0.1:30010/v1) got "compaction: qwen (qwen, …) answered the summary request 400 Bad Request: qwen: Unsupported input item: agent_message". agent_message is the item Codex's MultiAgentV2 hands a subagent its task in (author, recipient, input_text content, as #5259's and plugins#61's requests carry it). Two gaps, both fixed: - The compaction's fallback for an input kind refused (inputKindRefused, #5181, #5259) read only "unsupported_input_item" and "unknown item type". inputKindWords now reads "unsupported input item" with spaces too, so the summary is asked again with the conversation as text, the agent_message as the user's turn (itemText), then compacted locally. - The normal path relayed every subagent turn to the same server with the agent_message as Codex sent it, and gave the 400 back. passthrough now treats that refusal, on a request carrying an item other than a message, function call, its output or reasoning (hasOtherItem), like a custom tool refused (#2656): the model is marked (inputKindsRefused) and the turn is translated on the same API, where agent_message is the user's turn and a custom tool call a function call; later such turns go translated at once. A native compaction or sealed task still gets the refusal, and magpie's own summary ask (inCompaction) keeps its text fallback. Run (mote, mica): - New tests on the old code ( |
||
|
|
c867a12c5b |
claude: a client sending earlier turns' images back still goes on in its run
Yqihotaru (X) keeps a long conversation on claude-opus-5-5 through the
bridge, and their client takes the images of earlier turns out of some
requests and sends them back in others: the log's image count flips
between 2 and 4, every turn says "no run here has had this conversation",
and a new Claude Code starts from a transcript each time, so the prompt
cache is lost every turn.
lostMedia (#1382) took only images taken out, and looseTurn compared the
last turn alone with the whole history before it hashed exactly. Now
mediaMoved compares the conversation one role's run of messages at a
time, either way (images taken out, or put back where nothing or a line
of text stood). follows uses it for tool results; looseTurn keeps the
whole conversation and its settings apart, and rewrote takes a request
with the same settings whose images alone moved, in any turn. A sealed
tool result keeps the last 2KB of its words so one sent back without the
client's line is told from one changed otherwise.
Run (mica): go test ./internal/gateway (whole package, -tags nogui,
-timeout 45m) ok; go vet, GOOS=linux go vet -tags nogui, GOOS=windows go
vet of internal/gateway ok; gofmt -l clean. Rebased on origin/main
|
||
|
|
3ad5b93d41 |
provider: a Gemini model id with a slash keeps it in the request path (#6695)
A custom Gemini compatible provider's namespaced model id (example/model-demo) was asked at /models/example%2Fmodel-demo, since GeminiPath escaped the whole id. A relay that routes by literal path segments answered 403 Invalid URL (POPOBE97 in #6695, LuoRuiyao on X). GeminiModelPath now escapes each segment and keeps the slashes, so the request goes to /models/example/model-demo:streamGenerateContent. An id with an empty, . or .. segment, which a server could clean into a path outside models/, still goes as one escaped segment. Google's own ids (no slash) give the same bytes as before. Siblings made to agree: Vertex AI's VertexPath, VertexWholePath, its model test and the Claude rawPredict path (a slash id there goes to partner chat completions, so only the pinned test changed), the plugin Code Assist path in plugins.go and Gemini image generation in draw.go, both of which put the id in raw before (a ? or space broke the URL). Run (on mote): - red on the old code (old provider/gateway files, a shim for the new helper): TestGeminiModelPathKeepsSlashes FAIL `GeminiModelPath("example/model-demo") = "example%2Fmodel-demo"`; TestGeminiNamespacedModelKeepsItsSlash FAIL `status 403, asked [/v1beta/models/example%2Fmodel-demo:streamGenerateContent?alt=sse]`. Both pass with the change. - gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go build for darwin, linux (nogui), windows. - go test -tags nogui -timeout 45m ./...: all 101 packages ok. Not tried: a real relay that routes by namespaced id, or a real call to Google's endpoint (its paths for slash-free ids are byte-identical, held by the test). |
||
|
|
13e8002641 |
claude-desktop: two providers' Claude model read "Opus 5.5 · agy-cli", not the id's tail (onkashiko on X)
Claude Desktop names a row listed as magpie-<n>.anthropic.claude-opus-5-5
after its own catalog ("Opus 5.5"), whatever display_name says, so
agy-cli's and another provider's claude-opus-5-5 read alike and Desktop
5.11492 told them apart by the part of the ids that differs: "Opus 5.5
(…<n>.anthropic.claude-opu…)" (xVn/wVn in its app.asar). Only an
inferenceModels entry's labelOverride comes before the catalog's name,
and Desktop never suffixes such a label (keep in xVn).
magpie now writes the profile's inferenceModels, each row's display_name
as labelOverride, while two rows are named after one Claude model of
Desktop's catalog (desktopNamesClash), not only while a tier is picked.
The ids are unchanged. As with a tier's list, Desktop reads it at start
and its menu stays as listed until the next start; the Agents row's
Restart shows.
desktopNames' own fallback for two rows display_name still leaves alike
(one provider's models named alike) is now the model's id, "Z · D (z2)",
not the whole catalog id; two providers of one name keep the catalog id.
Claude Science takes the same names.
Run (mote, at origin/main
|
||
|
|
023a563735 |
install: the Windows install dialog says the download can be deleted
@jiangshangmuyun on X updated on Windows and found a new magpie while "the original is still there". That is by design since |
||
|
|
9dcec67513 |
archive: the request archive in an S3 bucket is kept under a GiB, oldest calls removed
An R2 user on X: the sync bucket grew by 18 GB in under a month. The
backup and usage files are small and rewritten in place; what grew was
the request archive, every call written whole (bodies up to 32 MiB) as
archive/<date>/<id>.json and never removed. The archive on this computer
is capped at a GiB; the one in the bucket had no cap.
Now the bucket's archive is held to RequestArchiveMB (a GiB unless set,
carried by sync), down to a tenth under it past the cap, oldest first:
- only keys of ArchiveName's own shape under <prefix>/magpie/archive/
are counted or removed; the backup, usage, other prefixes and anything
else in the bucket are never touched (a test seeds seven such keys);
- uploads are counted as they go, and the bucket is listed again only
after a tenth of the cap more is uploaded: one LIST for ~1000 calls,
never one per call;
- the serving magpie lists once two minutes after it starts, archive on
or off, so a bucket grown before this update is brought under the cap
without the user doing anything (auto-cleanup chosen over a button:
the objects are magpie's own, already capped locally, and a removal
is logged);
- the Usage page's switch tooltip says the size ("…in <bucket>, up to
1.1 GB"), in every language; the core script budget is kept, not
raised: the two tooltips share one options object and the switch's
aria-checked is set from a boolean.
The Nov 3 rise in Class B reads has no code cause found: archive reads
are click-driven only, and the backup's conditional GET runs every 3
minutes per computer online.
Red on the old logic (bucketAdded and KeepBucketArchiveBounded made
no-ops by hand, on mica): TestRequestArchiveKeptUnderItsSize "after 200
calls the archive holds 248 calls, 7629310 bytes, over its 1048576 (48
from 2020 left); 0 LISTs, 0 DELETEs"; TestBucketArchiveBroughtUnderIts
SizeAtStart keeps 30 calls / 3000 bytes; TestBucketArchiveListedPer
TenthUploaded "0 LISTs". With the fix: "200 calls: 44 kept, 986389
bytes; 4461157 bytes uploaded, 39 LISTs, 203 DELETEs".
Run at this tree (rebased on
|
||
|
|
c6a67dd412 |
gui: the Windows main window is resized from its edges again (Puremilk_chun on X)
Since 0.1.4274 ( |
||
|
|
2ad38c8b3e |
provider: Baidu Qianfan's ended console sign-in asks for a new one in the editor, and a renewed cookie is kept (yuushabu_buyinn on X, #5860)
yuushabu_buyinn asked for AccessKey + SecretKey in place of the console cookie, which expires. Baidu has no such route. Its documented OpenAPI has no read for a Token Plan Personal: - the Qianfan API catalog (doc/qianfan/s/Smownk4en): 量包 v2/charge?Action=DescribePackageResources lists token packs by series, with no Token Plan; - Finance's API (doc/Finance/s/ojxecslph): bills, balance, orders, vouchers; - the Token Plan Enterprise's seat APIs (tokenplan?Action=... DescribeTeamSeatUsageDetail), which take an API key and are for team seats only. The Token Plan Personal doc (doc/qianfan/s/Dmrabu8b6) shows usage only on the console's 我的订阅 page. So the cookie stays, and what is mended is what happens when it ends: - Before, a session the console refused showed "Signed out of the Baidu Cloud console" on the card, while the provider's editor still said "Signed in" with only Sign out. Now the kept sign-in is marked ended (qianfanSession.Ended, set the first time only, and not when a newer paste has replaced the cookie the read used). /api/providers says qianfanPlan.ended, and qianfanplan.js draws "Baidu Cloud ended this sign-in. Bring a new one:" above the bookmarklet and paste steps. A new paste, or a later read the console takes, clears the mark. - A cookie the console sets in a reply that read the plan (on the resource's path) is merged into the kept Cookie header as a browser would: replaced in place, added, or taken out when deleted or expired (mergeQianfanCookies). A session Baidu renews as it is used then stays the one magpie holds. The paste check keeps what its reply set too. The StepFun sibling (the same "still Signed in" gap, drawn by renderStepPlan in app.js) is #6808. The Qianfan fix adds no app.js bytes. Run (mote, at |
||
|
|
f64c7e54f1 |
provider: a Remote magpie's cards, limits and router go with its client certificate (#6413)
hhdaxia on X (0.1.4258), and Linsenx in #6413 with a patch: a Remote
magpie behind mTLS, with Client certificate and Server CA set on the
provider, answered model calls, but Usage → Overview's read of its
cards went without the certificate. The remote's TLS refused it, and
the 403 was then shown as "remote magpie isn't shared".
Two causes, both fixed for the class:
- magpie's own requests to a Remote magpie built their context without
p.Via, so they missed the provider's proxy, client certificate,
Server CA, unchecked TLS and pin. Via now goes in at the three choke
points every such request goes through:
- remoteBodyAs: cards, refresh, quota history, Codex reset, Library,
version/update, the root /v1 that finds the MCP router;
- askRemoteKeyLimit: a key's limit;
- waitRemoteList: the model list's wait.
The Library server for a Remote magpie's MCP router (/mcp/magpie/hub)
is checked and called through checkTransport. That transport now goes
through ViaRemoteMagpieAt, which applies the Remote magpie provider
whose address matches.
- Every 403 without a key code was read as "isn't shared". remoteRefused
now gives that only when the remote says "shared on the local
network", which every not-shared 403 the gateway writes says. Any
other refusal (magpie's own client-certificate 403, a proxy's page,
an empty body) is shown with its status and the remote's own words,
or names a client certificate check or a proxy in front.
Model calls, the connection test, sign-in and the cert peek already
carried Via; a grep of every NewRequest to a remote address found no
other route.
Tests:
- TestRemoteMagpieOwnRequestsShowClientCert: a real httptest TLS server
with RequireAndVerifyClientCert and a cert from mtls.Store. It checks
cards, quota history, key limit, root and list wait.
- TestRemoteForbiddenSaysWhatRefused: 403 bodies for not shared (JSON
and lanGuard text), magpie's client-cert text, an nginx page and an
empty body, through both remoteBody and askRemoteKeyLimit.
- TestRemoteMagpieRouterShowsClientCert (library): CheckServer on the
router behind mTLS is refused with the CA alone and ok with the
provider's certificate.
- fakePeer's 403 now writes the gateway's real not-shared message.
Run:
- At origin/main
|
||
|
|
b34243823e |
routing: accounts' resets stay in their column, and resizing over many accounts is smooth (lexrus on X)
lexrus on X: on Routing's Accounts and keys, at some widths "resets in
3h" ran over the next column and the right column's words were cut, and
with many accounts dragging the window's edge was janky.
Overlap: the window parts' widths (--wk/--wv/--wr) were taken from the
widest window of the whole list, so one provider's long reset pushed
every row past its column. They are now per provider, and CSS caps each
part to its row.
Jank: the list was CSS columns, and the browser balanced every row again
on each layout. packActs (plugins/routing/client.js) places each
provider's box (and a long box's rows) itself under .rt-acts.packed with
--px/--py: down a column and on into the next, ends as level as a binary
search on the cap allows, a heading never last in a column. It runs on
the window's resize, on render, and a frame after a box's height changes.
Side mode (min1150, beside the requests) is unchanged: one scrolled
column, nothing placed. Measured on mote with a 100-row fixture, per
resize step: WebKit layout 26.6ms -> 5.9ms, frame p90 35 -> 18ms;
Chromium layout 8.24ms -> 2.86ms.
Test: routing-account-windows-fit.test.cjs, 4 and 20 Codex accounts, en
and zh, Chromium and WebKit, widths 420-1600: no window part runs past
or is cut, a provider's lines start together, the list isn't CSS
columns, boxes sit inside the list in column order without overlapping,
2+ columns at 700-1099. Broken by hand: the old assets are red on the
overlap; packing turned off is red ("the list isn't CSS columns").
gui-shell.md says how the columns are placed.
Run on mote at this change on origin/main
|
||
|
|
3b643f3978 |
provider: a Claude sign-in read mid-write on Windows is no sign-out
xbpb6 on X (0.1.4281, Windows 11, TUI mode): the account Claude Code is signed in to said "Sign-in required" with "can't read the allowance"; signing in again fixed it for a while, then it came back. Claude Code on Windows writes .credentials.json and .claude.json through a temp file and a rename. Go's os.ReadFile opens without FILE_SHARE_DELETE, so while magpie reads the file the rename gets EPERM. Claude Code then truncates the file and writes it in place (xO in its writer). A read in between finds the file empty or cut short. - rememberLogins took that read as a sign-out. claudeLoggedOut marked the Held account lapsed with claudeLogoutLapse, which breaks the rule that a failed read means unknown. - The account then read as not in use. Then claudeSavedDir, which has no Held check, could copy Claude Code's own sign-in into claude-accounts/<id> for a warm-up, a usage read or a request. Two Claude Codes then held one rotating refresh token, so whichever refreshed second signed the other out for good. That is why the account comes back as signed out again and again. Now: - claudeSignInUnsure reads the files again. The account counts as signed out only if the file is gone, Claude Code emptied it, `claude auth status` says logged out, or no account is named. A file that can't be read or isn't whole JSON is unknown for up to claudeUnsureGrace (2 minutes). - Meanwhile, rememberLogins doesn't lapse the Held account, and Logins and renewLogins keep it active. - claudeSavedDir refuses a Held account with errClaudeHeld, whose text is not one ClaudeSignInRequired matches. - The Mac keychain path is unchanged. Run: - TestClaudeHalfWrittenSignInIsNoLogout was red on the old code on mote, in two ways (logs kept). An empty credentials file gave Active:false with claudeLogoutLapse, the screenshot's state. claudeSavedDir put the Held account in .config/magpie/claude-accounts/7f327d2462d8fb58 with no error. Green after. - mote: go test ./internal/provider ./internal/gateway -count=1 -timeout 45m: ok, 142s and 913s. - win-run (xiaomi-gpu, Windows 11): TestClaudeHalfWrittenSignInIsNoLogout, TestClaudeAccountsOutliveLogout and TestClaudeSwitchIsNoLogout pass. - gofmt -l is clean. GOOS=windows and GOOS=linux go vet ./internal/provider pass. Not tried: - No real Claude account on Windows. The EPERM rewrite was read from Claude Code 2.1.316's source, not watched. - No full ./... suite. - A Claude Code killed mid-refresh on Windows is not covered. |
||
|
|
35face90f3 |
gateway: thinking.display goes to a Claude only (StudyingPython on X)
pi-ai, DeepSeek Harness's client, sends thinking {type, budget_tokens,
display: "summarized"} for every model it lets reason (and adaptive with
display for some). magpie passed display through to non-Claude models on
an Anthropic route, and Alibaba Cloud's Anthropic endpoint (Bailian and
its Coding Plan) answered a Qwen request with 400. The reporter saw it
around compaction, which dsh can move to another model.
withoutForeignDisplay drops thinking.display when the body's model is
not a Claude (claudeVersionOf, or "claude" in the name). It runs in
forwardOnce's Anthropic block after adaptiveThinking, so Anthropic's API,
the Claude subscription and relays serving Claude models keep display
"summarized" (#1485). The provider's own fields go on afterwards, so a
display the user forces there ("!thinking") is still sent.
Run (mote, at this commit on
|
||
|
|
ff5a7dfc03 |
lessons: one full suite per machine moves into the code standards
Seen a third day:
|
||
|
|
ada0125303 |
providers: Antigravity's accounts move to agy-cli in one click (@tongzhenbao on X)
@tongzhenbao asked whether accounts signed in on the old Antigravity plugin (opencode-antigravity-auth, withdrawn since |
||
|
|
64c4261582 |
sessions: search what was said in every agent's sessions, from the page and an MCP server
cryingLiu on X asked to search the chat history of every agent magpie
reads sessions from: prompts and replies, from one place.
What the user gets:
- The Sessions page's search also lists, under the agent's own list,
the other agents' sessions whose conversation says the words, each
with a snippet. A hit opens the conversation in the sheet at the
message that said it (transcript?find=), with "N earlier messages
not shown"; the page itself never scrolls. While the index is still
being built the head says "Indexing sessions…" or "Indexing N of M
sessions…", and the page asks again every 3s until it is done.
- Magpie Sessions, a built-in MCP server in Library → MCP (Discover),
opt in per agent like the other magpie servers. Its tools are
search_sessions(query, agent?, limit) and read_session(id, around?),
both returning text. It runs as `magpie mcp sessions` over stdio and
reaches the gateway's /mcp/magpie/sessions, which serves only local
callers that are not browsers.
How it works:
- internal/sessions/said_index.go keeps said-v1.db beside sessions.json:
a contentless SQLite FTS5 index (detail=none) of the words each
session says. It is built from the sessions list sessions already
caches and refreshed at most every 10s: a new or rewritten file is
read once, a grown Claude Code or Codex file only from where it ended,
and a gone one is forgotten. A query asks the index which sessions
have every word, then reads only those files for the snippet, for at
most 6s. A search waits up to 2s for a refresh. While the first
listing is still running the answer says `listing`, so an empty first
answer is not read as "no session says it".
- Privacy: only agents sessions.Reads allows are indexed or searched;
nothing is read until the user has answered the sessions question,
and in gateway mode no agent's own files are read (the page doesn't
ask). Reset forgets the index.
- /api/sessions/said for the page; the CLI parity list names it.
Run, at this tree (rebased on origin/main
|
||
|
|
103eff4d44 |
routing: a group's model is dragged by its row, not only by its number (NovaStudiosss on X)
NovaStudiosss on X: "the models added to a routing group should be draggable with the mouse; I move them often and Up/Down each time is not handy enough". A member could already be dragged since |
||
|
|
e34228669c |
library: agy's GEMINI.md is no longer emptied by Antigravity's app switched off
vizmoe42 on X (v0.1.4271): Library -> Instructions had agy CLI's
GEMINI.md switched on, but ~/.gemini/config/GEMINI.md held nothing.
agy and Antigravity's app share that file (and its folder). With the
built-in agy the targets run agy first, then Antigravity; agy wrote its
part and the unticked Antigravity row, wanting nothing, took it out
again, leaving the file empty or gone. The unticked row also showed
"edited". With agy on its plugin the order is reversed, so it worked by
luck there.
syncInstructions now takes every target. A file another target reads
too belongs to the one switched on (instrOwner): the others leave it
and drop their own record. The Edited check compares against that
owner's text (wantedIn). The path itself is right: agy 1.5.9 reads
~/.gemini/GEMINI.md, ~/.gemini/AGENTS.md and their config/ copies
(binary strings and `agy changelog`, sandbox HOME). MCP and skills in
the shared folder already behaved; probed, unchanged.
Existing users: agy's record says written but the file has no block,
so the next start-up Sync writes it, without switching anything again
(covered by the test).
Run:
- TestAntigravitySharedInstructionsFile (agy and antigravity subtests),
red on the old code (file empty after the switch; agy row Edited),
green with the fix, on mica.
- go vet ./internal/library; go test -count=1 ./internal/library
./internal/gui ./internal/tui ./internal/cli: all ok on mica.
- At the pushed head (rebased on
|
||
|
|
2d106b5c1a |
LESSONS: a gone check that looks past made-up text moves into the code standards
Seen a third day: on 11-15 TestMoreKinds' "ops" was in the made-up
user name zpxopsat (ubuntu CI at
|
||
|
|
dd77094ca2 |
gui: on Windows the header is the window's title bar (258a14 on X)
With a wallpaper, Windows' main window had a white native title bar over
the page, cut off from it ("内容区域和标题栏有割裂感"). On Windows the main
window is now frameless (mainFrameless), as the Mac's header already is
the title bar: the page and its wallpaper run to the top edge. Wails v3's
frameless window keeps WS_OVERLAPPEDWINDOW, so the shadow, Windows 11's
rounded corners, snap (Win+arrows, drag to an edge) and Wails' resize
edges stay. The header draws minimise, maximise/restore and close at its
right (#wincap, wincap.js, imported in that window alone), Windows-sized
with Segoe Fluent Icons, in the theme's colour, Close red on hover
(.1s ease); the header's refresh and pin sit left of them and stay
no-drag. A double click on what drags the window maximises or restores
it. The app tells the page when the window is (un)maximised (captionJS),
which swaps the glyph and its tooltip and keeps Wails' resize edges off
while maximised so the corner pixel is Close's. The buttons stay over a
dialog's scrim (wincap.js undoes modalBackground's inert on them). The
Mac, Linux, the tray panel and the web page are unchanged.
TestCoreScriptBudget: +27 on both budgets for the one import line in
app.js, past the 29 bytes of room there were; the rest lives in
wincap.js and app.css.
Run (mote, at this tree on origin/main
|
||
|
|
256910f174 |
plugin: Antigravity's plugin keeps serving whoever has it, and is given to nobody new
The owner (11-15): "正在使用的继续正常,加个提示,新用户不让下载". Google suspends accounts it sees on Code Assist through Antigravity's own client, so |
||
|
|
8f3f7a46af |
provider: Baidu Qianfan's Token Plan Personal shows its month through a console sign-in (yuushabu_buyinn on X, #5860)
A Qianfan Token Plan key tells nothing of the plan's usage: Qianfan's
OpenAPI has no read for it, and the console's own page asks
console.bce.baidu.com/api/qianfan/charge/tokenPlanPersonal/resource with
the signed-in cookie. So the plan is read as StepFun's Step Plan is: the
editor of a provider at qianfan.baidubce.com/v2/tokenplan/personal has a
"Token Plan usage" field, drawn by the same renderStepPlan (now told
whose sign-in it brings) from qianfanplan.js, imported when such an
editor opens. The bookmarklet, run on the console, checks the session
with that same request and copies the console cookie; a raw Cookie
header or a copied cURL is taken too, since document.cookie leaves out
HttpOnly cookies. The paste is checked with a real read before it is
kept, by provider id, in qianfan-auth.json (0600, lastgood-guarded,
moved and dropped with the provider). POST /api/qianfan/{id}/session and
/signout serve it.
The Usage page's card (qianfanPlanQuotas in PlanQuotas) is the running
plan's credits (billingMode credit) or tokens as one Month window up to
expiresAt, the plan's tier as its name and auto-renew beside it;
released and past plans are skipped, and routing reads the same windows
(accountPlanWindows). A redirect, 401, 403, an HTML page or a refusal
naming the login is a signed-out session: an error card saying so, never
0 left; any other failure is an error card too, the last reading kept
only on a passing network error. The per-plan apiKey in the console's
reply is never kept, logged or shown.
Not done: the Enterprise (team) plan has no card. The console has no
tokenPlanTeam/resource; it reads team plans through seat and admin APIs.
Not tried with a real account: no one here is signed in to Baidu Cloud's
console, and #5860 has no reply bytes posted. The fixtures follow the
field names in the console's own script bundle and in the
dsh-qianfan-token-plan reader (planType, resourceStatus, billingMode,
usedCredits/totalCredits, usedTokens/totalTokens as numbers or strings,
expiresAt, autoRenew), not a captured reply.
core budget +35 (app.js and core): the field moved to qianfanplan.js;
what is left in the core is the import and two quotaError lines.
Run (at the pushed tree, rebased on origin/main
|
||
|
|
261f482260 |
gui: Disconnect and quit puts the agents back for the next start, which connects them again (jtbbtnt54249 on X)
jtbbtnt54249, on LolingVerse's agy thread: "很多都这样,退出有时候又要重新开启".
Several agents' switches were off after quitting magpie and had to be
turned on again by hand.
Looked for a shared path that flips agents off. The row's switch is
Wired() alone, and nothing automatic disconnects an agent except a
removed plugin, the gateway pause (which reconnects on resume) and
Put agents back when quitting (which reconnects at start). The quit
question's Disconnect and quit, though, ran each row's Disconnect,
which leaves the disconnectedKey mark: every agent it listed stayed off
at every start after, and RewireOnStart skips a marked agent. Users
choose it so their agents work while magpie is closed, not to leave
magpie for good.
Now Disconnect and quit posts quit/disconnect (quitDisconnect), which
runs agent.RestoreOnQuit on the agents the question lists: their own
files back, no mark, recorded in quit.restored, so the next start's
RewireOnStart connects them again, the setting on or off. This covers
every agent the question lists: every detected agent wired to magpie,
built-in, plugin and WSL ones alike. A failure answers an error naming
the agent and magpie stays open. Its tooltip says magpie connects them
again when it opens (en, zh, zh-TW, ja, de).
Run at this tree (parent
|
||
|
|
99a54fa874 |
agent: agy's own /model pick no longer costs settings.json its model, and each thinking level is a model in agy (LolingVerse on X)
agy's /model writes its pick into settings.json ("model": "magpie/…")
even when started with --settings magpie-settings.json. The next Sync's
migrate took that for an older magpie's wiring and put back the old
stash: a stale model and "modelProvider": "gemini", or nothing, which
took the user's own model and provider out. That is the wrong restore
point the reporter saw. While magpie-settings.json is already on one of
magpie's models, such a pick is now moved into magpie's file (what agy
starts on next), and settings.json's model goes back to the one
connect.was kept when magpie was switched on, or out. The old stash is
no longer read for it.
agy 1.5.9 turns /effort away for every custom model, one with a
thinkingLevel too. A custom model's thinkingLevel takes low, medium or
high, and agy sends it as generationConfig.thinkingConfig.thinkingLevel,
which the gateway already asks over the row's effort (agyLevelAsked). A
model with two or more of those levels now has a custom model per
level, magpie/<ref>:<level>. The row's model field shows such a pick as
its model, so the switch stays on (agyLevelOf).
Run:
- TestAgyOwnPickKeepsSettings is red on the old agy.go. The levels part
fails with "level low:". The pick part, with the levels cut out,
fails with settings.json {"model":"stale","modelProvider":"gemini"}.
It is green on the new code.
- go test -count=1 ./internal/agent ./internal/cli on mote: ok (agent 259s, cli 67s) at base
|
||
|
|
139a6be2bb |
gui: a pin in the title bar keeps the main window on top (NovaStudiosss on X)
NovaStudiosss wanted to watch Usage and Routing while working in other apps. The main window's toolbar now has a pin between Refresh and Settings. A click keeps the window above other apps' windows (Wails SetAlwaysOnTop through POST /api/window/ontop?on=1|0) and saves it as settings.json's onTop, which this computer keeps for itself (KeepOwn, not synced). makeMain opens the window pinned on the next start, and boot.js shows the pin pressed before the first paint. There is no pin in the panel, in a browser's page (magpie web) or under Wayland, where always-on-top is ignored (GDK_BACKEND=x11 keeps it). A refused pin goes back up. Tooltips "Keep on top" and "Stop keeping on top" are in every language. A Settings save keeps onTop (settingsapi.Merge), which a test showed was lost before. Run (rebased on |
||
|
|
a80a920f56 |
gateway: a turn on a Codex WebSocket says where its time went
buhaodeshiyehao on X (Codex through Lody's ACP): the Routing page's
"Where the time went" showed only the request's masking. Codex's turns
to the ChatGPT backend, and to a Responses provider with Socket, go over
a WebSocket (codexSocket), and every turn of a conversation after its
first goes on the kept socket. No HTTP request went out that the try's
client trace saw, so TryNet was nil and the page had nothing but the
masking to show. A new socket's turn had TryNet from its handshake only:
the 101's wait read as the vendor's, and the backend's real wait went
into "First token".
codexSocket.turn now tells the request's client trace of the turn as
Go's client tells it of an HTTP request (socketTrace): on a kept socket
GetConn and GotConn (reused), on a new one GotConn once the handshake is
answered (its DNS, connect and TLS stand; its round trip is the wait for
the connection), WroteRequest once the message is written and
GotFirstResponseByte at the first frame. Both callers' traces get it
(gateway.go's routed tries and codex_backend.go's own sign-in), and so
does the usage record's sent/own split, which kept-socket turns lacked.
Test: TestSocketTurnTellsWhereItsTimeWent, Codex's own sign-in and a
Responses provider with Socket, a new socket then the kept one, a 200ms
hold before the first frame. Red on the old code (new socket: Wait 0.4ms
for the 200ms hold; kept socket: no timing), green with it (Wait ~201ms
on all four turns).
Run on mote at this tree (base 9bcdcfb7d; rebased onto
|
||
|
|
30de93e9e9 |
plugins: a request whose Bun is still downloading fails at once and fails over (#6735)
hixonchan (kyrierekkok123-del on GitHub): with magpie's own Bun missing and its download stalled, every plugin-served request hung with zero bytes, nothing in the log, no timeout and no failover, and `magpie plugin` hung too. The host's lock (hostMu) was held across Bun's download, which had no bound on the whole, so every caller waited on it whatever its context said. Now: - Bun is downloaded in the background, once at a time per Bun (bunready.go). The host waits for it up to 10s from when it began (bunReadyWait); then each call ends with BunNotReadyError, "Bun runtime not ready: downloading Bun 1.4.2 (12s so far)…" or "… failed: <why>", logged, and the gateway goes on to the group's next member. - A failed download is said at once for a minute, then tried again; installs (plugin.Bun) still wait as long as their context lets. - hostMu is a channel lock that a caller's context can end (LockCtx); the gateway's TryLock polling loops use it. - When the download fails, a Bun on PATH or in ~/.bun/bin is taken if magpie would run it itself: at least BunVersion, not set aside, passing the try a new release gets. It is copied in as magpie-bun (#1048). magpie's checksummed build stays first; the user's own Bun is better than no plugins, and it is what the reporter fell back on by hand. - Each stage is logged: download started, failed after N, downloaded in N, the PATH Bun taken or refused and why. - Every route through the host gets it: fetch, loader options, sign-in, the plugin listing (CLI and GUI). `magpie plugin` prints the list and the not-ready reason within ~10s. Self-restart and env (the reporter's point 4): Reexec, RelaunchBinary and StartBeside pass os.Environ; only the Mac's bundle relaunch (open -n) starts with LaunchServices' env. Filed as #6757, not changed here. With this change MAGPIE_BUN isn't needed. Tests (each red on the old code with a shim for the new test hooks, logs kept): - TestHostWhileBunDownloadStalls: old code, "a caller whose context ended still waits on the stalled Bun download"; now not-ready at 2s, the 100ms caller returns, then the host starts on the download, asked once. - TestHostAfterBunDownloadFailedSaysWhy: old code, a plain 500 error, not BunNotReady; now the 500 is said twice with one ask, Bun() retries. - TestBunOnPathAfterDownloadFailed: old code failed; now 1.4.2 taken, 1.0.0 refused. - TestPluginWhoseBunIsNotReadyFailsOver (gateway, real Handler): old code, "group/mixed still unanswered after 20s"; now 200 from the next member in 0.84s, and the plugin's own model answers 502 "Bun runtime not ready" after ~300ms. Run on mote at |
||
|
|
d7cda856ad |
library: MCP servers turned off fold away below the ones on (hzlxb on X)
hzlxb on X asked for Library -> MCP servers to keep the servers turned off apart, folded, as Providers keeps the providers turned off. The list now holds the servers on. The ones off sit below it, above "+ Add server", under a "Servers turned off (N)" fold drawn with Providers' Turned off markup (row-head off-head, .fold with the chevron, the count in .note). It is folded at first and remembered in localStorage magpie.offServersOpen, as magpie.offProvidersOpen is. A server switched off moves under the fold, and one switched on comes back up. While picking (Select) the fold is held open and disabled, so every server picked is in sight, as Providers holds its fold open while searching. The MCP tab has no filter of its own, so there is nothing else for it to hide from. With every server off only the fold shows. With none off there is no fold. Strings are in en, zh, zh-TW, ja and de. Run: - library-mcp-off-fold.test.cjs (new): Chromium and WebKit, 1100 and 420 wide, en/zh/zh-TW/ja/de. It checks order, label, count, title, aria-expanded, that opening by a wheel-scrolled click leaves the head where it is and opens no editor, the reload memory, moving on a switch, picking, all off and none off. It is red on the old library files (no fold; checked on mica in chromium). - Library/MCP/i18n/click-scroll/providers-off-fold GUI files (102 files, both engines) on mote at the pre-rebase head 29a5f10f9: 2304 of 2310 pass. The 6 reds are library-open-again's 1100px cases, red the same alone on the old tree (filed as #6751). - go test -count=1 ./internal/gui/ on mica at this head: ok (143s). gofmt clean. - The whole GUI suite on mote at 29a5f10f9, in two parts (mote rebooted mid-run; the rest ran after it came back, under suite.lock). Part 1: 411 not ok in 75 files. Part 2 (640 files): 11355 tests, 10911 pass, 444 fail. No red is in the files this change touches except library-open-again (#6751). Every red file has an open issue saying it is red on main: skill-fold-all/skill-manual (#6667, #6668, the window's /api/update/using), skill-group-shared (#6687), view-open-wheel (#4723), view-trackpad-coast (#4724), view-wheel-unheard (#5158), usage-* (#6743, #4263), the rest in #6709 or by name; icon-tile was unfiled and is now #6759 (dim-color from |
||
|
|
923cc8747f |
routing: filtering groups reuses indexed lookups and cards (liu-kan, #6744)
Ported from liu-kan's routing_mod_filter branch at 5aca86598 (#6744). Typing in the Routing groups filter re-ran every member's lookups as a linear .find over all models, deciders, drawers and accounts, and redrew the whole page each keystroke. Now a lazy index (Maps built first-match like .find, splitMember and memberInfo cached, search text cached per group and locale) is rebuilt whenever `groups` is reassigned (it never is mutated in place) and dropped 5 minutes after both Routing pages are hidden. The filter's input redraws only the group list from cached cards, falling back to a full draw when groups or the locale changed. No look, matching or saved config change; no new strings; app.js untouched (client.js is outside the core budget). Measured (mote, Playwright, 4000 models, 20 groups x 20 members, 16 keystrokes, ms per keystroke incl. layout): chromium: before mean 4767.6 / median 5086.3, after 0.37 / 0.2 webkit: before mean 4813 / median 5075, after 0.88 / 1 Run: - go test -count=1 ./internal/gui/ on |
||
|
|
2bc25a2d6e |
claude: a reply's thinking is never told to a Claude Code run as words (#6623)
The subscription bridge tells a conversation to a Claude Code run as Human:/Assistant: text (a run started anew, the messages since a reply, the transcript a new interactive run resumes). renderCachedParts wrote each thinking part's text into the assistant's turn, so earlier reasoning reached the model verbatim in a user message. Anthropic refused it as reasoning_extraction, and every run started anew after the refusal told it again (#6623; solllin on X). Thinking and redacted_thinking parts are now left out there. Words, tool calls and tool results are told as before. renderCachedParts is the one place: renderClaudePrompt (-p and interactive first message), renderClaudeTurn (next message, typed turn) and replaySession all reach it; a grep of every `case Thinking` in the tree finds only native structured encodings besides it, and sessions' carry already drops thinking. Run (mica, at |
||
|
|
343920464f |
routing: Fast keeps the provider's extra-body Ultrafast; a relay's GPT model can go Ultrafast (KoiLx0 on X)
KoiLx0 on X: with Azure or another provider that takes service_tier
"ultrafast", the group's speed toggle stopped at Fast, and they asked
whether the group's Fast overwrites {"service_tier": "ultrafast"} put
in the provider's extra request body. Before this commit it did. A member
sent fast got service_tier "priority" in its body before the extra body
was merged. A non-forced extra-body field only fills in a missing value,
so "priority" went upstream. Only "!service_tier" survived.
Precedence now:
- Member not sent fast: as before. The agent's own tier is kept, and the
extra body's service_tier fills in when the agent sends none.
- Member sent Fast: priority. If the provider's extra body asks for
"ultrafast", it is sent ultrafast, so Fast is never sent slower than
the user asked of the provider. A slower extra-body tier (flex) gives
way to the toggle, which the user set on this member.
- Member sent Ultrafast: ultrafast.
- A forced "!service_tier" in the extra body still goes over all of
these as written.
The same holds for an agent's fast pick (same member loop).
Ultrafast on a provider the user added by its address (OwnFast): the
toggle goes on to Ultrafast for a GPT model when OpenAI offers the tier
on that model. That is known when one of Codex's accounts lists it, or
when Codex's own entry in models_cache.json for the slug does
(codexcat.OwnOffers). Codex itself is already offered the tier on such a
provider from that same entry (ownTiers). Like its Fast, Ultrafast is
only asked for. A provider that turns the field away is asked again
without it. Other vendors and OpenAI's own API are unchanged. The
Ultrafast button's tooltip on such a provider says the tier is asked of
the provider (new string in zh, zh-TW, ja, de).
Tests, red on the old code:
- TestFastMemberOwnProviderExtraTier: the outgoing body for each
combination of group speed and extra body, from Chat, Responses and
Anthropic agents. Old code sent "priority" for "fast + extra ultrafast"
and for "Ultrafast".
- TestCanUltraOwnProvider: old code returned false for a relay's
gpt-6.1-sol that Codex's entry offers Ultrafast on.
- group-member-fast.test.cjs: an own provider's member steps usual,
Fast, Ultrafast and saves ultra; one with no Ultrafast steps back to
usual. en/zh, Chromium and WebKit.
Docs: gateway-routing.md (a group member's speed) and
providers-accounts.md (Extra body) say the precedence and the
Ultrafast rule.
Run on mote at df2652f63 (base
|
||
|
|
338eae3c20 |
provider: a remote magpie's new routing group is offered beside picks that left a model out (KoiLx0 on X)
A remote magpie whose picks left any of its models out served no model
listed after the Save (withNewlyListed's all-or-nothing rule), so every
routing group its user made there later, group/opus here, was missing
from the agents' pickers until ticked by hand in the editor. Deleting
and adding the remote again cleared the picks, which is why it "showed
sometimes". A group the remote lists since the picks were saved
(not in PickedFrom) is now served beside them; a new model of the
remote's providers still waits for a tick, and a group listed at Save
and left unpicked stays out.
Not changed: an agent set to show only the models picked for it
(#1337) still hides any model made later, local groups too; that is
the mode's rule.
Run:
- TestRemoteMagpieNewGroupServedBesidePicks red on the old models.go
("the remote's new group isn't offered: [group/smart
fake/claude-opus-9]"), green after.
- go test -count=1 -timeout 45m ./internal/provider ./internal/gateway
./internal/gui ./internal/cli on mica at
|
||
|
|
4f40a1061e |
sessions: a turn of a long Claude session reads none of its copies again (shangyuan0818 on X)
Usage → Sessions took ~20s on Windows for long Claude Code sessions (tens to ~100 MB each, few rows). A session resumed or forked into new files leaves whole copies of it, listed as one row, and the live one is the file they are kept in. Each turn it gained re-read every copy whole, twice: - ccFamily dropped the uuids read of a group whose verdict it found on disk, so the next change judged the group by reading every file's uuids from the start. It now keeps them while the files start alike, as ccUUIDMemo's comment says, and reads on from where it stopped. - ccRest read each copy whole again whenever the keeper changed. It now keeps the uuids of a copy's own messages, and while the copy didn't change and the keeper only grew and holds none of them, the rest stands. A keeper that took one of them has the rest read again (TestClaudeKeeperTurnTheBranchHeldIsCountedOnce, red with that check turned off: 90 in, want 80). Timings, Windows (xiaomi-gpu), a 100 MB Claude session from a real one with its text scrambled, copied under new ids: - in process, 4 copies, /api/sessions after a turn: 261 ms and 332 ms, now 26 ms and 27 ms; after a start and a turn 523 ms, now 239 ms. - the real dev backend (magpie app, sandbox HOME), 8 copies, the page's three calls after a turn: 607 ms, now 31 ms. Cold start 1.9 s both. These scale with the copies and their size; the reporter's machine is slower than this one. Run: - TestClaudeKeeperTurnReadsNoCopy red on the old code (copies and keeper read whole each turn); red with each half undone alone. - win-run go test ./internal/sessions ./internal/gui: 14 reds, the same 14 on origin/main |
||
|
|
4a4424ea84 |
codex: the takeover note names the phone connection the Codex app loses, beside Keep on ChatGPT (Mugenrikka on X)
Mugenrikka on X: once the Codex quota was used up, Codex opened through magpie stopped connecting to the phone and the account's profile could no longer be opened. Cause. This is the used-up takeover (#540, codex.out): with the active ChatGPT account held, magpie becomes Codex's provider without requires_openai_auth, so the app-server's getAuthStatus/account/read answer no account (codex-rs app-server get_account builds the account from the provider). ChatGPT.app 26.1029's main process then takes the host as an "execution-storage" identity, not a "chatgpt" one (its early-bootstrap: authMethod chatgpt/chatgptAuthTokens -> chatgpt; authMethod null and requiresOpenaiAuth false -> execution-storage), and "Connect your phone" (remote control) and the profile go with it. magpie never touches auth.json; the sign-in is still there. Nothing can keep both. With requires_openai_auth = true the app reads the account again, but its composer gate then greys Send for every model while the account's /wham/usage says not allowed (checked in |
||
|
|
b0d634b850 |
routing: Expand picks how far the stage opens, models or accounts (ipsikent on X)
ipsikent asked on X for a setting for how deep the Routing page opens:
often only which model a route uses matters, not which provider's account
it went to. Expand, at the end of the stage's top line, opens a menu
(openProtoMenu) with Automatic (as before: long lists folded, short ones
open), Models (two or more accounts or keys of one provider fold into the
row naming the model, and start folded) and Accounts (every fold starts
open). Models and Accounts open every group in the group. The pick is
kept in localStorage magpie.routingDepth; picking one forgets the stage's
remembered folds, so every row follows it at once, and a row clicked
after it is kept as before. Accounts and keys isn't changed. Display only:
the gateway's choice of seat is untouched.
It sits in the stage card's top line, not the page head: in the head it
pushed Hide accounts onto a second line at 420px in English. "Expand" is
in the core dictionary, since i18n-keys finds the word in plugged.go.
Run (mica, at this tree on
|
||
|
|
2649d5d727 |
agents: Dim alpha (dima) is an agent, started on magpie's gateway (T_t__biu on X)
Dim alpha (arcships/dim, npm dimcode-alpha, command dima) gets a row on
the Agents page. Picking a magpie model there starts dima with the
variables Dim documents for any OpenAI-compatible endpoint
(docs/design/model-startup.md): DIM_BASE_URL (gateway /v1),
DIM_API_FORMAT=openai-compatible, DIM_API_KEY (magpie-dim), DIM_MODEL
and both DIM_MAX_*_TOKENS (the catalog's, else 128000/32000). They hold
for that run only; Dim's saved Providers, settings and database are not
written. The pick is in magpie's own dim.json; a dima function in the
user's shell profiles runs `magpie dim run`, and the row gives the
command for an open terminal. Picking Dim's own (or Disconnect) removes
both. Nothing signs in to, reads or proxies Dim's own account or the
DimAgent subscription (removed at its vendor's request, v0.1.471).
Run:
- mica, at this tree (rebased on
|
||
|
|
993c8a7267 |
gateway: a group's classifier asks on the group's accounts (AWilsonPeng on X)
A ruled group whose intent classifier (意图判断模型, "Intent told by")
is a model, not a group, asked that model with a fresh request that
carried no identity, so it went out on any signed-in account of the
subscription. AWilsonPeng held the found group GPT-6 Luna to one of two
ChatGPT accounts and picked its own member GPT-6-Luna · Codex as the
classifier (a group can't classify with itself, so it isn't offered),
and the classifier's questions still went to the other account.
The classifier is now asked under the caller's identity held to the
group (classifierHeld in rules.go): the group's Accounts, a gateway
key's accounts, and, when the classifier is one of the group's members,
that member's pinned account. askChat, askDecider and
askDecisionGroup pass the identity on, so every route a classifier
takes (a single model, a decision group, the least-busy pick) keeps
to those accounts. A failed classifier rests only for those accounts.
A group-ref classifier was already held (round 1).
Tests: TestClassifierModelHeldToItsGroupsAccount (the reporter's case,
held by the group's Accounts and by the member's #account pin) and
TestClassifierModelHeldToTheKeysAccount (a key held to one Codex
account).
Run (mica):
- red on
|
||
|
|
bf14062def |
plugins: a dist package Bun can't copy is unpacked from the verified tarball
CHENGJIAHEGOXIS on X, on v0.1.4241 (Windows): installing GoAnyAPI from
the Plugins page still failed with "Unexpected: failed copying files
from cache to destination for package @magpie-community/tools-goanyapi"
and "(LICENSE is missing)", at both of addDist's tries.
Cause, from Bun 1.4.4's source (src/install/PackageInstall.rs): on
Windows Bun copies each cached file by CreateHardLinkW, then CopyFileW,
with no other fallback; a Win32 error it has no errno for prints as
"Unexpected". On a machine where that copy fails (agency-agents failed
the same way there before) dropping the cache entry and trying again
can't help, which is all v0.1.4205 to v0.1.4241 did.
Now, when Bun's copy is still not whole after the second try, magpie
makes it from the tarball installDist verified against the index's
sha512 (unpackDist): the files go into a temp folder beside
node_modules/<name> with .bun-tag = the tarball's integrity, as Bun
writes it, and the folder is renamed into place. Bun takes a tarball
package whose .bun-tag matches as installed and never copies over it,
so bun add runs once more to write the dependency and bun.lock. Only a
package with no dependencies (optional, peer, bundled) whose
package.json names it is made this way; a path leaving the package is
refused. When magpie can't make it either, the add is errDistPartial as
before.
Run at
|
||
|
|
c00c491bca |
contributors: luo173176 fixed plugins#1176's cookie scan and user-text rewrite
The row now says what d4ef0e7f4 fixed. What is still held, and why, is unchanged. Docs only; nothing run. |
||
|
|
b4968d4445 |
contributors: luo173176 reviewed with extra care (plugins#1176 reads browser cookie jars and rewrites user text to evade Perch's checks)
plugins#1176 was stopped at Look for harm first, and the author's next push added evasion instead of answering it. The evidence is in the row. Docs only; nothing run. |
||
|
|
5bccfb4ef2 |
usage: a table's provider with several accounts is one folded row; an empty Account column is left out (#6740, jay68xu on X)
jay68xu on X: the Usage page gets hard to scan with many providers and accounts. This change covers the table view only, as the issue's comment asks. In the Allowances table (Usage > Overview, Table), a provider with several accounts is now one row. The row shows the chevron, the provider's icon and name, "N accounts" (a string every language already has), and each window column's mean share over the accounts. A failed read counts for nothing in the mean. The provider's accounts sit under it, folded until the row (or its button, with Enter or Space) is clicked. Each provider's open state is kept in localStorage magpie.quotaTableOpen, the way the cards' folds are kept. A provider with one account is one row, as before. Sorting orders accounts within a provider, then providers by their mean (window columns) or by their first row. The Account column is left out when no row names an account. Window columns and Other already appear only when some row has one. There is no motion: a toggle redraws the table, and the chevron turns. app.js is untouched (quotatable.js loads lazily), and there are no new strings. Run at this tree (base origin/main |
||
|
|
bbe5c952f1 |
settings: Update source moves from Network to About, under Download source (WeltAn_X on X)
WeltAn_X on X: the source updates come from sits in Settings › Network and sharing, though it is an update setting. Update source (Automatic, usemagpie.ai only, GitHub only) is now the row right under Download source in Settings › About, with Automatic updates, Update channel and the other update rows. Same menu, same updateSource value, same save; the Network page loses the row. App updates' proxy stays on Network, beside the other proxies. No new tab, label or line. It goes under Download source rather than above it: placed above, the About page scrolled at update-mirror's 420px window, and Use a mirror… then slid Download source 2-10px. That slide is on main too in a shorter window (#6739), not fixed here. Docs: the Mirrors page (en, zh, ja) and reference.md say About › Update source; llms-full.txt and the search indexes are regenerated. Run at |