aca0f0d8a1630923bf4e8a18b3a5a8ef508fc7bc
1185
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
aca0f0d8a1 |
guard: a long text's windows are read at once, one a core (niuniu_8964 on X)
码妞 on X: on a 4-core server in the Docker image, with AstrLink Guard,
Claude Code's requests sat at 脱敏中 for minutes, load 1.78. Guard read a
long text's 510-token windows one after another, and split only each
window's matmuls and attention over GOMAXPROCS-1 goroutines; the layer
norms, biases, GELU and quantizing between them ran on one core. A
2-CPU container got one thread for all of it.
Find now reads every window's logits first, min(GOMAXPROCS, windows) at
once, each with GOMAXPROCS/that many goroutines of its own, then merges
them in window order as before, so what it finds is the same. A window's
procs are passed down (logits, encode, matmul, attention, parallel) in
place of the package's threads. CoreML (a Mac) still reads one window at
a time.
Measured on magpie-desktop (WSL, Ryzen AI Max+ 395), 69,495 bytes of
docs, 22,488 tokens, ~59 windows:
GOMAXPROCS=4: 23.86s before, 17.90s now
GOMAXPROCS=2: 48.8s before, 30.50s now
GOMAXPROCS=1: 50.0s before, 57.0s now (the same code path; noise)
Run:
- wsl-run with MAGPIE_GUARD_DIR at the pinned model (rev 7216b6a3):
TestWindowsAtOnceReadAsOneByOne (new: 200 synthetic contact lines, over
4 windows, read at GOMAXPROCS 1 and 4, spans DeepEqual), TestModelFinds,
TestKernelsMatchGo, TestTokenizerMatchesHF, TestDecodeBIO: ok.
- mote-run: go vet ./internal/pii/..., GOOS=linux and GOOS=windows go vet
of it, go test -race ./internal/pii/..., go test ./internal/pii/...
./internal/redact/...: ok.
- win-run go test ./internal/pii/guard: ok.
Broken by hand: swapping the first two windows' logits after the wait
made the new test red ("windows at once found 800 spans, one by one
800": the same count, different spans).
Not tried: the reporter's own server, or a real Claude Code request
through the Docker image; TestCoreMLMatchesGo (needs the model on a
Mac) was only compiled. The full suite wasn't run: nothing outside
internal/pii/guard calls what changed but Find.
|
||
|
|
eb6d1d8d97 |
redact: a colour or an ordinary word is no personal name (黄绿色, 关键词)
hh05928822 on X after v0.1.1850: names were found in ordinary Chinese, "黄绿色" the worst, with 边••, 应••, 关••, 尚• in the screenshot. wangjunxiao128: "关键词" taken for a name. Both ways a Chinese name is found (the model's PERSON spans in modelSpans, and the cue rules in zhNameSpans) now go through one check, zhWordNotName: a span that is an ordinary word is no name, unless a role before it or a title after it says a person is meant (客户方圆, 江山老师). A word is (zhWordShaped): - a colour: Han colour characters alone, or anything ending in 色 (黄绿色, 红色, 金黄色, 浅蓝色); - a two-character word starting with a surname, from zhWords or the new zhDict (边界, 应该, 尚可, 关心); - such a word with a noun ending after it (关键词, 关键字, 应用层, 毛利率, 时间戳, 文件名). zhDict is zhdict.txt, embedded: ~1,550 two-character words from jieba v0.42.1's dict.txt (MIT, in THIRD_PARTY_NOTICES), the first character a surname, frequency >= 100, tag not nr/nrt/nrfg, and a list left out by hand (陆游, 关露, 欧阳, 司徒...) in its header. The surname list keeps 黄, 关, 边: they are real surnames, so 黄晓明, 关羽 and 毛利兰 are still masked. modelTakes' own zhWords check moved into the shared one. Run on mote at |
||
|
|
6aa04f6e6a |
provider: a keyless relay on the user's own network imports and saves, as one on 127.0.0.1 does
iSnow_999 on X: their company's internal Codex relay is at
http://<LAN IP>:8080; imported from CC Switch, Codex couldn't reach it
through magpie. A CC Switch Codex entry with no key (requires_openai_auth
= false, auth {}) at a LAN address was listed as "it has no API key"
and left out, and the same provider couldn't be saved by hand ("needs an
API key"), while the same server at 127.0.0.1 was taken keyless.
keyOptional now also takes a host on the user's own network, read from
the URL alone (ownNetwork, no lookup since Ready asks often): a private,
link-local, loopback or carrier-grade NAT (Tailscale) address, or a
.local name, as netproxy's onLAN sends around a proxy. A keyless address
on the internet still needs its key. Every importer (CC Switch, Alma,
Codex, OpenCode) goes through imported(), and the editor, CLI and TUI
through Save, so the one rule covers them.
Ruled out against the code and on mote, sandbox HOME, fake relay on
mote's LAN address 10.0.0.116 at a free port, `magpie serve --web` built
from this tree, import through POST /api/importapps:
- a CC Switch Codex entry at http://10.0.0.116:<port>/v1 with a key
imports with port, path, key and Responses kept, and /v1/responses
through the gateway reaches the relay (Bearer sk-corp); with
HTTP_PROXY/HTTPS_PROXY/ALL_PROXY at a dead 127.0.0.1:9 too (onLAN);
- a request with Codex's User-Agent, originator and
x-codex-turn-metadata reaches the relay with them (sub2api's
codex_cli_only gate reads these; port 8080 is sub2api's default).
After the fix, the same run with a keyless entry: imported, served, the
relay sees no Authorization header.
Tests: TestKeylessRelayOnOwnNetwork (import of a keyless LAN entry,
Save + Ready at 192.168/10/172.16/100.64/.local/[fd00::] addresses, a
keyless internet address still refused) is red on the old provider.go
and green now.
Run on mote at
|
||
|
|
ae03279458 |
masking: the local model is on by default; the rules mask alone until it is downloaded
The owner's plan (10-28, after the xuanwo/_kaichen reports under the
masking demo): with AstrLink Guard picked, the Chinese-name heuristic
is off and only nicknames like 小王/老李 stay a rule; with Privacy Filter
it is as before; every format rule stays; the model is on by default,
masks with the rules alone until its download finishes, and no longer
answers 503 for it.
- masking.ModelWanted(st): on when the user turned it on, off when the
user turned it off (new RedactModelOff, set by SetRedactModel(false),
remove, and cancelling the default's own download), on when the
default's download finished (RedactModelAuto). A settings file from
before this, with a model name picked or files on disk and the model
off, reads as the user's off: magpie's default doesn't override it.
- Until the picked model is installed, requests are masked by the rules
alone and fetch starts its download (one try per model per hour,
never under testing.Testing(), nothing where the model can't run).
When it finishes, settings.UseDefaultRedactModel records the default
(it refuses when the user has set anything) and the model warms.
- model(..., strict): a model that fails holds requests back (503)
only when the user turned it on; under the default the rules mask
alone. The Privacy page says which ("…the rules mask requests alone"
in en, zh, zh-TW, ja, de; /api/privacy-model has `chosen`).
- redact.Options.NamesByModel (AstrLink Guard picked): zhNameSpans
keeps only zhNick candidates (小/老 + a surname).
- KeepOwn and POST /api/settings keep both new fields.
- Docs: gateway-routing.md, site masking docs (en, zh, ja).
Run (mote, Go 1.26.8):
- gofmt clean; go vet of masking, settings, redact, gui; GOOS=linux go
vet of masking, settings, redact; GOOS=windows go vet of the four.
(GOOS=linux vet of internal/gui needs cgo, as on main.)
- go test -count=1 -timeout 45m ./... at base
|
||
|
|
a1f06bd780 |
gui: a browser tab offers the fonts of the computer it runs on (Norcleeh)
Norcleeh (Discord #general): magpie in Docker, used through the web GUI,
Settings' font menu doesn't list the fonts he installed on his own
computer; the app does. Cause, confirmed in the code: a tab's list is
/api/fonts, the server's families (none in a nogui build such as Docker)
plus commonFamilies, filtered by what the browser draws. A family that
is only on the browser's computer was never offered, and a choice the
server doesn't list was dropped by desktopFonts.available.
Now (webfonts.js, which only a browser tab loads; the app's windows are
unchanged):
- Where the Local Font Access API is (Chromium on https or localhost),
the press that opens a family menu calls queryLocalFonts() once a
page, and at load when the local-fonts permission is already given.
The families join the list with their real styles ("SemiBold
Condensed Italic" -> weight 600, 75%, italic).
- Elsewhere (Safari, Firefox, a plain-http LAN address, a refused
permission) the menu's search says "Search or type a font name…" and
offers Use "name" for a family the list lacks, enabled when the canvas
probe says this browser draws it, greyed with "This browser can't find
this font" when not; Enter takes it.
- A chosen family the server doesn't list stays in the tab's list on
later loads while the browser draws it, so it keeps being applied.
- The app's menu (openProtoMenu), never a <select>. Strings in zh,
zh-TW, ja and de. docs/subsystems/gui-shell.md says so.
Budget: no raise. here() moved out of fonts.js into webfonts.js, which
isn't a core script: loadFonts import()s it in a tab only (the page has
no CSP). The core is 106 bytes smaller than origin/main's.
Run (mote-run). At this head on
|
||
|
|
7fcf642eed |
gateway: the request archive doesn't put an unmasked route back on masking (#3973)
wangbinyq (#3973, Discord #feedback): after v0.1.1840, with the request archive on, a request to a provider set to go unmasked was still masked whole before it was sent. |
||
|
|
aba11fc4de |
gateway: xAI's own API takes no null required in a tool's schema (#3392, kongkongklng)
The third round of #3392, after the reporter merged the system-turn fix: codex went through, but every Claude call still 400ed — xAI answers 'Invalid request content: Schema validation failed: [standard_violation] /required: null is not of type "array"'. A tool's schema said "required": null where none were (Claude Code's own tools, an MCP server's among them; Anthropic's API takes the null, xAI validates each schema as a JSON Schema). The relay forwarded it as sent. The key now goes wherever a tool schema leaves magpie for api.x.ai — input_schema (Anthropic), parameters (Responses) and function's parameters (the translated path), at the schema's root or nested; a real array of names stays as it came, and a body with no null required keeps its bytes. Replayed on a fake xAI by the reporter's wording: the claude call with a root and a nested null required goes through, Bash's real array and the schemas' contents beside them as they were; with the shaper off, both new tests go red. Full nogui gateway package: the four reds (TestClaudeClientCacheAbsentUnchanged, TestCodexFittedImagesPastTheBudget, TestMarshalRawIsEncodingJSON, FuzzMarshalRaw) match a clean-baseline run of the same branch in the same session; a fifth clean-baseline red (TestHandedOverGatewayFinishesItsStream, the known flake) passed here. gofmt / go vet clean, linux/windows/darwin nogui builds pass. Not tried against the real xAI API: no key here. From skygunner's branch fix/issue-batch-1024pm; kongkongklng confirmed it on 10-25. |
||
|
|
d8938d2f00 |
gateway: xAI's own API takes neither a sealed item's null content nor a system turn in messages (#3392, kongkongklng)
The follow-up to 8ecab590, after the reporter merged it: the first Codex turn through an xAI key went through and every one after it 400ed "Could not decode the compaction blob. Ensure it is unmodified from the compact response." — Codex hands the sealed reasoning item back with "content": null beside its encrypted_content, which xAI's backend can't read. The Grok subscription's plugin already drops that null (grokShaped), but the xai preset shapes nothing, and the custom-tool refusal had only now let a second turn reach the API. And every Claude call 400ed "Invalid request content: Invalid message role.": Claude Code sends a system turn mid-conversation (Anthropic made them GA), a role xAI's Messages takes only as the top-level system. xaiBody (api.x.ai, shaped in passthrough and on the built body in forwardTranslated alike — a custom-tool refusal puts a Codex request on the translated path from the next turn on) drops a reasoning item's null content and folds each system turn into the top-level system, its text and blocks as they came. Nothing is learned: xAI takes neither at all. TestXAITakesCodexsSealedReasoningBack, TestXAILearnsCustomToolsThenTakesTheReplay and TestXAIFoldsClaudesSystemTurn replay the reporter's session on a fake api.x.ai and are red with the shaping off; the wording comes from the report. gofmt clean, go vet and the builds (native, linux nogui, windows) clean; go test -tags nogui ./... in a sandbox HOME: 66 packages ok, the same 7 test failures as the clean branch head baselined the same session (TestWriteAtomicReadOnlyHardLink, TestClaudeClientCacheAbsentUnchanged, TestCodexFittedImagesPastTheBudget, TestMarshalRawIsEncodingJSON, FuzzMarshalRaw, TestPluginSOCKSProxy, TestProgram). Not tried against the real xAI API: no key here. From skygunner's branch fix/issue-batch-1024pm; kongkongklng confirmed it on 10-25. |
||
|
|
1d7ca4c6b7 |
gui: every scroller in every stylesheet is held to keep the wheel; Safari 15 too
碳碳双键 (ysm119, Discord): a list scrolled to its top or foot by the wheel went on to scroll the page, "in many places". |
||
|
|
67c8f562cd |
codex: a subagent named a model goes on it with "Same as the lead" (mengxiao on Discord)
mengxiao left Codex's subagent model at "Same as the lead" in magpie, asked the lead for a subagent on GPT-6.1 Terra, and magpie put the subagent on the lead's model anyway. The cause was codexFollowTo (internal/gateway/codex_follow.go): on the ChatGPT-sign-in path, a collab_spawn request asking for one of Codex's bare models, with nothing set in magpie or [agents] default_subagent_model, was moved onto the model the conversation's own turns go on ( |
||
|
|
dfbd37eafc |
docs: a reporter's fix branch, patch or fixtures are credited in the commit
321sssrt-bit's analysis, fixtures and fix branch went into #3418, #1981 and #2033 with no co-author line. Now: a reporter's fork branch is merged with their commits as authored, anything else we use from them gets Co-authored-by, and a plain report is named in the body. Docs only; nothing reads this file's text. |
||
|
|
189db9ba5b |
redact: ids, digests and 毛利 go as written; the slider reaches known values; a user name goes as a made-up name
Reports on X under the masking demo (10-28):
_kaichen: "hash类型也会被过滤…长int,假如以1为开头的…会被当作电话被mask;
"毛利低"也会被当作人名被mask。即使把匹配拉到 0.95,也是一样行为".
- Hex digests: 16 to 31 hex digits in one case, with letters and digits
both (a cache key, a short commit), are ids now (digestShaped in
ids.go), like UUIDs and 32+ hex. The rules' SECRET keeps one only under
a credential's field or a CJK/prose key with no field word (密钥为…);
the model's SECRET is dropped under a field named for something else
(cache_key, commit, object, blob, file, content, revision, partition,
shard, bucket, dedup, lookup, row, sort) and on a JSON object's key
(nameOfField). A bare `key` after api/access/secret/private/signing/
license is still a credential (keyPhrase). The IBAN case kept its mask
through the letter/digit minimums.
- 11-digit 1x numbers (phone.go, phoneAt): a phone with +86/86, as the
value of a field whose name says phone (phone, mobile, tel, cell,
contact, 手机, 电话, `number`), or in prose with no id word right
before it (order, id, no., #, 订单号, 编号, 单号, 流水号…). Under
order_id/uid, after 订单号, or with a letter or digit against it, it
goes as written. PHONE and BANK_CARD are bounded by alnum, not digits,
in the rule and in known values.
- 毛利: zhWords gained 毛利, 毛重, 毛坯, 毛巾, 毛衣, so 毛利低 (a margin)
is no surname+name. The model still finds 毛利兰 (Guard). 毛利小五郎
(indekkusu141209) is masked by neither model nor the rules now.
- The slider: a value masked once was masked again as known whatever the
threshold. Each value now remembers the highest score it was found
with (rules count as sure, ruleFound), and knownSpans skips one under
Options.MinScore, which masking sets from pii.Threshold.
eerttreeeert: with mimo-v2.6-flash the home folder went as
C:\Users\{{USERNAME_…}}; the model took it for a temp folder and set out
to delete it. With the user name switch on, it now goes as a made-up name
of 8 lowercase letters (HMAC of the name, same every turn, standIn in
shape.go), restored in replies and tool calls like any placeholder;
Preview shows the same name.
Docs: docs/subsystems/gateway-routing.md masking bullets, and the site's
masking page (en, zh, ja) on mobile ids and the user name.
Run (mote, at this tree on base 6af83172d; rebased onto
|
||
|
|
ee6f8866f3 |
gateway: Claude Desktop's connection check goes to its default model
CyberCaius on Discord, v0.1.1838, after restarting Claude Desktop: as it
starts and from Test connection (Configure third-party inference ->
Gateway), Desktop said "Gateway rejected model
magpie-0958175816.anthropic.claude-haiku-5-5[1m] (HTTP 400)", the body
"AnyRouter: bad response status code 400". His default model in Desktop
is his routing group 天翼云; Routing showed leee/claude-haiku-5-5 sent to
AnyRouter gpt-6.1-sol.
Why
|
||
|
|
05ed578bdc |
gateway: a large body whose h2 ping was lost goes again unpinged (#3909)
yxd-ym, on a 2-10KB/s uplink: every large turn to a Google upstream (Antigravity, Vertex, AI Studio) failed with "http2: client connection lost" after 35-45s while its body was still uploading, and the group's failover uploaded the same ~680KB again to every member. A small turn on the same uplink was answered in 14s. Cause (skygunner's diagnosis): the vendor transport's HTTP/2 health check (netproxy.HTTP2Health, #2843) pings a connection with no frame received for 20s and drops it when no answer comes in 10s. The ping is written behind the body's own DATA, so on a slow uplink its answer can only come after the last byte, and the check closed a working connection. skygunner's branch (8eaf63866) sent every body of 64KB or more, or of no stated length, to a transport without the ping. That is most agent traffic, and it takes #2843's protection away from it: a silent connection whose kernel takes a body that fits the send buffer then waits the 10-minute header wait (TestLargeBodyOnSilentConnectionIsSentAgain below hangs to its 10s bound on that branch). The change keeps the ping on every request by default. A large body (uploading) whose try fails with Go's lost-ping error (lostPing, closeForLostPing's "http2: client connection lost") is sent once more, through GetBody (provider.SetBody keeps it until LetGo), through uploadTransport: a new connection, no ping, given up on when a write moves no bytes for a minute (WriteByteTimeout); the response header wait still ends a vendor that never answers. For 30 minutes after (slowFor, drawsApart.slow, per transport), large bodies go there at once, so a slow uplink loses one try per half hour, not one per turn. A connection that really was dead costs nothing more: the retry dials a new one either way. Small bodies and drawings are unchanged. Co-authored-by: vincent <vincent@users.noreply.github.com> Reported-by: yxd-ym What was run, on mote at origin/main |
||
|
|
bc3ddc661a |
redact: 文案 and words like it are no Chinese names (zeewell on X)
zeewell on X: tasks kept going wrong because 文案 was masked as a name,
so they turned names (and birthdays) off. 文 is a surname, and zhName
took a cue around 文案 that says nothing about a person. Probing words
that start with a surname (文档, 方案, 关键, 项目, 成本, 段落, 颜色, 查询,
时区, 简历, 林间, …, ~130 of them) in the places a prompt has 文案, about
110 were masked, through two cues:
- 一下 before it (改一下文案, 检查一下文案,) counted as "a person comes
next". 一下 follows any verb, so it now counts only after one that asks
a person (zhAskVerbs: 问, 找, 联系, 通知, 提醒, 回复, …): 问一下张伟
still is one, 改一下文案 is not.
- At a sentence's start, a word after it that any subject takes (已经,
明天, 今天, 昨天, 他, 她, 提交, 负责, 回复) counted alone: 文案已经改好了,
文案明天给你, 文案他们说. Those (zhAnyAfter) now count only with a
person's cue before (客户张伟已经到了). 说明, 说法, 讲解, 讲座, 讲义, 讲究
are words, not 说 (文案说明), but for 说明天 (张伟说明天来).
- zhWords gets ~150 more common words (文案, 文风, 关键, 项目, 段落, 林间,
…) for where a real cue is before a word (发给文案, 请文案), and is a
set looked up by a candidate's first two characters rather than a scan.
- The model's own PERSON span that is such a word whole (文案) is
dropped too (modelTakes), the other route a word reaches a name.
Old data: masked values are remembered in memory only, and 文案 (6
bytes) is under minKnown, so nothing stays masked after the update.
Fixtures are prompts with 文案 where the report gives no sentence (帮我
改一下这段文案, 文案:…, 把首页文案换成英文, ### 文案, 文案和图片, 文案已经改好了,
文案说明要简短, 这张图发给文案。), beside names in the same places that
still mask (问一下张伟,, 张伟说明天来, 客户张伟已经到了, 发给张伟。);
TestChineseWordsAreNoNames runs 25 listed words in 10 shapes plus the
model's label, and 5 unlisted ones (文创, 方位, 高铁, 安防, 林荫) through the
cue shapes alone. Every TestChineseNames case stays green.
Run (mote, mote-run, at this tree): go vet ./internal/redact for darwin,
linux and windows ok; gofmt clean; go test -timeout 45m of
internal/redact, masking, pii/..., otlp, sessions, settings, gateway
ok; internal/gui red on TestMainWindowCorners/macOS_26_SDK only, the
macOS 27 red filed as #3949 (no redact in it).
After rebasing onto
|
||
|
|
8edb9dbb75 |
gateway: a compaction a model answers with a tool call is asked again as text
Lucy on Discord (v0.1.1676, Codex, group/auto-deepseek-v4-1-flash): "compaction: group/auto-deepseek-v4-1-flash failed to summarise this conversation 3 times in a row (last: the model wrote no summary (it answered with reasoning, function_call exec_command))", so Codex could not compact at all with that group. Cause: the summary request offers no tools (tools [], |
||
|
|
ea53eb1262 |
gateway: a request to an unmasked route isn't masked first (#3973)
wangbinyq (#3973): with masking on, a request to a provider set to go unmasked was still masked whole before routing, then sent as the agent wrote it, so the masking was thrown away. In their log that was 97.9% of magpie's own time: median 560ms, p99 16s, max 219s. serve now masks after Resolve/FindGroup. When unredactedRoute holds and no body goes anywhere else (bodiesKeptAway: no observer wanting bodies, no request archive), masking is skipped. The redact writer goes under capture, an order that commutes with the old one. A turned-away request is logged masked (maskedCopy). count_tokens masks only when its route isn't unmasked. The context card's text stays masked: the kept body is masked when PromptText first reads it (keptBody.plain), not on the request's way. The log and recent calls keep the body as it went. Run on mote at this tree (base |
||
|
|
d74ef5e04c |
gui: an inner list wheeled to its end keeps the wheel; the page stays put
碳碳双键 (ysm119, Discord): wheeling the Usage page's request list to its top or bottom carried on into the whole page, and "this happens in many places". It is the class: every box that scrolls inside a scrolling page. app.js marks such a box `.holds` while it overflows vertically, on pointerover and on each wheel (the box under the pointer and its ancestors up to the .view), and app.css gives `:where(.holds)` overscroll-behavior-y: contain, which keeps the Mac's bounce on the box. Not one CSS rule for every overflow:auto box: in Chromium `contain` holds the wheel even in a box that doesn't overflow, or is overflow:hidden, or only scrolls sideways, so short lists and the heatmap's and ledger's sideways scrollers would have stopped the page. The .view itself is never marked. :where() weighs nothing, so .mchips in a short window (@media max-height 640px, #833) still passes the wheel on. The new test, inner-scroll-contain.test.cjs, wheels the Routing page's requests list past each end (en and zh, 900x560 and 1300x600, under "By session" / 未提供会话标识), and ten kinds of inner box, and asserts the page's scrollTop didn't move. A short list, heat-scroll, led-wrap and snip must still pass the wheel to the page. routing-scroll-end now wheels over the page's gutter: at its view centre the pointer sat on the requests' list, which now keeps the wheel at its end (600 of 1066). Run (mote, Playwright 1.62, Chromium and WebKit): - inner-scroll-contain 40/40. - 17 files: inner-scroll-contain, click-scroll, routing-scroll-end, routing-sessions, view-wheel-after-click/-after-redraw/-unheard, heatmap-scrollbar, ledger-hscroll, ledger-hscroll-foot, context-scroll-end, menu-scroll, provider-levels-scroll, panel-usage, panel-routing, qoder-cn-tile, agent-disconnect: 268/287. Reds were routing-scroll-end (this change, fixed above) and panel-usage webkit zh (#3311, commented). Rerun of routing-scroll-end, panel-usage and inner-scroll-contain: 66/66. - go test -tags nogui ./internal/gui ok (TestCoreScriptBudget passes at the rebased head: core under 1,526,556, app.js under 1,310,460; no budget raised). Broken by hand: the old app.js and app.css: the requests list and every held box red in both engines (mchips aside, it had contain already). Only the CSS rule removed: red, "the page didn't move" x8 plus each held box x2. Only the overflow check removed: a short rt-reqs red (Chromium), led-wrap and snip red in both engines. Not run: full GUI suite (mote was busy with another session's suite). Not tried: WebKitGTK on Linux, WebView2 on Windows, a real Mac's trackpad rubber band and momentum in the app, older macOS WKWebView, touch; zh-TW/ja/de (no strings changed). |
||
|
|
60520ddb3b |
moejs: v0.1.0-alpha.11, at its new module path github.com/MoeForge/moejs
Gateway middleware and agent plugins run on moejs. alpha.11 moves the
module to github.com/MoeForge/moejs; every other API change since
alpha.4 is an addition. What magpie gets: faster calls, loops, property
lookups and JSON.parse, allocation-free await, a bytecode verifier, a
correct default.pgo, and Intl / toLocaleString in plugin code.
Checked against both tags' source: every name magpie uses (NewRuntime,
Options, Compile, Link, Hook, Value, Arg, Undefined, NativeFunc,
Referrer, the Promise results, Exception) has the same signature, and
Options' defaults (shared frozen builtins, no timers) are unchanged.
fetch, Streams, URL, node:fs and node:buffer live in the separate
webapi and node packages, installed only on request; magpie installs
neither, so a plugin still reaches no network or file.
Intl's CLDR, Unicode, ICU and V8 material is compiled into every build,
and moejs asks a program that includes it to carry sections 1 to 4 of
its notices. THIRD_PARTY_NOTICES holds them verbatim. Release archives
ship no LICENSE today either; that is not changed here.
Doc and site links (docs/, site/public/docs/{,zh/,ja/}plugins.html)
point at the new repo.
Run on mote at this tree: gofmt; go build -trimpath -s -w (60,670,658
bytes on origin/main
|
||
|
|
58fb3a7786 |
redact: 关键发现, 易触发 and 和边界 are words, not Chinese names
xuanwo on X: with the model on, a report's words were masked as names, 关键 in "### 关键发现", 易触 in "`gh pr view` 易触发" and 边界 in "判断和边界,". Each starts with a surname (关, 易, 边), and zhName took a cue around it that was too weak alone: - 发 and 打 after it counted as the verb a person does. They now count only when no Han character follows, or one of 了个给过一 (发了个消息, 打给他); 发现, 打开 begin a word. - 和 and 与 before it counted as "a person comes next". They join like to like, so they now count only when a pronoun or what may be a name (a surname and 1-3 characters, no zhWords word) is before them: 吴敏和郑浩, 我和张伟, not 判断和边界. - A sentence started after any space or symbol. A space after a word or code is inside a sentence, so the start is now after punctuation (with spaces after it or none) or at the text's start; a backtick no longer counts. The fixtures are the reporter's literal lines, beside names around the same cues that still mask (### 张伟发了个消息, 我和张伟,, 这件事。 李娜说过). Run (mote, mote-run): go test ./internal/redact (TestChineseNames, TestMaskEval and the rest) ok; gofmt clean. Broken by hand, each red on its own case: the 和/与 rule off (边界), wordAfter off (关键发现), sentenceStart always true (易触发). Running as this is pushed: vet (darwin, windows, linux) of internal/redact and go test of redact, masking, pii, otlp, sessions, settings, gui and gateway. Not tried: the real model on the reporter's whole session; a name that starts after a space following a Chinese word (这件事 李娜说过) is now left, as one inside a sentence. |
||
|
|
a3ee00c05c |
codex: its own GPT models stay in Codex's list when kept for routing groups
士奇 (Discord, 10-28): with a routing group on, the Agents page's Codex list lost its Codex provider section and models, the model dropdown still offered GPT, but the Codex app had none; with the group off they came back. Cause: the codex provider's "Only through routing groups" (Provider.Unlisted, 只通过路由分组使用), or a group that lists itself alone (Group.Unlists), took the ChatGPT account's own models out of Catalog(), so out of Codex's own list too. With no Codex section, the own options were not magpie's, so the own-models switch showed and the picker kept offering GPT; meanwhile #1602 ( |
||
|
|
824100f30f |
gui: keep Windows modal backdrops responsive without blur
Disable full-window modal backdrop filtering in Windows desktop windows and tray panels, retaining the dimming veil. Browser pages and other platforms keep their existing blur through the existing win/web markers. Document the platform behavior in the GUI shell reference. On an affected 0.1.1805 installation with WebView2 155.0.4283.62 and Intel UHD D3D11, disabling the filter made provider tests visibly responsive. The reporter confirmed the improvement. Scripted scrolling measured roughly 67 to 165 rAF callbacks/s, not presented FPS. Verification: modal-backdrop.test.cjs fails on the original CSS in both Windows desktop Chromium cases (blur instead of none), with the other 10 cases passing. After the fix, 45 targeted tests pass across Chromium and WebKit: modal-backdrop, dialog-backdrop-drag, segment-press-dialog, gui-zh-tw, gui-ja and gui-de. node --check and git diff --check pass. The full GUI suite, Go vet/build/test matrix and native macOS/Linux tests were not run. |
||
|
|
c48fccfad7 |
plugin: the dist index is read from GitHub beside jsDelivr's copy, so a plugin npm doesn't have is offered its newer version
star21321321124 on Discord: CodeArts 0.2.3 showed "已自动更新", the page said
every plugin was up to date, and Update did nothing, with 0.2.4 on the
plugins repo's dist branch. npm has neither CodeArts nor River (E404), so
npmAsk's version is the dist index's latest. With the 「国内镜像」 switch on,
index.json was read from jsDelivr first, and a 200 from it was final. A
jsDelivr edge serves the branch as it was when it cached it (s-maxage=43200):
on 10-28 gcore.jsdelivr.net served the index with codearts latest 0.2.3
(age 6631s) while raw.githubusercontent.com, cdn and fastly had 0.2.4. So
the hourly update, Check for updates and Update all saw 0.2.3.
readDistIndex now asks raw.githubusercontent.com beside the mirror (with
the switch on) and merges the two copies: every version either names,
each package's newer latest. Each version keeps the sha512 its own copy of
the branch names, which installDist checks the tarball against as before.
GitHub is waited for 5s (distGrace) past the mirror's answer; unreachable,
the mirror's copy is read alone, as before. Switch off: one read, as before.
River: on dist at 0.1.0 only, nothing newer; the test holds it "current".
Run (mote, at this tree rebased on
|
||
|
|
f201183047 |
tune: the compact window is Long conversations, one value for both agents
7eleven (Discord #help): the Usage page's "Tuned for you" compaction
value and the agents' sheet "Long conversations" window were two values
that could disagree. Codex's tune wrote model_auto_compact_token_limit
into config.toml beside the catalog's context_window that Long
conversations writes; Claude's read its own env.
One source of truth: settings.CompactAt / FullContext. Tune's compact
row for Codex and Claude Code now has source "long": its Current is
settings.Compact(), Use calls provider.SetCompactAt (Sync writes Codex's
catalog and Claude's CLAUDE_CODE_AUTO_COMPACT_WINDOW as before), Undo
puts back the CompactAt/Full it stashed under tune.long.compact. So a
value set on either page shows on the other and writes the same config.
writeCompact marks claude.compact_long when the env value came from
settings, so Claude's row reads it as ours, not as the user's.
Migration (Codex Sync, local place): an old tune.codex.compact stash
whose limit is still the one tune wrote moves into Long conversations.
At default or Full it takes tune's value; with a value the user set it
takes tune's only when smaller. config.toml gets the user's earlier
limit back or loses the key; the stash is forgotten. A limit the user
changed after tune wrote it, or wrote themselves, stays and reads
Locked. A provider's Compact at or the user's own Claude env stays
Locked too.
Run (mote, at this tree):
- go vet on agent, provider, gui, tune; GOOS=linux go vet -tags nogui
./...; GOOS=windows go vet ./...; go build ./... and -tags nogui: ok
- go test -tags nogui ./internal/agent ./internal/provider
./internal/tune ./internal/gui: ok (TestCoreScriptBudget within the
budget, not raised; context.js is 33 bytes smaller)
- GUI: compact-one-value.test.cjs (new; Chromium and WebKit, en zh
zh-TW ja de) and context-tune: 104/104 at the rebased head
Broken by hand: the Codex long branch, the Claude long env check and
the Sync migration call each turned red TestClaudeCompactAt,
TestCodexHomeEnvTakesThePick, TestTuneCodexCompact,
TestTuneCodexOwnLimit, TestTuneCodexMigrate (4 subtests),
TestTuneClaudeLong and TestTuneCodexMigrateOnSync. Old context.js and
i18n.js turn compact-one-value red ("You set 272K").
Not run: full suite, Go or GUI (shipped at once per owner; the GUI suite
is still running on mote, reds get their own issues).
Not tried: a real Codex or Claude Code session reading the written
config; the migration on Windows/WSL places (it runs for the local
place only).
|
||
|
|
8c5c83c9fc |
gateway: a Responses client's cache marks to Claude last an hour (#3972)
7eleven (Discord #feedback, #3972): Codex routed to a Claude model on an Anthropic Messages upstream (an API key or a relay) had the cache marks magpie adds at Anthropic's default five minutes. Codex's turns are often further apart, so the thread's prompt was written again after each pause. Decided, zero config: the marks anthropicBody adds for a Responses client to a Claude model carry ttl 1h (addedMark, Request.hourMarks). - Price (claude-api skill, prompt caching): a 5m write is 1.25x input, a 1h write 2x, a read 0.1x (less on Opus 5.5 / Fable). In a busy loop the 1h marks cost 0.75x more on each turn's new tokens only; one turn after a 5 to 60 minute pause reads the prefix instead of writing it again (1.25x of the whole prefix), which pays for dozens of turns. - Codex's own vendor keeps a thread cached an hour (chatGPTCold); Claude subscriptions already go 1h through Claude Code (cacheMark1h). - No magpie setting exists for these marks: tune's cache_ttl and subagent_cache_ttl write Claude Code's own settings and don't apply. - The client's own say wins: prompt_cache_retention "in_memory" keeps 5m; marks a client placed itself are never touched (only magpie's added marks change). Every added mark has the same ttl, so none follows a shorter one. - A relay that answers 400 naming cache_control and ttl is asked again at 5m and remembered in unfit (hourMarksRefused). - Not changed: Chat clients' marks (OpenCode and one-off callers alike) stay 5m; left open on #3972. Non-Claude models on Messages unchanged. Tests: TestResponsesToClaudeMarksLastAnHour, TestHourMarksRefused. Broken by hand, each on mote: - addedMark always 5m: the four 1h subtests and both refusal cases red. - the refusal retry removed: "ttl refused" red (400 after 1 call). - in_memory ignored (hourMarks = true): "in_memory asked" red. Docs: gateway-routing.md, a bullet beside the Kiro cache marks. Run (mote, at this commit): go build -tags nogui ./... ok; go test -tags nogui ./internal/gateway ok (522.7s). Not run: full suite (pushed at once per the owner's rule). GOOS=linux and GOOS=windows go vet ./internal/gateway ok; gofmt -l clean. Not tried: a real Anthropic key or relay (no request was sent upstream), Bedrock or Vertex with ttl 1h (the refusal fallback covers a 400). |
||
|
|
02a328d86a |
gateway: Claude Desktop's model check goes to the session's model again
CyberCaius on Discord, after v0.1.1819: the startup error is gone, but
Desktop's check ({"max_tokens":1,"messages":[{"role":"user",
"content":"."}]} on the first haiku it is listed) now went to leee's
claude-haiku-5-5, another provider's Claude model, and spent its quota.
He wants it on the model or group his session uses.
|
||
|
|
6e331afb45 |
gateway: Claude Desktop's model check goes to the model it names; a relay gets a cache key
CyberCaius on Discord: Claude Desktop said at every start
'Gateway rejected model "magpie-<n>.anthropic.claude-haiku-5-5[1m]"
(HTTP 400)', body "Arouter: prompt_cache_key is required". His
Routing page showed leee/claude-haiku-5-5 served by AnyRouter's
gpt-6.1-sol, with a "." prompt.
Two causes:
- Desktop checks a gateway model as it starts (and from its settings'
Test) with {"model":<it>,"max_tokens":1,"messages":[{"role":"user",
"content":"."}]}, on the shortest id with haiku in it (lWt, JUt and
YT in its app.asar, 2.7032, read from the installed app). desktopTurn
took that small tool-less request for a session title and sent it to
the session's model, AnyRouter's gpt-6.1-sol, so a failure there read
as the haiku rejected. desktopProbe now knows the check, and it goes
to the model it names. Titles still go to the session's model.
- A request translated from an Anthropic client to a Chat or Responses
upstream never had a prompt_cache_key, and AnyRouter refuses one
without. ownCacheKey/cacheKeyOf give it one per conversation (a
hash, in a UUID's shape, of the client's session header, else of its
first user message; it names nothing of magpie) on OpenAI's API with
a key and on providers the user added by address. Presets, signed-in
accounts, plugins, Bedrock and Vertex get nothing new, nor does a
provider whose extraBody (#1604) names prompt_cache_key: the user's
value is the one sent. An upstream whose 400 names the field is asked
again without it and not sent it again (the existing path for Codex's
key); any other 400 is not asked again for magpie's key, so an
unrelated refusal is tried as often as before.
What is sent changes, on purpose, for those providers: the translated
bodies in testdata/upstream_bodies (anthropic-to-chat,
anthropic-to-responses, responses-to-chat and the large one's hash) now
carry the key.
Unticking AnyRouter's Claude models had no part in it: nothing went
to them. The probe was rerouted to the session's pick.
Tests: TestClaudeDesktopProbeAsked (a fake Anthropic "leee" and a fake
Chat relay that answers AnyRouter's 400 without a key: turn, probe of
the haiku alias, title, second turn keeps the key), TestDesktopProbe,
TestOwnCacheKey (scope, extraBody's key left to the user, and a relay
refusing the field asked twice once, then once).
Run (mote):
- go test -tags nogui ./internal/gateway/ -run the new tests,
TestUpstreamBodiesUnchanged, TestExtraBody*, TestOtherBadRequestNot-
AskedAgainAtLow, TestTranslatedEffortMinimalRefused, TestTooFew-
TokensSaidWithSigns, TestHighRiskErrorFallsBack, TestVertex*Retries*
and every *CacheKey* test: ok
- a full ./... run of the first draft at
|
||
|
|
5ced5b1aa0 |
routing: a wallet's row says what of it lapses first, as the Usage card does (#3964)
MYCF711's SuperMagic plugin (magpie-magicrew-auth daca18e) sends a balance window 积分余额 with runsOut, and 今日 / 限时 / 永久 as aside rows. The Routing page already showed all four rows, in the stage row's tooltip and the account list's .wins line, both through cardOf/winsOf (the Usage page's own readings). The row's own text said only "6,291 积分 left". For a wallet seat, quota() now adds the Usage card's runsOutText for the card's window of the same balance and unit: "6,291 积分 left · 185 积分 expire 23:59". It is client only. The Go side (allowanceOf, Weighed) is unchanged, because the aside rows are display only and routing weighs the total. Run (mote, at |
||
|
|
7b63feb908 |
gui: a browser tab's font rows show on a nogui magpie, and Text size no longer flashes
Norcleeh (Discord #general, after v0.1.1788): in magpie's web GUI the interface-font and code-font rows "flash once and disappear" on refresh. Cause, reproduced on a real nogui `magpie web` on mote in Chromium and WebKit, at 127.0.0.1, localhost and the LAN address: a nogui build (Docker, magpie-cli) has fonts.Available false, so boot.js carried no `fonts` flag and app.js never showed the font rows at all. What flashed was the Text size row: index.html shows it, and renderSettings hid it for a browser tab 40-120ms later (`#textSizeRow.hidden = web`). Fix: - A browser tab always gets the font rows. Its /api/fonts answers the server's families plus a common list (Arial, Menlo, Consolas, PingFang SC, Microsoft YaHei, Noto Sans CJK SC, JetBrains Mono, ...) and never errors for a tab; fonts.js keeps only what this browser can draw, and "System default" is always offered, so with nothing kept the rows still show with it. - The app-only rows (Text size, tray, login, tray usage) carry .app-only, which `body.web .app-only` hides before first paint, so none of them paints in a tab. - The boot `fonts` flag is gone. app.js and core both got smaller; no budget changed. - docs/subsystems/gui-shell.md "Desktop fonts" says so. Run (mote-run, at this head rebased on |
||
|
|
6f0e40572c |
gui tests: a plugin's words are its own when said as words (#3897)
yetone (#3897): i18n-keys' "a plugin's words are its own" is red on main since |
||
|
|
5ed6669cec |
sync: the account an agent is kept signed in to stays each computer's own
YsiCing on X: with only the library and usage ticked, the default account of a subscription with several followed the other computer: a personal one at home, a work one at the office, set again every day. The providers part always syncs, and provider.Mirror took the other computer's Provider whole, KeepLogin, KeepLoginAs and SwitchOnly with it. Mirror now keeps this computer's three for a provider it has, and a new one comes without KeepLoginAs (an account signed in over there). davsync's hashes blank the three, so changing which account is kept uploads nothing and two computers that differ only in it don't trade the part. The sign-ins themselves (logins.json) were never synced. A backup Restore is left as it is: it is asked for, and brings the backup's choice. Run on mote at this tree: go test -count=1 ./internal/provider ./internal/davsync ./internal/backup ok; go vet for darwin, linux and windows on both packages ok. Broken by hand: with backup.go and davsync.go reverted, TestMirrorKeepsKeepLogin and TestKeepLoginIsNoChange both fail. Not tried: two real computers syncing through a real WebDAV folder. |
||
|
|
396e0e4638 |
usage: a deleted provider's requests merged into another, or named, from the Requests filter
CyberCaius on Discord: a deleted provider's requests sat under its old id
("<date> 已删除"), and the only way to put them under a provider they
have was renaming that provider onto the old id. Now, with a deleted
provider picked in Usage › Requests' Provider filter, a "…" beside it
offers Merge into… (an app menu of the providers there are now) and
Rename… (the filter's button turns into a name field; Enter or leaving
it saves, Escape keeps it). With the merged-into provider picked, the
same "…" lists Separate <name> for each, the undo.
Nothing in the log is rewritten. Both live on the deletion's own record
in providers.json (Deleted.Into/MergedAt, Deleted.Label), so a provider
added later under the old id inherits neither: it is a different
provider, and its record of its own is what it has. Renaming the target
carries the merge (Rename rewrites Into); deleting the target ends it.
Renames.Both(id, time) gives the id a call is shown under and the one it
was made to (Own). Listing, filtering, the summary and vias go by the
shown id; pricing (Record.priceID, block_price's as), window holds and
the gateway's loggedAnswers go by the own one, so a merge moves no cost
or token, only whose name they sit under. The target's face lists what
was merged into it (Named.Merged). Routes: GET /api/usage/deleted/into,
POST /api/usage/deleted {id, into?, name?}; a field not sent stays.
Run (mote, at this tree on
|
||
|
|
77898391d5 |
code standards: a red's issue is read to its last comment, and a patch on it is taken first
Seen on 10-12 (#1794), 10-17 (#2444) and 10-28 (#3568, JoeyWu-tech's patch waited three days until
|
||
|
|
e29ddc407f |
library: a Pi in WSL is given MCP servers, and so are seven more WSL agents
leokon on Discord (#help): the Library's MCP section listed only the Windows Pi, never a Pi installed in WSL. wslTargetOf left pi@wsl's MCP out because its version wasn't known, and Pi's MCP file depends on the version: 0.99+ reads mcp.json itself; before that, pi-mcp-adapter 3 reads mcp-adapter.json and 2 reads mcp.json. - The WSL probe now asks the distro's pi for --version (wslKind version: true). The answer is stored as the agent's wslVersion, and InstalledVersion returns it for an agent in WSL. - pi@wsl:<distro> gets piMCP. The file is chosen as on this computer, with the distro's npm roots for the adapter (~/.npm-global, /usr/local/lib and /usr/lib node_modules): wslPiRoots, piDetectIn. - Siblings: every agent with a local MCP target and no WSL one now has one, in its own file under the distro's home. These are Gemini CLI, Antigravity CLI, Crush, Cline, CodeBuddy Code, Kimi Code and Goose. - Every WSL MCP file is marked WSL with its distro, so a Windows program (C:\...\npx.cmd) is refused, as for claude/codex@wsl. - Not fixed: Kimi Code's and Goose's skills in WSL. On this computer they get the shared ~/.agents/skills, but the distro's needs that folder's sharing rule (#3966). Run (at |
||
|
|
11c427eaa6 |
gateway: a handed-off gateway stops accepting at once and answers every connection it took (#3568)
On a restart to update the old magpie hands its listening socket to the new one (Inherit, then HandOff once the new one serves on it). HandOff only marked the drain, so the old one went on accepting from the shared socket beside the new one until its end's Shutdown closed its copy. net/http's conn.serve returns without an answer when it reads a request after Shutdown began (go1.26.8 net/http/server.go:1994), so a connection the old one took in the moment before its Shutdown, whose request it read a moment after, was closed unanswered. The agent got EOF on a fresh connection, which Go's client doesn't retry for a POST. That is CI's red at |
||
|
|
a05b373538 |
checkin: a plugin's until is when its answer stops holding (Qoder's 10:00 UTC+8)
sdytman on Discord: Qoder's daily credits start at 10:00, can the plugin's check-in follow it? Qoder's /me/campaigns opens each day's CLAIM_BENEFIT campaign at 10:00 and closes it at 09:59 the next day, UTC+8 (startAt and endAt, read with a real account on 10-28; Qoder.app polls the list every 5 minutes). A check-in before 10:00 meets the day before's campaign. Since #2696 the Qoder plugins are asked again every 30 minutes, so today's was claimed somewhere between 10:00 and 10:30; a plain plugin was settled for the Beijing day. auth.checkin may now answer until (RFC 3339 or epoch ms); host.js passes it as RFC 3339 (plugin.Checkin.Until), kept as ValidUntil. settled holds an answer only until then, whatever its outcome; the loop wakes at it instead of its next 30-minute look; an early done that carries it is not provisional (#3326), as the vendor said when its day turns. Instants throughout, so the machine's zone doesn't matter. The Qoder plugins send until from 0.2.43 (plugins fd40b20): the check-in now lands at 10:01. Run (mote): TestPluginCheckinAsksAgainAtUntil, minute by minute from 09:27 Beijing to the next day's 10:30, with time.Local UTC, UTC-8 and Beijing: asks at 09:27, 10:01, 00:00 (the Beijing day), 10:01; a failure in the 09:59 gap asked at 10:01:00 only. GOOS=linux and windows go vet; go test -tags nogui -timeout 45m ./... all ok (76 packages). gofmt -l clean. Broken by hand, each red: settled ignoring ValidUntil (no 10:01 asks); tick not waking at it (10:27 instead); provisional ignoring it (asked every 30 minutes from 00:00 to 10:00); host.js dropping until (ValidUntil zero). Not tried: the Qoder plugin's recheck path with until (the fake plugin is fakeco; the tick and settled it goes through are the same); a GUI change (none: until isn't shown). |
||
|
|
f39fc3ac8b |
usage: a model list that was answered is no row of Requests (ferock on Discord)
ferock (Discord #general): Usage > Requests is full of rows like "magpie · magpie's own · Remote magpie · API · Model list · 0 0 · 757 ms · 200, GET /v1/models", which no tool of theirs sent. Cause: |
||
|
|
08b02cf18c |
providers: a pool stops at its caps and reads usage again near them (plugins#349)
What was adopted on magpie-community/plugins#349 (1939869736luosi): one
place, in the GUI and the CLI, for a subscription's account pool, and an
opt-in conservative mode.
- Stop at the caps (Provider.CapStop, off by default): once every account
in use is held at its cap, the request is answered 429 rather than going
on to the provider's fallbacks (plan returns restLast). Off, as before.
- Check usage again near a cap (Provider.CapCareful, off by default,
internal/gateway/cap_careful.go): before planning, a capped account's
usage is read again when its reading is over 15s old within 5 points of
a cap, or over 5m old at all; the request waits at most 10s, and a
failed account is asked again at most every 15s. An account whose usage
was never read, whose last read failed, or whose reading is still that
old is then held as one at its cap is (capHold "unread", traced as
Weighed.Unread, named in the 429 with "--careful off"). Generic: it
goes by provider.UsageRead/ReadUsageNow, so every subscription that
reports usage windows (Codex, Claude, plugins) gets it.
- provider: usedCache records each account's read state; a failed read
keeps the last good reading's time. ReadUsageNow no longer reports
false when the read had already finished on the first ask.
- GUI: under the provider's account list, once an account has a cap (or
either is on), two ticks for the above, and a note naming the accounts
in use with no cap ("used to 100% of each window"). Accounts, order and
caps stay where they were in that list. zh, zh-TW, ja, de added.
app.js 1,309,658 within its 1,310,460 budget, unraised: addRow and a
per-row forgetOf replace 3 add-button and 5 Remove-button builds.
- CLI: magpie provider pool <id> [--accounts a,b,…] [--cap percent|off]
[--stop on|off] [--careful on|off] shows and sets the whole pool.
- docs: gateway-routing.md and providers-accounts.md.
Run (mote, before the rebase at
|
||
|
|
8bade6c5e2 |
provider: a plugin's usage window can be a prepaid wallet's balance (#3950)
SuperMagic's accounts (mycf_711's magicrew plugin) are prepaid wallets of
points with no total. A plugin can now send a usage window as
{name, balance: 6291, unit: "积分"} with no used or limit.
- host.js passes a finite balance on (at least 0), anything else as null.
plugin.UsageWindow.Balance and provider.QuotaWindow.Balance are *float64.
- quotaOfPlugin keeps the figure and does not make the window Text or
Aside, so routing knows the account with no Used invented. allowanceOf
copies it into Limit.Balance; an empty wallet counts as used up.
Allowance.Left(model) is the least balance of the windows that count
the model.
- weighRouted fills routes.Seat.Left and Seat.LeftIn (the account's
provider and unit). Smart, pace and usage (least used) put the seat
with more left first where they would otherwise tie (byLeft), only
when every seat with a balance shares one LeftIn: balances in two
units or two providers are never compared. Tiers still come first.
- The Usage card, the Routing page (Weighed.Balance: the small row's
text, no bar, a why sentence, the account list), magpie accounts and
the status line show the figure, "6,291 积分 left", never a share.
- Docs: provider-plugins (new section), gateway-routing,
providers-accounts, plugin-runtime, host.js typings and the site's
plugins page (en, zh, ja).
Run, at base
|
||
|
|
833f51adcf |
gui: a browser tab has the font rows too, with its own choice
Norcleeh on Discord: magpie opened in a browser had no font setting in Settings > General, while the app does. The rows were hidden on purpose: /api/fonts answered 404 to a browser page and boot sent it no choice, since the list is the fonts of the computer magpie runs on and the tab can be on another one. Now a browser tab (magpie web, or the app's page in a browser) has both rows wherever magpie can read its fonts (boot's fonts; a nogui build can't, and keeps them hidden). Its list is /api/fonts less the families this browser doesn't draw (fonts.js here(): text in the family measures apart from monospace's or serif's on a canvas), so another computer's fonts and Safari's user-installed ones aren't offered. The choice is the browser's own, in localStorage (magpie.fonts), applied by fonts.js before the first paint; it neither changes nor takes the app's settings.UIFont/CodeFont, and a settings save from a browser still keeps the app's. Run on mote at this tree (on |
||
|
|
a1222c539f |
LESSONS: a mover's min moves to the code standards (third day), and red issues' patches sat unowned on 10-27
- A plugin version published with no mover min raised was seen on 10-16, 10-18 (zed 0.1.9) and 10-24 (factory 0.1.38, raised four days later in |
||
|
|
88466f8bf2 |
provider: a ChatGPT account whose usage read says OpenAI signed it out reads as signed out, with Sign in again (charliepu on Discord)
charliepu (#general): a ChatGPT account sometimes shows no allowance; OpenAI had signed it out, and it needed signing in again. The row said nothing of that. |
||
|
|
f6ed2c99bc |
effort: a vendor's light and extra_high are low and xhigh, in dsh, Pi and the gateway
nianshou5 (Discord) runs Trae's DeepSeek V4.1 Flash through the Our Free Model plugin (github:mu-zi-lee/magpie-our-free-model). Its variants are Trae's own names, light, high and extra_high, and dsh offered only default and high: dshModelLevels (and Pi's piThinkingLevels) matched a model's efforts to pi-ai's level names only, so light and extra_high were dropped. The gateway dropped them too: effortOf read "light" as no effort, and NearestEffort fitted an agent's low or xhigh to the plugin's high. catalog.EffortAliases names light as low and extra_high as xhigh (EffortLevel). NearestEffort places a model's levels by the level they name and returns the model's own word; the gateway's effortOf reads an alias as its level. dsh's reasoningEfforts and Pi's thinkingLevelMap map dsh's low/xhigh to the model's own word (modelEffort), which llm-pi-ai sends on the wire as written (resolveModelReasoning in dsh-llm-pi-ai reads each value as "the spelling dispatch sends"). Levels a user kept are untouched: only the names a model lists are mapped. Tests: TestDshOffersTraeNamedLevels (agent), TestNearestEffortTakesVendorWords (catalog), TestPluginThinkingOff's new fake-trae subtests (gateway, a real plugin host with the fake plugin listing light/high/extra_high). Broken by hand: modelEffort without the alias, dsh levels [high] (the report's picker); NearestEffort without EffortLevel, low/xhigh sent as high; effortOf without the alias, light/extra_high sent as nothing. Run on mote at this tree (base |
||
|
|
3e22123c9c |
usage: a deleted provider's calls stay apart from a new one under its id
cybercaius (Discord): after deleting a provider and adding a new one
that took the same id, the old provider's usage showed under the new one.
Delete now records the provider in providers.json ("deleted": id, name,
icon, when, its Was and Gave). UsageRenames gives a deleted id to
<id>~<when> only once something reuses it (a live provider, a later
deleted record, or a later Was), so a deleted provider nobody replaced
keeps its raw id and the existing probe/usage tests stay as they were.
/api/usage's provider faces name a deleted id from its record and set
Named.deleted; the Usage provider picker notes "Deleted {date}" (zh, zh-TW,
ja, de translated). Old deletes, made before this, have no record and
stay merged: nothing tells their calls apart now.
Run (mote): go test -tags nogui -run 'Deleted|Rename|NotSetUp|Probe'
./internal/usage ./internal/usageapi ./internal/provider ok; gofmt -l
clean; go vet -tags nogui ok.
Broken by hand: dropping the f.Deleted append turns
TestDeletedProviderKeepsItsCallsFromOneAddedUnderItsID and
TestDeletedProviderListedApartAndMarked red; restored, green.
Not tried: a real delete-and-re-add in the GUI app.
|
||
|
|
8fff54dab7 |
routing: a group in a group left on Smart is routed as the outer one (#3847)
mycf_711 (#3847): an outer group set to Free first held a group whose routing was left blank (Smart); the inner group's free seat was tried after its paid one, as if Free first stopped at the inner group. provider.Group.Within: in membersOff's walk, a nested group with no routing of its own takes the outer group's when the outer one pools its members (Smart, Free first, Fastest, ... ; not In order, By weight or Manual, which try each member whole by its own order, #576). A group that sets a routing keeps it. The gateway, the trace's Subs and the Routing page all read membersOff, so they agree; GROUP_NEST's help sentence says so (zh, zh-TW, ja, de). Run (mote): go test -tags nogui -run 'FreeFirst|Group' ./internal/gateway ./internal/provider ok; GOOS=linux and GOOS=windows go vet -tags nogui on both packages ok; go build -tags nogui ./... ok; gofmt -l clean. Broken by hand: without the Within call TestFreeFirstReachesAGroupInItLeftOnTheDefault is red (paid seat first), green with it. Not tried: the reporter's own groups in the real app. |
||
|
|
c544789047 |
agent, gui: the Codex takeover names browser use and offers Keep on ChatGPT
eddie.zhan on Discord (10-27): once Codex's allowance ran out, magpie
took it over and "many features stop working, browser use is blocked,
the agent says it has no permission".
Cause, from openai/codex 5a361b5: under the takeover magpie is Codex's
model provider without requires_openai_auth, so app-server's
getAuthStatus hands the app no auth token. The Codex app's Chrome
control needs that token, so browser use is off till the reset, with
cloud tasks, the usage meter and Log out. Image generation (actor
authorization header) and web search (provider default) stay. Bringing
requires_openai_auth back would bring back the greyed Send the takeover
exists to avoid, so it can't be kept by config.
The off switch existed (sign-in > Always ChatGPT, `magpie codex login
chatgpt`) but nothing under the takeover pointed to it. The default is
kept; the opened Codex row's takeover note now names browser use and has
a Keep on ChatGPT button (login=chatgpt) on its own line. In every
language.
Also fixed: Always ChatGPT picked while Codex was taken over on one of
its own models left model_provider = "magpie" for good. set now puts it
back on the sign-in as Join leaves it.
Run (on mote, at this tree):
- go test ./internal/agent ./internal/gui: ok except
TestWSLColdPlaceOpensNothing (#3924) and TestMainWindowCorners/macOS_26
(#2645), both red on origin/main
|
||
|
|
ff7048dece |
provider: a Command Code plan key's Credits window renews at the plan's period end (#2454)
#2451 drew a plan key's month of credits as a Credits meter beside the 5-hour and weekly windows. Those two say when they start again; the Credits one said nothing, though cmdKeyPlanID already asks billing/subscriptions for the plan id and threw its currentPeriodEnd away. cmdKeyPlanID now keeps the period end beside the plan id (cached the same ten minutes, and the pair read before kept while the endpoint can't be read), and cmdQuotaOf puts it on the Credits window's ResetsAt. No new request. The signed-in subscription's card is the plugin's since be62bcf79; the plugin sets the same reset from commandcode-auth 0.1.13. Patch by ggbdpq (Discord gua2100), as rebased in #2454. Added in review: a period end already past is dropped, so a pair kept while the endpoint fails, or a renewal its reply doesn't show yet, never puts a reset in the past on the card; the test has a case for it. Run (sandbox HOME, at origin/main |
||
|
|
85b45b4d71 |
usage: a window's dollar whole prices the model the reply named (#2488)
The ledger prices a call whose own id has no price as the model the
reply named (Served, #1498). A window's whole priced through apiPricer,
which looked only at Record.Model, so one such call in a window had no
API price, the window counted as unpriced and its dollar whole was left
out while its tokens stayed. apiPricer now tries Served through the same
chain (maker, the provider's list, Same as) when the asked id has none.
The asked id keeps its own price when it has one; a price the user set
or a rate still never enters the whole. Past cycles use the same
apiPricer and take it too.
Patch by ggbdpq (Discord gua2100), as posted in #2488. Review: the
pricer is a closure built once per query with its own cache, keyed now
on (provider, model, served); no shared or stateful call added. The
only conflict on current main was the test file, where the Antigravity pools test
(TestWindowHoldsReckonsAntigravityPools) landed in the same spot; both
tests are kept.
Run (sandbox HOME, at this tree on origin/main
|
||
|
|
02cbdf5bdc |
pii: pf-serve-vulkan keeps the engine's 4096-token MoE chunk; 2048 was slower (#3682)
|
||
|
|
90258cf20a |
agent: a Codex in a WSL distro stands in for a model it names from its own config.toml (#2198)
StandIn("codex", …) read this machine's ~/.codex/config.toml alone, so a
Codex wired in a WSL distro (model_provider = "magpie", the only shape a
distro under NAT is wired in since #2145) naming a model magpie doesn't
serve (codex -m <unserved>) was answered 404, where this machine's Codex
goes to its config's model and a Claude Code in the same distro goes to
the stand-in its settings name (wslClaudeStandIn, #254). On Windows, when
this machine's Codex names none, StandIn now asks wslCodexStandIn: the
first distro running now whose config.toml has magpie as its provider,
read as codexStandIn reads it. The collecting of running distros the
probe found a kind in is shared with wslClaudeStandIn (wslReady); a
stopped distro is never opened. Off Windows nothing changes.
Reported with a patch by ggbdpq (gua2100 on Discord), independently
re-run by Edward4226. Taken as written except: the distro's config path
comes from the place's codexHome (where magpie writes it) rather than a
spelled-out ~/.codex; wslClaudeClassifier, which landed since with the
same loop, is left as it is (no test covers it); and TestWSLCodexStandIn
now also calls StandIn itself, so the Windows-only wiring is tested.
Run (sandbox HOME, caches pinned):
- go test -tags nogui -run 'TestWSLCodexStandIn|TestWSLClaude|TestCodexStandIn|TestClaudeStandIn' ./internal/agent: ok.
- Broken by hand: wslCodexStandIn returning "" fails TestWSLCodexStandIn
("stand-in: \"\""); wslReady without the running filter fails
TestWSLCodexStandInSkipsStopped ("stand-in from a stopped distro:
\"stopped/model\""). Restored: ok.
- On the Windows box (agent test binary built GOOS=windows): the same
five tests pass; built with StandIn's codex branch put back,
TestWSLCodexStandIn fails "StandIn on windows: \"\", want \"relay/main\"".
- go test -tags nogui -run 'WSL|StandIn|Wsl' ./internal/agent: one red,
TestWSLColdPlaceOpensNothing (Hermes profiles of a stopped distro),
red the same at origin/main
|