1ccacad63281094de8a3372d5a507d38f9969e5c
516
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f5e1b10913 |
settings: longest context can hold a model's own window too (WJaunita45604 on X)
v0.1.3681's Longest context left a window the user set for a model, or "*"
on its provider, alone even when longer. Settings > Models > Routing now has
a menu beside the field: "Models without their own" (the default, as before)
or "Every model". In both modes the shorter of the cap and the user's own
window is told; they differ only when the user's own is longer (own keeps it,
every model brings it down). Settings.ContextCapAll, Settings.CappedOwn,
POST /api/settings/context-cap-mode {all}, magpie model context-cap all|own.
Applied in provider.windowIn (so /v1/models, catalogs, compaction), Codex's
CodexNativeWindow/CodexWindow (the list's ETag tag carries the mode) and the
gateway fallback window. i18n in zh, zh-TW, ja, de.
Run (wsl-run, mote's disk was full): provider (full), settings, settingsapi,
codexcat packages; cli -run ContextCap; gateway -run ContextCap|ModelsList;
GUI context-cap, i18n-keys, model-load, settings-places, settings-general in
chromium and webkit; TestCoreScriptBudget; gofmt; go vet nogui and
GOOS=windows vet. Broken by hand: windowIn's CappedOwn removed turns
TestContextCapAllHoldsTheUsersOwnWindowsToo red.
Not tried: the whole Go and GUI suites, a real Codex reading the list, macOS
or Windows runs, GUI in zh-TW/ja/de beyond the i18n-keys check.
|
||
|
|
61a04f42a2 |
library: a project's Skills menu groups the skills by source, a heading ticks the whole group (Elorynth on X)
The project card's Skills menu listed every library skill flat. It now
lists them as the Library does (skillGroups(true): by repository or the
user's own group, this computer's last, whatever sort the list has), with
a heading over each group. Pressing a heading ticks all of the group's
skills, or unticks them when all are in; it is half-ticked while some are.
A typed filter keeps a group's heading over the skills it finds, and
matches a skill by its group's name. One group only stays the flat list.
openProtoMenu takes a `group` option (the values it ticks) for this.
Paid for in app.js by five comments cut, no budget raise.
Run on the Windows box (mote's Chromium launch hung, SSH refused at
times): project-skills-groups.test.cjs, new, in chromium and webkit,
en/zh/zh-TW/ja/de at 400px wide: red on the old code (6 of 6), green
after. With project-*, i18n-*, menu-*, proto-menu-overflow and
skill-group* GUI files in both engines: all green except
menu-input-scroll and menu-scroll (14 chromium, 13 webkit), which are
red the same at origin/main
|
||
|
|
7476328901 |
settings: one longest context for every model (WJaunita45604 on X)
Settings > Models > Routing has a Longest context field (magpie model context-cap [<size>|off], POST /api/settings/context-cap). It lowers every model's window to it, so a user need not set each model. A window the user set on a model, or on its provider with "*", wins and is not capped; a model whose window is unknown stays unknown. It is applied where the window is derived, provider.windowIn, so /v1/models, every agent's catalog, group windows and the compaction thresholds that follow the window all agree. Codex's own models take it through CodexNativeWindow, CodexWindow and codexcat.Cap on the list the gateway serves; the list's ETag carries the cap so Codex asks again. The provider editor's Listed value stays the vendor's. Run (mote): provider, codexcat, cli, settings, settingsapi, gateway tests; GUI context-cap, model-load, settings-places, i18n-keys, settings-general in chromium and webkit (en, zh); TestCoreScriptBudget; gofmt; vet on darwin, linux nogui and windows. Broken by hand: windowIn without the cap turns TestContextCapHoldsEveryModelButTheOnesTheUserSet and TestModelsListContextCap red. Not tried: the whole GUI suite (one row added to an existing list, no new API read on page load), a real Codex reading the capped list, Windows run. Not covered: Claude Code's own [1m] choice (claudeRunName) and agent/claude.go's fallback when a ref has no window. |
||
|
|
88c417392e |
usage: a sortable model speed ranking on the Requests tab (@flying_crp on X)
Usage's Requests tab gets a "Model speed" card: per model, the median output tokens/s, the median wait for the first token and the request count, over the selected range, sortable by every column (aria-sort header buttons, quiet table, no gradients). A request counts when it was answered (not rejected, handed on, failed or canceled), its first token was timed and it wrote 100 tokens or more (usage.MinRankTokens; the tooltip says so). Computed locally: each chunk keeps a 2% log-bin histogram per model beside its cells (speed_rank.go, chunkPart.speeds), a page merges the chunks' histograms, so there is no per-request sort and medians are within ~1%. The settled chunks' histograms are in the page file; its key salt is now page-v2, so the first load after upgrade recounts settled history once. /api/ledger sends speeds and speed_min. Run (mote): gofmt clean; go vet darwin, linux nogui, windows for the touched packages and ./... earlier; go test internal/usage, internal/usageapi, internal/gui ok at this head; usage-model-speed.test.cjs 12 of 12 (chromium and webkit, en/zh/zh-TW/ja/de, 400px: order, sort by every column, aria-sort, focus kept, no horizontal overflow, ellipsis, hidden when empty); with i18n-keys and i18n-en-no-cjk 20 of 20; the whole GUI suite once on the branch before the rebase: every red is in a file unrelated to this change (account-arrange #6010, account-refresh-holds #5814, account-eye #5052, agent-switch-accounts #5925, bulk visibility and disconnect previews #5982 fixed in |
||
|
|
ae449f8e4f |
gui: the sidebar's tab lists give each tab a mark of its own
Library's, Usage's, Plugins' and Settings' tabs, listed under their page
in the sidebar (navSubs), were names alone while every page above them
has an icon (the owner, with a screenshot of Library's list). Each tab
now has a 14px line mark before its name, from NAV_SUB_IC by page and
tab id: segs gives its buttons data-seg (Usage's own strip too), and
Settings' tabs have data-set. A tab with no mark (none today) keeps an
empty slot, so the names stay in one column. The mark is muted, and
takes the row's ink when the row is hovered or picked.
The marks are in navicons.js, imported with the first list drawn, which
then draws again with them. Its one line in app.js is paid for by two
navSubs comments cut, so the core's script budget is not raised
(1,533,751 of 1,533,802).
German's longest Settings names ("Synchronisierung und Backup") were
cut with an ellipsis at 1100 before this; "Netzwerk und Freigabe" now
is too (7px). Left as is: shortening the word would change it in five
other German sentences that name the tab.
Run:
- nav-sub-icons.test.cjs (new): every row of the four lists has its
mark, 14px, before its name and level with it, one column per list,
names whole (not German); en zh zh-TW ja de, Chromium and WebKit, on
WSL (magpie-desktop): 12 of 12. Red with Library's memory mark taken
out by hand ("library: Memory has a mark").
- go test ./internal/gui on Windows: 8 reds, the same 8 alone on
origin/main
|
||
|
|
9212185a73 |
gateway keys: Model names is a row of name and a picked model, not a textarea (tsingchao on X)
The key's Model names editor was one textarea of "name = provider/model" lines. It is now a row a name: the name typed, the model picked in the app's menu (search by name or id), x to remove, Add a name for another, the Headers editor's row. A row with a name and no model, or the reverse, holds Save off; a row with neither is left out. aliases-key's body and the saved data are as before; the line-format message is gone, so is its key. Run (mote): gateway-key-search-names (rewritten for the rows) + i18n-keys, 24 ok, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 440. Broken by hand: half-row check off, the test goes red in all 10 chromium cases. Screenshots before and after in chromium, dark and light, 900 and 420. Not tried: Windows/Linux GUI run; the whole GUI suite runs after the tag. |
||
|
|
ce5e5964db |
gateway keys: model search box, re: patterns and Model names in the key editor (tsingchao on X)
The model picker of a gateway key gets a search box (name or id) and takes "re:<regexp>" typed then Enter; the row menu gets Model names (aliases-key). Docs: gateway-routing.md "A key's model patterns and names". Run (mote): go vet darwin, windows, linux nogui on access/gateway/cli/gui; go test internal/access, gateway (937s), cli, gui all ok at the pre-rebase base; after rebasing on origin/main: go build ./..., the new Go tests, TestCoreScriptBudget, and GUI gateway-key-search-names + gateway-key-models + i18n-keys (28 ok, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 440). Broken by hand: pattern match off (gateway + access tests red), aliasRequest off (alias test red), search argument removed (all 20 chromium GUI red). Not tried: Windows/Linux GUI run, a real client against a real key; the full suite runs after the tag. |
||
|
|
d77eb6d236 |
memory: search by meaning, on a small model on this computer
A memory search now finds what means the same in other words or another
language ("什么时候上线" finds "Releases go out on Tuesdays"), for the
MCP server's memory_search and the Library's Memory tab alike. It is off
until switched on under Memory → Search by meaning, since it downloads
paraphrase-multilingual-MiniLM-L12-v2 (Xenova's int8 ONNX, ~135 MB,
pinned revision, size and sha256 checked); switched off, the model is
deleted.
- internal/pii/guard: the BERT code runs the embedder too (LoadEmbedder,
mean pooling; the tokenizer reads 250,002 pieces and WhitespaceSplit).
Its vectors match ONNX Runtime's int8 to cosine >= 0.995 and are no
further from fp32 than ORT's own; testdata carries both.
- internal/memembed: the switch, the download, vectors.bin keyed by each
memory's sha256 (read once, again when the text changes, a cut-short
file read as none), Keep reading in the backend, the model let go after
10 minutes unused.
- internal/memory: memory.Semantic fuses the meaning ranking with the word
ranking by reciprocal rank; a tie goes to the nearer in meaning, since
a first word hit may hold one common word ("when do we release" had
"Never delete images when..." first). Near 0.30 / Within 0.15 come from
97 real memories and 16 queries, half Chinese for English memories:
12 of 16 sought found with ~4 others each. Rank searches without noting
memories used.
- GUI: the Search by meaning row (download %, memories read, failures),
and the tab's search lists what the backend ranked first
(POST /api/memory/rank), then word matches. zh, zh-TW, ja, de.
- docs/subsystems/memory.md: the section, out of "Not built yet".
Why not multilingual-e5-small, which this was built on first: run for
real, its cosines sat at 0.78-0.89 for everything, and a Chinese search
ranked Chinese memories over the English one it meant. e5-small, e5-base
and MiniLM were compared in ONNX Runtime on the same 97 memories; MiniLM
put the sought one first 9 of 16 and in the top 3 12 of 16, with the
rest at a median cosine of 0.16.
Run before the rebases (mote, on origin/main as of the work):
- gofmt -l internal/ clean; go vet of memembed, memory, pii/..., gui,
library; GOOS=linux and GOOS=windows vet of memembed and pii/guard.
- MAGPIE_EMBED_DIR=~/models/pml go test -run Embedder ./internal/pii/guard:
7 texts (CJK, full width, emoji, digits before runs of spaces) at
0.9962-1.0000 with ORT int8.
- go test memembed, memory, memdistill, pii/..., library, browsermcp.
- Linux (magpie-desktop, -tags nogui, mote's disk was full): go test
memembed, memory, pii/guard, gui (461s), cli (1228s, past the default
10m timeout, so -timeout 30m); gateway -run 'MemoryMCP|OwnMCP'.
- Rebased on origin/main
|
||
|
|
6af54dc9a9 |
library: Claude Code plugins kept as one item, with a Claude plugins tab (FakeshadowzZ on X)
A Claude Code plugin (.claude-plugin/plugin.json, skills/, agents/, hooks/hooks.json, .mcp.json) can be installed into the Library from a folder, a git address or a marketplace.json, and is one row: turned on, off or removed as a whole, and given to the agents picked with the chips every tab has. Its skills, MCP servers, hooks and subagents are ordinary library items tagged Bundle: <plugin>, so each agent gets them through the code of its kind and the Skills, MCP servers, Hooks and Subagents tabs go on working. Off clears every part's agents and keeps them for on; Remove removes the parts. A part whose name the library has gets the plugin's name as a prefix, never over the user's own. Claude hook events and matchers map to the portable ones; others become claude:<Event>, for Claude Code only. Slash commands, LSP servers and non-command hooks are listed as not carried, not dropped. internal/library/plugin.go, POST /api/library/plugins/*, the Claude plugins tab in plugins/library/client.js (en, zh, zh-TW, ja, de), docs/subsystems/library.md. Run (mote): go test -tags nogui ./internal/library ./internal/gui ./internal/backup ./internal/davsync ok; gofmt clean; go vet darwin, linux (-tags nogui) and windows clean. GUI, chromium and webkit, en zh zh-TW ja de at 420 and 1100: library-plugins (new), library-hooks, library-subagents, i18n-keys, i18n-en-no-cjk, click-scroll all pass. Whole GUI suite started and cut short at ~460 of its tests: failing only account-dragging and accounts-sheet (routing, untouched by this), not compared on origin/main. Broken by hand: dropping the Off handling in givePlugin and the hookTakes filter each turned the new Go tests red. Not tried: a real Claude Code plugin from a marketplace, a git source (tests use folders), WSL, Windows. Not carried yet: commands/*.md, LSP servers, a plugin's folder across computers (a backup carries the parts, not the plugin record). |
||
|
|
6a81a3c62a |
masking: its head's Settings link is a link, and the head wraps before it squeezes the title
v0.1.3386 (
|
||
|
|
4623f54190 |
gateway: HTTPS for other computers, from magpie's CA or an imported certificate (zhangly1 on X)
zhangly1 on X: Claude on another computer on the LAN needed magpie at https://. Settings → Network and sharing → HTTPS (magpie https on) serves other computers TLS on the gateway's own port, with a certificate magpie's CA (the mTLS one, in ~/.config/magpie/mtls) signs for this computer's names and addresses; this computer keeps plain http://. The switch is read per connection, so no restart. - Certificate row: Import… takes the user's own PEM certificate (with chain) and unencrypted key, in any files and order; a pair that can't be served (no key, no cert, a stranger key, a passphrase, run out, nothing PEM) is refused with the reason in the page's language and leaves nothing behind. Remove goes back to magpie's CA. --tls-cert still comes first. - magpie's CA row: SHA-256 shown, Save puts magpie-ca.crt in Downloads; the gateway serves it without a key at /magpie-ca.crt to any address the share lets in. Rows under it give curl -kO, macOS, Windows, Linux and NODE_EXTRA_CA_CERTS steps with Copy. - A page open from another computer can't turn HTTPS on or off under itself (it would lose its own address). - magpie https status|on|off|import|remove|ca --out; the serve banner names magpie's CA or the imported file instead of "(mTLS)". - docs/reference.md and gateway-routing.md say all of it, and that Windows' curl.exe needs --ssl-no-revoke for any private CA. Run: - gofmt -l clean; go vet linux -tags nogui ./internal/..., GOOS=windows and GOOS=darwin -tags nogui vet of the touched packages (WSL, mote refused ssh all evening). - WSL: go test -tags nogui gateway -run HTTPS|MTLS|ClientCert|CAFile|TLS|LAN ok; gui -run HTTPS|MTLS|Keep ok; settings, settingsapi, mtls ok; cli -run Help|HTTPS|TLS|Serve|Banner|Flag|Unknown ok. The whole cli package hit its 40m timeout in TestEveryAgentFieldNameWritesNothing (#5234, #4247, not this change). - GUI (WSL Playwright, chromium + webkit): https-settings (en, zh, 390px, strings in all four languages) ok, plus mtls-settings, allow-ips, browser-access, cors-origins, gui-de/ja/zh-tw, i18n-keys, i18n-en-no-cjk, lan-*, public-url*, api-key-theme, connect-address-kept, gateway-connect-keys, gateway-caller-keys, side-gateway-lan, menu-scroll. Reds at load ~130: api-key-theme (#5044), connect-address-kept (#5972), gateway-caller-keys (#2572), gui-ja (#5943), lan-docker (#4692), all red the same at base |
||
|
|
6c3f113cee |
routing: a rule's hours over give the conversation back; looser times (MinglunZhu on X)
MinglunZhu asked twice for a provider by time of day and said the time setting in Routing rules is awkward. Three causes: - A conversation a night rule sent to its member stayed there after the hours: no rule matched the new turn, so Auto affinity kept it on the night's member by its cache (Smart and every routing but In order). ruleFor now sets RuleHit.Ended when the last turn's rule had hours that are over, and affine lets the conversation go (Affinity.Why "hours"); the trace says so in en, zh, zh-TW, ja, de. Tool rounds of a turn begun inside the hours stay put; Session, Strict and In turn keep their own way. - The time boxes took only ASCII "HH:MM", while their numeric keypad on a phone has no colon and a Chinese IME types ":". clockOf (GUI) and clockMinutes (CLI, saved files) now read "22", "2200", "930", "22:00", "22.00", "22点30" and full-width digits; "9:5" is still no time. time=22~08 takes ~ and ~ for the dash. - A new rule starts with an intent box; hours took an × and a +. Adding another condition now drops the intent box while it is empty. A time rule in a nested group doesn't give its conversation back yet: #5977. Run (mote): go test ./internal/provider (ok); go test -run 'TestRuleHoursOver|TestRuleTime|TestRule|Affinity|StandIn|Session|TestParse|Clock' ./internal/gateway (ok); go vet darwin, GOOS=linux -tags nogui, GOOS=windows for gateway and provider; gofmt. GUI, chromium and webkit: routing-time (8/8 after the new trace test's fix), and 28 rule/affinity/ i18n files (routing-rule-*, routing-time*, routing-intent-entry, routing-folder, routing-pause*, routing-smart-intent, routing-save*, routing-rules-line, routing-affinity-*, routing-behind-why, routing-kept-again, routing-session-folder, i18n-keys, i18n-en-no-cjk): 477/481, the 4 reds the new trace test's first wording, fixed and rerun. Broken by hand: affine's "hours" case off -> TestRuleHoursOverGiveThe ConversationBack red (Smart stays on kb by cache); origin's grouprule.go/ruleparse.go -> TestRuleTimeTypedLoosely red; client.js's "hours" case and the intent give-way off -> routing-time 0/4 in chromium; the old clockOf -> routing-time red on "9:00". Not tried: the real app with a real night/day pair of providers; the full gateway package and full GUI suite (the full Go suite runs after the tag); Windows run of the touched packages (vet only). |
||
|
|
72e804d2b5 |
gateway: a provider set Never a fallback takes no other model's request (sonnnnnnnnnnnna on X)
sonnnnnnnnnnnna asked that a request a local uncensored model was given
never falls back to an online provider (Anthropic, OpenAI) when the local
model is full (kv slots) or down, where it could get the account banned.
A provider now has Never a fallback (NoStandIn), off by default: the
Providers page's right-click, under Use first, ticks it; the CLI's
`magpie provider set <id> fallback-for-others=no` sets it. Its keys and
accounts are dropped from a request's plan once a candidate of an
unmarked provider was planned before them (standInsOut, run in planPaused
and in planGroup before restLast and sinkPlanned, so a local model that
failed and is resting still counts as first; a primary with nothing
planned counts too). A request that goes to a marked provider first still
moves on as before, and a weighed group (Smart, Cheapest) that picks a
marked member first sends it there. The dropped rows go to the trace's
left-out list as StandIn; the Routing page says why ("it is set never to
be a fallback for another model"), and the cap, held and barred refusal
checks ignore them so a refusal keeps its old status.
No classifier was built: the model that would judge the request is the
local one that is down, and any other would send the text somewhere the
user didn't choose.
Run on mote (macOS 27) at this tree on
|
||
|
|
e053c337aa |
gateway: join a shared magpie with a password (EV_John_Liu on X)
EV_John_Liu asked for quick setup on a LAN: the central magpie serves a
page behind a password where other PCs and Macs get their config and a
new key of their own.
Settings -> Network and sharing -> Join with a password sets the
password (at least 8 characters; only a salted PBKDF2-SHA256 hash is
kept, in join.json, 0600, written through temp-and-rename; a file that
can't be read or parsed means joining is closed). The row then shows the
address to give out, <shared address>/join, and Turn off joining.
/join is the key page (/me) opened to join: the visitor types a name for
the computer and the password. POST /v1/magpie/join makes a gateway key
named after that computer (or "Joined from <ip>"). The key is listed in
Gateway keys like any other, where it can be limited or removed. The
page shows the key once and then the setup for that key: Claude Code,
Codex, a new magpie tab (`magpie provider add remote-magpie '<key>'
url='<address>'`), OpenAI-compatible and curl.
Every route judged:
- lanGuard lets another machine reach GET /join and the join route
without a key, only while magpie is shared. The route checks the
password itself.
- A browser's POST must come from the page itself. Host must be one of
this computer's own names (IP, localhost, MAGPIE_PUBLIC_URL's, its
hostname), so a DNS-rebound name is refused. Origin must equal Host.
Missing Origin and Origin "null" are refused, and so is any
Sec-Fetch-Site but same-origin. corsGuard still refuses null, foreign
and *.localhost Origins before this. curl and scripts, which send no
browser marks, are judged on the password alone.
- Throttle: each try from another machine costs a token, a right
password too. The bucket holds 10 and refills one every 10s, so a
guesser gets about 360 tries an hour, and a flood of tries makes no
flood of keys. Over the limit the route answers 429 with Retry-After.
- The password and key never go in a URL or a log line. The key comes
back only in a no-store 201 body. Logs name the key's id and the
caller's address.
- The routes are classed in the key-slot and read-only route lists.
They carry no key.
Run on mote at this head (rebased on
|
||
|
|
87b3af7653 |
library: a project turns a global MCP server or skill off, out of git, and its worktrees follow (WhyULose0 on X)
WhyULose0 asked for MCP servers and skills per project: a global set every project inherits, each project that set ± items (a global one turned off for one project too), one place to tick for every agent, nothing written into the project's git, the router running a shared server once, and a new git worktree following its main project. What was there: projects could add skills and servers (Library → a project's card), the MCP router ran each server once, but a project could not turn a global item off, magpie wrote its entries into the project's .gitignore (a tracked file), and a worktree got nothing. What changed: - Turning a global item off in one project (ProjectServerOff, ProjectSkillsOff; POST /api/library/projects/server-off, skill-off), done the way each agent reads a folder: Claude Code's record of the project in ~/.claude.json (disabledMcpServers; magpie takes out only names it put there), Codex's project .codex/config.toml ([mcp_servers.X] enabled = false, only for a server in Codex's own config), Claude Code's skillOverrides "off" in the project's .claude/settings.local.json. - With the router on, a project that adds or turns off a routed server gives Claude Code (local scope in its project record) and Codex (project config) the hub at /mcp/magpie/hub/<agent>~<projectKey>; hubServers serves that address the project's set, each server still started once. gateway.HubAgentOf cuts the key off for the log, errors and on-demand. - Out of git: entries go to the repository's info/exclude (one block per project, shared by every worktree); the .gitignore is left as the user wrote it, and a block an older magpie wrote there is taken out. A folder git-inited later gets its block on the next KeepLinked. - Worktrees: the project's folder in each worktree of its repository gets the same skills, servers and offs, found on KeepLinked, let go when removed. - GUI: a project's card lights each agent that has an item from the Library; a click turns it off (or back on) in that project. An agent that can't take an off (Gemini CLI etc., or a skill that goes through the skill router) stays lit and says why. The Skills menu ticks inherited skills; unticking turns one off. zh, zh-TW, ja, de. Limits, per agent: - Offs only for Claude Code (servers and skills) and Codex (servers). Codex reads the project config only in a trusted project. - A skill reached through the skill router can't be turned off in one project. - Claude Code keys its record by the repository's main top folder, so a project in a subfolder turns its server offs on repo-wide. Run (mote's SSH refused every try today, kex reset; every run went to the WSL box through wsl-run, linux, at load 60 to 80 from other runs): - go test -tags nogui ./internal/library: ok at this head. At the base before ( |
||
|
|
a1ba92ad8c |
library: a market of Pi's packages, installed and removed by pi itself (nineruiing on X)
Library -> Pi now has a Discover list of Pi packages: npm packages with the pi-package keyword (pi's own docs: the keyword makes a package eligible for the pi.dev/packages gallery), sorted by monthly downloads, with search. Like the other markets it ships a 500-entry snapshot (market_pi.json), keeps a 6h memory and disk cache, and refreshes from npm. Install and remove run that Pi's own `pi install npm:<name>` / `pi remove npm:<name>` with PI_CODING_AGENT_DIR set to its folder, so settings.json's packages list and <agentDir>/npm are written by pi, not by magpie. Each card says which Pis have it; Install goes straight to the only Pi without it or asks which one; the Pi's list gets a remove button behind a confirm. New routes: GET /api/library/market/pi, POST /api/library/pi/install and /api/library/pi/remove. Run: - mote: go test -count=1 -timeout 45m ./internal/library ./internal/cli ./internal/gui at this head: ok, ok, ok. - mote: gofmt -l clean; go vet of library, gui, cli for darwin, linux (-tags nogui) and windows: ok. - mote: library-pi-market, library-pi-extensions, i18n-keys, i18n-en-no-cjk in chromium and webkit: 52 of 52; the 17 market and library GUI files: 598 pass, 0 fail (pre-rebase tree). - win-run: go test -tags nogui ./internal/library -run 'TestPi|TestMarket' ok (TestPiRunGivesAgentDir skips on Windows). - wsl-run: library TestPi|TestMarket ok; library-pi-market 22 of 22. - Real pi 1.5.1 in a sandbox HOME on WSL: PI_CODING_AGENT_DIR=$A pi install npm:pi-btw wrote packages ["npm:pi-btw"] beside the existing theme and installed node_modules/pi-btw; pi remove put packages back to []. The live ~/.pi was untouched. Broken by hand (each red, then green restored): - the pi-package keyword filter dropped: TestPiMarketFromNPM; - the name check dropped in the market: TestPiMarketFromNPM; - the name check dropped in install: TestPiInstallAndRemove; - PI_CODING_AGENT_DIR not set: TestPiRunGivesAgentDir; - the identity dedupe dropped: TestPiInstallAndRemove; - the installed marking always "live": library-pi-market 11 of 11 red. Not tried: a real magpie binary driving pi install end to end; pi on native Windows; git: and local package sources (the market lists npm only, and the Pi's list still shows and removes them as before). |
||
|
|
e6f151507f |
sessions: each session's output speed, a curve of its last two minutes
The owner liked a tweet's token-speed curve and approved a mockup
(claude.ai/artifact/7mrkMKdVi6jA3HA1Z6pRr5). Each Sessions row now
shows its output speed with a small curve; clicking it opens a popover
with the current tok/s, two minutes of seconds, tool gaps, and the
round's average, fastest second and output so far. A row not live
shows "Avg {n} tok/s".
Gateway: a curveMeter (session_speed.go) on the Server counts every
reply's content bytes per agent and session, from liveRow.observe, the
same count the Live view uses, and turns them into tokens with the
learned per-model rate (tokenRates.rate). A model with no rate yet
shows the curve's shape and no number: a guess would be a wrong
number. counted() opens a session's in-flight span, so a second with
nothing in flight is a gap (a tool ran), not a zero. A pause past 2m
starts a new round; 10m of quiet forgets the session; at most 256
sessions. Codex's own sign-in (codex_backend.go) went past serve and
liveRow before; it now has a liveRow too, so its sessions are counted.
GUI: GET /api/speeds, kept out of /api/sessions* so a once-a-second
poll doesn't set off session reading. The page polls only while
Sessions is shown and visible. managedJSON gains keys, so a row
matches a session the gateway saw under another of its keys. The
curve hides below 620px.
Run (mote's sshd resets every connection today, so Linux and Windows):
- Linux (magpie-desktop, wsl-run): gofmt clean; go test -timeout 45m
./internal/gateway ./internal/sessions ok except
TestGroupFailoverTimesEachTry, red once under load, 5/5 green alone
here and on main (#5948); node --test over every sessions-*.test.cjs
and i18n-*.test.cjs: 546/549, the reds sessions-export en in both
engines, the same on origin/main
|
||
|
|
8a76daf3b2 |
library: a row's controls share one centre line, the switch too
The Memory tab's "Learn from conversations" and "Tidy up every night" rows put a 19px switch beside ~30px buttons in .lib-acts, a flex row with no align-items, so the switch sat at the top, ~3.5px above the buttons' centre (the owner's screenshot). .lib-acts now centres its items. library-memory.test.cjs checks that every control of both rows shares one centre line, per wrapped line at narrow widths. Run (wsl-run, magpie-desktop at load ~50; mote refused SSH): - library-memory.test.cjs: 22 pass, Chromium and WebKit, every language, wide and narrow. - Broken by hand: without align-items the new check is red (211.9 vs 215.4). - All 62 library-*.test.cjs, concurrency 4: 1346 pass, 8 red in 4 files. Alone, with and without this change: - library-mcp-copy-config ja (chromium): red on main too, #5941. - library-chip-fan: frame-timing reds at both trees' load (3 of 12 alone runs); its page has no .lib-acts (probe counted 0). Shapes added to #3072. - library-items, library-mcp-tool-switch: green alone. |
||
|
|
e7a08dcea0 |
usage: a long plan name gives its room up, and ChatGPT's self_serve_business_prolite reads Business (visamzh on X)
visamzh's Usage card showed a Codex seat's plan as "Self_serve_business_prolite": ChatGPT's raw plan_type from /wham/usage and the token, capitalised by CSS. `.plan` was `flex: none`, so the account's email beside it was squeezed to nothing. - Names: planName() maps a plan id to what ChatGPT.app's own bundle calls it (self_serve_business_prolite and self_serve_business_usage_based are Business, ent26 and enterprise_cbp_* are Enterprise, free_workspace Free, prolite Pro Lite, promax Pro Max, edu_plus/edu_pro). Only what is shown changes; q.plan stays the raw id, so quota-all still averages per plan. Used everywhere a plan is shown: the Usage card's account rows and head, the panel's group note and card titles, the quota-all line, the Providers editor's account line, the tray-usage option note, Routing (row subtitle, account row, group quota line, account pickers) and gateway keys' account pickers. - Layout: a plan shrinks first and ellipsises (`flex: 0 100 auto; min-width: 3em`), with its full text as its title: .subscription-account .plan, .subscription-head .plan, .pq-gnote and .acct .plan. Run (mote, macOS, Playwright 1.62.0): - New plan-name-fits.test.cjs, chromium and webkit x en, zh, zh-TW, ja, de: the Usage page at 1100/760/420 (four Codex rows, one with an unnamed long plan; a Volcengine head with a long plan), the panel at 440/360 and the Providers editor at 1000/560. 10 of 10 rebased on |
||
|
|
e8fbee60ea |
gui: pause the gateway without quitting magpie (me2seeks on X)
Disconnect and quit was the only way to stop the gateway, and it quits magpie too. Pause does the same without the quit, from the tray's Pause Gateway (Resume Gateway while paused), Settings › General › Gateway (On/Paused, the app's only) and the Gateway page's Resume gateway, all through POST /api/gateway/pause. - Pause disconnects each connected agent as its row's Disconnect does (its own settings put back), keeps their ids in gateway-paused.json in the config folder, and stops the listener with requests in flight drained. An agent that can't be disconnected keeps the gateway serving, those before it connected again, and is named in the status line. - While paused, serveGatewayLocked serves nothing: not the 15s watch, a port change nor a handover; a magpie started again stays paused. A pause file that can't be read counts as paused. - Resume serves again and connects the agents the pause disconnected. A port held by something else keeps the pause and says what holds it. The Gateway page's Start/Restart, connecting an agent and picking one of magpie's models for it resume too. - quitask's wired list and the pause share wiredOf. - Strings in en, zh, zh-TW, ja, de. gui-shell.md documents it. Run (mote was unreachable for the later runs; the Windows box instead): - mote, before the rebase: go vet ./internal/gui; go test -run 'TestGatewayPause|TestGatewayResumes|TestTray|TestGatewayFix|TestQuit' ./internal/gui: ok. - at this tree on |
||
|
|
07af9f86a6 |
providers: mark a provider and a routing group on a plan or pay as you go (EV_John_Liu on X)
EV_John_Liu on X asked for pay-as-you-go and token plans to be marked on providers and routing groups. A provider row now carries a quiet grey badge, Plan, Pay as you go, or Plan + pay as you go when its keys are on both (Volcengine's Coding Plan beside a pay-as-you-go key). It is read from what magpie knows: a signed-in subscription is a plan; a plan preset (Kimi Code, Qwen/Bailian token plans, OpenCode Go, ClinePass) is a plan; a preset region's own name (Coding Plan, Token Plan, Pay as you go) decides; other vendor and relay presets are pay as you go. Presets whose billing magpie can't tell (MiniMax, Ollama Cloud, ModelScope and others) and custom endpoints show nothing until the user says: the provider editor's Advanced has Billing (Auto / Plan / Pay as you go), and `magpie providers set <id> billing=plan|payg|auto`. The user's word always wins. A routing group gets the same tag when every on member is known; its title lists each member. Run on mote with these changes on origin/main ccc96b4a7; pushed rebased on |
||
|
|
327fb57659 |
redact: Never mask holds from the next text on, earlier turns stay masked (NicoleS76448271 on X)
A value let go from the request view's menu (Never mask) went as written
in the conversation's earlier turns too, so the prompt the vendor had
cached no longer matched and the whole conversation was read again at
full price. Now a text sent masked on a route keeps that value masked,
with the same placeholder, while magpie remembers the text; new texts
(the next turn, another conversation) send it as written. It holds for
values added in Settings too.
allowkept.go remembers a maphash of (route, text) and of the value,
never the value, in two generations of 2^17 like sentSpans' memo. Only a
request with a route (Options.sent and Route) keeps it; a search's query
or an embedding's input has the value as written at once. Keeping a
value masked is the safe side: a collision masks a value the user let
go, and a text no longer remembered (after a restart) sends it as
written, as before. The menu's message now says earlier messages stay
masked so the cache holds (en, zh, zh-TW, ja, de). The request view's
inline Never mask was already there (yew_fence on Discord).
Run (mote refused SSH for ~30 min at load ~125, so on the Linux box):
- wsl-run go test ./internal/redact/ ./internal/masking/ ./plugins/redact/
ok, at the pushed head b9d1f00a5 too.
- wsl-run go test -run "Mask|Redact|Allow|Sent" ./internal/gateway/ and
-tags nogui ./internal/gui/: ok.
- go vet: GOOS=windows (redact, gui), GOOS=darwin (redact), linux -tags
nogui (redact, gui): ok. gofmt -l clean.
- node --test mask-value-menu, i18n-keys, i18n-en-no-cjk (chromium and
webkit, every language): ok. masking-records: the same reds as fresh
origin/main
|
||
|
|
82962db79a |
routing: a rule can match the system prompt or the last user message, by words or a regex, with no model asked (SucroseMoE on X)
SucroseMoE asked for routing on plain string and regex matches instead
of an intent model: `system[0] matches /^你是对话标题命名/` → model A,
`user[-1] matches /^正在上下文压缩/` → model B, so any harness's title
and compaction calls can be routed without a classifier.
Two new rule condition fields, beside message/effort/subagent/agent:
- system: any block of the system prompt as the agent sent it (Anthropic
system blocks, Chat system/developer messages, Responses instructions
and system/developer items, Gemini systemInstruction). Any block, not
only the first, because Claude Code's first block is its billing
header.
- last: any text of the request's last user message as sent, reminders
the agent adds included, so an anchored ^ still meets a compaction ask.
Ops for both: contains, doesn't contain, starts with, matches (regex,
case-insensitive; a value written /…/ has its slashes dropped). The
gateway reads system and last only when a rule asks (RulesRead), and
decodes raw system JSON lazily then. Like every rule, the decision is
made as a turn starts and its tool rounds keep it.
GUI: Routing → group → Rules, "+" on a rule row offers "System prompt text"
and "Last user message" pills (no modal), with tooltips, placeholders
and the bad-regex mark; zh, zh-TW, ja, de. CLI: `--when "system matches
^You are"`, with aliases system[0], user[-1], last-user. TUI hint, docs
(gateway-routing.md, site start pages) say the same.
Ran, on mote (macOS) until its sshd began refusing connections: gofmt
-l internal/ clean, go vet of provider/gateway/cli/tui, the rule tests;
the routing GUI files (routing-rule*, routing-rules-line,
routing-pause*, group-*, i18n-*, routing-compact, routing-intent-*,
routing-smart-intent) in chromium and webkit: 751 of 781, the 30 reds
being "System prompt" taken by a core word (now "System prompt text"),
routing-rules-line's + menu count (now with system and last), and
routing-intent-entry, red on main since
|
||
|
|
b358677305 |
gui: open a server's magpie in a window of the app (xuanwo on X)
xuanwo runs magpie on a server and wants the desktop app to show that
magpie's routing and usage. Browser access in Settings › Network and
sharing goes the other way: it serves this app's page to a browser.
Settings › Network and sharing has a new section, Another magpie. It takes
an address and a key. You can paste the whole link the server printed
(`magpie daemon install --web`, `magpie web`, or another app's Browser
access), and its k= becomes the key. The app then opens that magpie's own
web page in a window of its own. The window signs in through the server's
own webGuard with ?k=, the same way a browser does, and is traded for its
cookie. Nothing new is served here: the page in the window talks to the
server alone and gets no bound calls from this app.
- remoteAddr:
- https:// is used when no scheme is typed.
- Plain http is allowed only to an IP, localhost, a .local name or a
one-word name, so the key never crosses the internet in the clear.
This is also the rule a Mac's webview applies.
- userinfo and other schemes are refused.
- remoteProbe: before the window opens, it asks for the link without
following redirects. Only a 303 that sets a magpie_web_* cookie counts
as success. A 401, a 403 (allowed addresses), an untrusted certificate,
no answer, or any other reply is reported in Settings, translated.
- remote-magpie.json:
- It sits beside settings.json, mode 0600, and the key is never in
settings.json.
- GET /api/remote returns the address and hasKey, never the key.
- POST with no key reuses the key kept for the same address.
- POST /api/remote/forget removes the file.
- The routes are on the app's own windows' API only (!isWeb). A host that
can't open windows refuses.
Run (on mote, at this tree):
- go test -count=1 ./internal/gui/: ok.
- Go tests:
- TestRemoteAddr
- TestRemoteOpensTheOtherMagpie: real webHandler; wrong or missing key
refused, nothing kept; the pasted link opens; 0600; the key is not
returned; a cookie-jar client following the opened link reaches the
page behind the key; the kept key is reused; forget.
- TestRemoteNotMagpie
- TestRemoteNotOnBrowserPages
- GUI test, new: another-magpie.test.cjs. Covers 5 languages, 360px,
and a browser page with no section that never asks /api/remote.
- GUI suite: every GUI file that draws Settings › Network (18, the new one included), plus
i18n-keys, i18n-en-no-cjk and gui-de/ja/zh-tw. Chromium and WebKit:
307/307 pass. Also remote-magpie.test.cjs (the Remote magpie
provider's add sheet), run with the new file at the rebased head.
- gofmt -l: clean.
- go vet: darwin, GOOS=linux -tags nogui, and GOOS=windows on
internal/gui; ok.
Broken by hand:
- A 303 without the magpie cookie taken as signed in:
TestRemoteNotMagpie red.
- remoteRoutes outside !isWeb: TestRemoteNotOnBrowserPages red (200).
- renderRemote drawn on a browser's page, and errors not translated:
another-magpie.test.cjs red in zh/zh-TW/ja/de and the browser case,
in both engines.
Not tried:
- The real Wails window on macOS, Windows or Linux.
- A real server over https.
- Links on the remote page that open a new window (target=_blank,
window.open) inside the remote window.
- Settings › Text size does not rezoom a remote window that is already
open.
|
||
|
|
208b89422d |
routing: a group carries a note of its own (ConatusMoon2222 on X)
ConatusMoon2222 asked whether a routing group can have a note. It couldn't: a group had an id and a name, nothing else of the user's. A group now has an optional one-line note (provider.Group.Note, "note" in providers.json). SaveGroup cleans it: whitespace and newlines run together, cut at 200 characters (in runes), and an empty one is no note. It is the user's own word and is never sent to an agent or a vendor. - Routing page: the note shows under the group's name as one muted, ellipsized line, the whole of it on hover, and only when there is one. The group editor has a Note field under Name (Enter saves, as in Name). Every save of the group sends it: the editor, a manual group's pick and a routing picked from the row, so none of them wipes it. - CLI: `magpie group set <id> note=...` (note= clears it), `magpie group add ... note=...`; `magpie group <id>` and the list print it. - TUI: N in a group's view edits it; the view shows it under the head. - A copy, a shared group, a backup (StoredGroups/RestoreGroups) and sync (Mirror) carry it: they move whole Group structs. TestGroupNote checks each. Two existing GUI tests clicked rows that the extra editor row pushed under the view's foot bar at 420px in WebKit, which doesn't scroll the page's own scroller to a click: group-defaults' reach() now counts in sight as above the foot bar, and group-unlists' openAdvanced wheels the summary into view as its other helpers do. Both passed on origin/main and failed on this change before the fix. Run (on mote, at this head rebased on origin/main): - go test ./internal/provider ./internal/cli ./internal/tui ./internal/gui: ok - gofmt -l: clean; go vet ./... darwin, GOOS=linux -tags nogui, GOOS=windows: ok - GUI, chromium + webkit: group-note (en, zh, zh-TW, ja, de, and 390px), every group-*, routing-group-*, routing-groups-*, settings-groups, routing-manual, routing-save*, routing-tag-whole, fallback-group and i18n-* file: 752 tests, 752 pass Broken by hand, each red: - SaveGroup without CleanNote, and the CLI's note= without it: TestGroupNote and TestGroupNoteCLI fail on the uncleaned note. - the editor's Save body without note: group-note fails (the typed note never posted). - the pick and route-tag bodies without note: group-note fails (the note wiped by a pick). Not tried: the real TUI by hand, the real app in Linux WebKitGTK, and Windows (the change has no OS-specific code; windows vet ran). |
||
|
|
40ca0c88de |
gui: a model's price is set from the Usage page (soilzhu80 on X)
A model an agent runs is often in no provider's list, so no provider's
Model settings could price it. A model's row on the Usage page (its "…"
or a right-click) and its bar in the Sessions tab's Models card (a
right-click) now offer "Set price…": a sheet with input, output, cache
read and cache write in $ / 1M tokens, the maker's list price greyed in
the empty boxes. It sets the model's price from any provider (*/model),
the key `magpie model price '*/model'` writes, through GET/POST
/api/model-price (modelprice.go). A provider's own price for the model
still comes first. Restore default takes the price away. Sessions' stats
are forgotten on a save, so past calls are counted at the new price too.
A Sessions bar prices the id after its last "/", the id sessions'
priceOf looks up.
Run (mote): go test -run ModelPrice ./internal/gui; node --test
usage-model-price (chromium + webkit, 420px wide, en/zh/zh-TW/ja/de),
usage-clear (its menu now has Set price… above Clear usage…),
i18n-keys; gofmt -l; go vet ./... for darwin, linux -tags nogui and
windows.
Broken by hand: SetModelPrice skipped, TestModelPriceFromAnyProvider red
("set: 200 {Price:<nil>}"); Set price… taken out of the row menu,
usage-model-price red.
Not tried: a real gateway call priced after setting it in the real app.
|
||
|
|
662546e78d |
usage: a cache hit rate reads 100% only when all of the prompt was cached (ZhangXiaof48473 on X)
Routing's request list showed "缓存 100%" for Codex requests of 77.5K
tokens that read 77,200 of them from the cache (99.6%), beside rows at
99%, and the route line said "请求缓存命中率 99%". Every hit rate was
Math.round(100 * h) + "%", so anything from 99.5% up read 100%.
One formatter now says every hit rate: hitPct(h, d) in app.js, whole
percents (d decimals) unless rounding would say 100% or 0% of a prompt
not all or none cached, then one or two decimals (99.6%, 99.95%; never
past 99.99% or under 0.01%). Its callers: Routing's request rows, their
route line and a session's Avg. cache (plugins/routing/client.js); the
tray panel's Cache hit rate and the ranking rows' hit rate (app.js); the
Usage page's tiles, agent rows, Requests table, request detail and its
KPI strip, which keeps its one decimal (plugins/usage/page.js); the
context card's Prompt cache and the session traits Cache-friendly,
Cache misses and Cache hit (context.js). The TUI's and CLI's sessions
line, which floored the integer, use usage.HitPct, the same rule in Go;
it rounds now, so the TUI test's 67% (25.2K of 37.3K, 67.6%) reads 68%.
No new strings; app.js pays its bytes with six ledger comments cut, so
the core scripts are 15 bytes smaller than at its parent, no raise. Main
is over the core budget already (1,534,476 > 1,533,802 at the parent,
#5918); this commit doesn't add to it.
Run on mote:
- new internal/gui/tests/cache-hit-pct.test.cjs (Routing rows 99.6% /
100% / 99%, the route line, hitPct at its edges) in chromium and
webkit, en and zh: green; with the escalation line removed by hand,
red (99.99% where 99.6% is wanted).
- cache-hit-pct, panel-usage, context-window, i18n-keys, usage-ledger,
tray-totals, ctx-route, ledger-cache-hit, usage-hit-rate,
routing-request-metrics (both engines; ledger-cache-unknown and
ledger-cache-tokens in an earlier run): 186 pass, 6 red, all in
usage-ledger's 'newest live route needs no return-to-live button',
red the same on origin/main
|
||
|
|
00e8242e85 |
library: Hermes folds its context with billion-context through its /bili/ prefix (Duckb7si on X)
Library › billion-context said no agent could use it on a machine where
Hermes was connected to magpie. Hermes was left out of the lanes on
purpose: bili's native Hermes plugin (hermes-plugin/__init__.py,
apply_env, billion-context 0.1.213) only sets HTTPS_PROXY, HERMES_CA_BUNDLE
and SSL_CERT_FILE. magpie's Hermes provider is http://127.0.0.1:3425/v1,
plain http on loopback, so that proxy never sees it: the plugin would add
its tools and fold nothing.
Hermes now takes the route Zed takes, bili's documented /bili/ prefix.
Turned on, magpie runs `bili start --port 8787` and sets base_url of the
magpie and magpie-anthropic providers to http://127.0.0.1:8787/bili/<gw>,
in config.yaml and in every profile that has magpie's provider
(agent.HermesThrough). Each later Sync or pick keeps a loopback prefix
with a path (hermesPrefix), and drops anything else back to the gateway.
Turning it off puts the gateway back. The empty-list string, docs (en, zh,
ja), llms-full.txt and docs/subsystems/library.md name Hermes.
The other agents bili supports that magpie wires (dsh, Kimi, ZCode, Codex,
Gemini, Qwen, ...) are #5915.
Run (mote, at the rebased head unless said):
- go test -tags nogui ./internal/library: ok (252s) at the rebased head
- go test -run 'TestHermes|TestZed|TestProxy|TestBili|Kept'
./internal/agent ./internal/library: ok before the rebase (base
|
||
|
|
cec267f902 |
gui: a field's long explanation shows on asking, in the editor and Routing groups (yujezhang on X)
yujezhang on X (11-10): "现在界面好多描述都太繁琐了 ... 界面只保留完成
操作必需的信息". The longest always-visible lines left were in a
provider's editor (100 to 666 characters a field) and Routing groups'
settings (69 to 318). They now work like Settings' rows since 11-02:
with a mouse, the explanation rests out of sight and the row's hover
(450ms) or keyboard focus shows it in the shared .set-hint card. A touch
screen keeps every line. No layout moves, no new page, no info icon
(the owner chose hover on the row for Settings).
Removed or moved:
- Routing's empty caption ("Every request an agent sends to magpie
shows up here, routed for real.") is gone from the empty state: the
mode line above it says the same. The key stays, the panel uses it.
- A provider editor field's explanation (.fld > .hint.expl): Headers,
Certificate, Compaction, the routing and rate-limit fields and the
rest: in the card. A line with a link or control in it, a warning and
an error stay in sight.
- Two fields keep one short line in sight for what turning them on
costs: Certificate ("Turn it on only on a network you trust.") and
Compaction ("A conversation compacted this way continues only on
this provider and account."). New keys in zh, zh-TW, ja and de.
- The editor's own settings rows (.prov-prefs: warm-up, check-in,
resets) hide their lines as Settings' do; a result line (.say) stays.
- Routing groups: Found, Names and the three defaults' small lines: in
the card. The no-names line stays.
- settingshints.js listens on document, so the editor (in #modal) and
Routing get the card; the card grows from its row in 150ms, strong
ease-out, a fade alone under reduced motion.
A line held out of sight is position: absolute in its field's box
(.fld and .hint-row > .txt are position: relative): placed against the
page, deep in the editor's scroll, it grew the page a scrollbar and
made the editor 10px narrower, and account-weight's de 390 in WebKit
ran an account line 3px past its row. Its sr-only -1px margin is
dropped, so it no longer sits 1px left of its row (warm-at-times,
warm-now and checkin-now-account check every .sub is inside its row).
Tests:
- New editor-hints.test.cjs (chromium + webkit, en/zh/zh-TW/ja/de,
1100 and 420): at rest the explanation is out of sight and still
described; Certificate's lead is in sight on one line; a hover shows
the card with the text, inside the window, not over the name, nothing
moving, taking no pointer; leaving hides it; Tab onto a field shows
it; every out-of-sight line is placed in its own field; Routing
groups' lines the same. 42/42 with account-weight on the Linux box.
- Broken by hand: the hide rule replaced and ROWS without the editor
and groups: 0/20 red. The position: relative rule removed: 20/20 red
(the placement check), then restored.
- vertex-editor: a hint resting out of sight isn't "cut".
group-found-off: rows carry hint-row.
- 271 GUI files (every editor/edit= test, hints, visibility, prov-prefs,
rt-gset/rt-cap, i18n-keys, old-webkit) in both engines on the WSL box
(magpie-desktop), mine against a copy of
|
||
|
|
6a253f8af7 |
memory: pick several memories and keep, archive or delete them at once (RealZeroP27 on X)
Library -> Memory reviewed one memory at a time: To review held
candidates that had to be opened and kept or deleted one by one.
- Select (beside the filters, shown when two or more are listed) puts a
box on each memory. A click picks one, Shift-click the range from the
last one clicked, up/down move between the boxes (Shift picks as it
goes), Cmd/Ctrl+A picks all shown, Escape ends it. A search or filter
unpicks what it hides.
- The bar under the list (the library's lib-pickbar, as Skills' Select)
keeps (To review), archives (In use) or restores (Archived) the picked
ones, and deletes them on a second click.
- POST /api/memory/status {ids, status}: memory.SetStatus changes them in
one write, each as Edit by the user (an archived inferred memory is
dismissed, so it isn't proposed again). Unknown ids are skipped; none
found, or a bad status, is a 400 and changes nothing.
Delete reuses POST /api/memory/remove {ids}.
Run (mote, at this head):
- go test ./internal/memory ./internal/memdistill ./internal/library: ok
- go test -run 'Memory|Distill|Dream' ./internal/gui: ok
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./..., and the three builds: ok. gofmt -l: clean.
- library-memory-select.test.cjs (new): 22/22, chromium and webkit,
en/zh/zh-TW/ja/de at 980 and 420 wide (no native select, no sideways
overflow).
- Every library-*, i18n-* and gui-* GUI file (67), both engines: 1309 of 1309 pass.
- Rebased on
|
||
|
|
97fcbe3540 |
library: billion-context's card shows the tokens it saved (Scott__D on X)
The RTK tab says what RTK saved (rtk gain); the billion-context tab said nothing of its effect. bili 0.1.213 has no command that prints its savings. Its running proxy serves its dashboard's numbers at GET /__bili/overview, summed over every session in its one store, and each bili that runs registers in <state>/instances/<id>.json ($XDG_STATE_HOME or ~/.local/state, then billion-context, on every system; read from bili's dist and its Hermes plugin's twin reader). readBiliSaved (internal/library/bili_saved.go) asks the registered bilis newest first, loopback http origins only, 3s in all, and puts the first answer on BiliView.Saved: netSavedTotal (bili's headline "net savings", after post-fold rebuilds and the summaries' cost, only with hasFoldData), grossSavedTotal (which bili calls an upper bound), foldsTotal, sessions, requests. The answer is kept in bili-saved.json in magpie's config folder and shown "as of" its time when no bili runs; a kept file that doesn't parse is no answer. magpie never starts a bili to ask (it would auto-update and start watchers). The card says "166.3k tokens saved over 7 folds in 1 session", bili's own count over every session on this computer, the gross before costs; "Nothing folded yet over N requests" before a fold; and that it shows once bili has run when no bili ever answered. zh, zh-TW, ja and de; site docs (en, zh, ja) and docs/subsystems/library.md. Run: - Real bili 0.1.213 on mote in a sandbox HOME (ACP_AUTO_UPDATE=0, 20000 token window, bili start on 18799, a fake OpenAI upstream answering usage = bytes/4): ten turns of a growing conversation through /bili/<upstream>/ gave overview net 166285, gross 166390, 7 folds, 1 session, 10 requests. That literal answer is the Go fixture (testdata/bili/overview-0.1.213.json) and the GUI test's numbers. readBiliSaved/ReadBili run on mote against that live bili with that HOME read the same numbers (Live true, Version 0.1.213). - go test -tags nogui ./internal/library ./internal/gui on mote: ok. - win-run go test -run 'TestBiliSaved|TestBiliLoopback' ./internal/library on xiaomi-gpu: ok. - library-bili, i18n-keys and i18n-en-no-cjk in chromium and webkit (every language, 1100 and 420 wide): 92 pass, 0 fail. - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui and GOOS=windows for internal/library and internal/gui: ok. - site/public/llms-full.txt regenerated (node llms-full.mjs); site worker.test.mjs: 38 of 38 ok. Broken by hand: - the loopback filter taken out: TestBiliSavedFromRunningBili red (192.0.2.7 asked first, the 3s budget gone, nothing read). - net read from tokensSaved, and a kept answer marked live: TestBiliSavedFromRunningBili and TestBiliSavedOnThePage red. - the card's line taken out: library-bili 40 of 42 red (chromium). Not tried: a real agent session with a real model through bili (the upstream was a fake with made-up usage, so only the plumbing of bili's numbers is checked, not how much a real session saves); a bili with money data (hasMoneyData; its dollars are passed as usd but not shown); the card on Linux WebKitGTK. |
||
|
|
efb75ad1f0 |
gateway: client certificates (mTLS), and Remote Magpie can show one (hhdaxia on X, #5596)
hhdaxia on X asked for mTLS so a shared magpie isn't open to the internet on a key alone; clxsh's #5596 asks Remote Magpie to send a client certificate and key (PEM) to an Nginx doing mTLS, the server still verified, the Gateway Key still sent, for models, the test and streaming. Server side (magpie's own CA, internal/mtls): - Settings -> Network and sharing -> Require a client certificate, or `magpie mtls on|off|issue <device>|list|revoke`. Issue saves client.pem, client-key.pem and ca.pem to ~/Downloads/magpie-<device>; the key is kept nowhere else. - With it on, a peer that isn't this computer or a WSL distro must finish the TLS handshake with a certificate the CA issued and hasn't revoked (RequireAndVerifyClientCert + VerifyConnection -> Admits). The TLS config is chosen per connection, so the switch needs no relisten; without --tls-cert the server certificate is made by the CA in memory. - lanGuard and ClientCertGuard (magpie web's page) refuse 403 what still arrives without a verified one: plain HTTP, a proxy or tunnel on loopback (unless MAGPIE_TRUST_PROXY=1), the page port, a connection from before the switch, a certificate revoked since its handshake. - Loopback, this computer's own address and a WSL agent with its key are answered as before. - A page open from another computer can't shut itself out: without a certificate it can't turn mTLS on, and it can't revoke or reissue the certificate it came with. Client side: a provider with a base URL of the user's own (Remote Magpie included) takes ClientCert, ClientKey and ServerCA paths (editor: Advanced -> Client certificate). netproxy.WithClientCert shows them to that provider's own hosts only, on a transport per identity keyed on the files' mtimes; through an https:// proxy such a request is refused. Save refuses half a pair, a pair that doesn't match and a CA that isn't one. Run (on mote, at 4024df0f9, this commit before its rebase): - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows. - go test -count=1 ./internal/mtls ./internal/netproxy ./internal/provider ./internal/settings ./internal/settingsapi ./internal/cli ./internal/gui ./internal/gateway: ok (gateway 893s). The first run had three reds of this change, each green at base and fixed here: TestEveryRouteHasACommandOrIsNamed (the mtls routes now name `magpie mtls`), TestSettingsSaveKeepsWhatItDoesNotSend (MTLS kept), and TestGoroutineDumpAnswersWhileRequestsWait (mtlsRefuses asks whether the peer is remote before reading settings, so a local request never waits on the settings lock). TestHandedOffGatewayAnswersAConnectionNotedLate was reset because ServeTLS now always wraps the listener: tlsListener hands a connection it took as Close came to the server instead of dropping it. -count=3 of these and every TLS/MTLS/Handover/Relisten test ok. - Every route without a certificate, with a foreign one, a revoked one and a good one: TestMTLSOtherComputerHandshake, TestMTLSGuardEveryRoute, TestMTLSThisComputerAndProxies, TestMTLSToggleWithoutRelisten, TestMTLSRevokeMidConnection, TestClientCertGuardPage. Remote Magpie against an httptest server asking RequireAndVerifyClientCert: models and the connection test fail without the certificate and pass with it (TestRemoteMagpieClientCert). - GUI: the 92 files near the change (settings-*, provider-*, editor-*, lan-*, i18n*, allow-ips, remote-*, mtls-settings new) in Chromium and WebKit: 2904 pass, 74 fail, all in nine files red the same way at base |
||
|
|
350856f512 |
memory: read a backlog of conversations at once, with progress and a Stop (RealZeroP27 on X)
Every run, the hourly one and Read now alike, read at most 10
conversations (PerRun), so a backlog of 400 (All) took 40 hours.
- A run the user asks for reads every conversation due
(memdistill.ReadAll, through distillNow): switching on, picking a
model or a longer range, and Read now. Still one request at a time,
at the picked model and reasoning level.
- The hourly run reads up to 30 (PerRun, was 10), more than a busy
hour brings, so only a backlog left by a stop or a failure waits for
it.
- The row shows how far a run has gone ("Reading conversations… 37 of
400", Progress -> doing/of in GET /api/memory/distill), with a Stop
(memdistill.Stop, POST /api/memory/distill/stop); switching off stops
it too. A stop drops the request in flight, which is read next time,
and isn't an error.
- After a run the row says how many it left unread (State.Left), and
Read now reads them. All's menu note no longer says "10 an hour".
docs/subsystems/memory.md says all of this.
Run (mote; all at base
|
||
|
|
5426c43cca |
gateway: DSH's compaction leaves a provider out of its limit for the same model elsewhere (qtwaiter on X)
qtwaiter's DSH chat ran on WorkBuddy's deepseek-v4.1-flash until
WorkBuddy rate-limited it. A switch to Trae CN's deepseek-v4.1-flash
failed with the same 429 ("WorkBuddy: 您的使用量已超出频率限制 ...
(out of its allowance: not asked again before ...)"), while DSH's own
DeepSeek route switched fine. compaction-basic (0.2.2-rc.1, agent/request
hook) compacts on the model it switches away from before a turn on
another, whenever the history is over the new model's threshold (Trae CN
lists the model at 200000/64000, so ~84K; DSH's own routes are 1M and
never compact), and fails the switch with MODEL_SWITCH_COMPACTION_FAILED
when that compaction is refused. The compaction went to WorkBuddy, which
magpie held as out of its allowance, so every switch failed.
Now a dsh compaction whose provider has every key or account resting
(quotaHeld or timedHeld over its candidates) goes on the same model from
another provider (provider.AutoGroupOf), the widest window that is
served, allowed to the key and not resting itself
(dshCompactElsewhere in dsh_compact.go). The route records it as
Moved{Why: "dsh-compact-rested"}, which the Routing page explains in
five languages. With no such provider it stays as asked with a log
line. A compaction model set on dsh's row (#5395) is still read first.
Run (mote):
- go test -run TestDshCompact ./internal/gateway/: ok.
TestDshCompactLeavesRestedProvider replays the screenshot's case:
turn on workbuddy 429 (Retry-After 3600), compaction then served by
trae-cn/deepseek-v4.1-flash with WorkBuddy not asked again, the next
ordinary turn still held. Red on the old code with the reporter's
exact 429 text. TestDshCompactStaysUnlessRested: not resting, no other
provider, another agent all stay.
- go vet ./internal/gateway/ on darwin, linux (nogui) and windows; gofmt.
- go test -count=1 -timeout 45m ./internal/gateway/: ok (908.8s)
- GUI (chromium + webkit, 5 languages, 2 widths): dsh-compact-model
20/20, routing-moved-why 20/20, i18n-keys 4/4, i18n-en-no-cjk 4/4.
At the pushed head (rebased): go vet and the TestDshCompact tests ok.
Broken by hand: skipping the stand-in (`false && m != ""`) turns
TestDshCompactLeavesRestedProvider red; removing the client.js case turns
dsh-compact-model red. Both restored.
Not tried: the real DSH app with a rate-limited WorkBuddy account. A
switch away from a model no other provider serves still fails while its
provider is out of its limit; the compaction model square covers it.
|
||
|
|
9e51c5c2a8 |
gateway keys: account groups a key may use or keep out (LeiWang_2000 on X)
LeiWang_2000 asked for account groups, so a gateway key can be limited to
a group of accounts, or keep a group out, instead of picking accounts one
by one (on top of v0.1.3504's "Keep accounts out").
An account group is a named set of accounts of any providers, kept in
account-groups.json beside caller-keys.json (access.AccountGroup). A key's
account list names one as "@<id>" (use only its accounts) or "!@<id>"
(every account but its). identityOf expands the groups of the key and of
its issuer on every request, so every route that reads the Identity
(AllowsAccount, HeldModels, the routes' model checks) holds to the group
as it is now: a membership change reaches every key naming it at once, and
an account signed out since matches nothing. Fails closed: a group gone,
or a used group with no account, holds the key to nothing
(heldToNothing); unreadable groups refuse a key naming one and leave other
keys alone. A group a key names can't be removed (the error names the
keys); ReplaceAccount moves a rotated key in the groups too. Groups are
backed up and synced (WebDAV) with the gateway keys. A magpie older than
the mark reads "@<id>" as an account of no provider and fails closed.
CLI: `magpie gateway-key groups add|set|rename|remove`, and
`gateway-key accounts <id> @Work` / `!@Work`.
GUI: an "Account groups" editor (modal, rows of name + accounts picked in
the app menu) from the keys' header; the key's account menus list the
groups as options; the badge says "Work" / "Not Work". No layout change to
the rows.
Tests:
- internal/access TestAccountGroupHoldsAKey / ...AnIssuedKey: save rules,
name->id, used+kept-out refused, held/kept-out allows and models, a
change reaching both keys, rotate, remove refused, empty group, groups
gone, unreadable groups.
- internal/gateway TestGatewayKeyAccountGroupsKeyedRoutes: a held and a
kept-out key on 7 routes, flipped by a group change, and nothing asked
once the group is gone.
- internal/cli TestGatewayKeyAccountGroupsCLI.
- GUI gateway-key-account-groups.test.cjs: 5 languages x chromium/webkit
x 1100/440.
Broken by hand (each red, then restored):
- identityOf not expanding groups: access test red, gateway test 403.
- a gone/empty held group not becoming heldToNothing: access test red
("held to an empty group"), gateway test asked kA with the group gone.
Run on mote at this tree: gofmt -l clean; go vet darwin (touched
packages), GOOS=linux -tags nogui ./..., GOOS=windows ./... clean;
go test -count=1 access, cli, gui (size budgets included), backup,
davsync, gateway: all ok;
GUI: every gateway-*.test.cjs plus i18n-keys, i18n-en-no-cjk, key-page,
plugin-kernel, readable-focus, chromium + webkit: 571 of 574 at
--test-concurrency=6. The 3 reds: gateway-caller-keys and
gateway-key-models chromium en (the 560px read, red on main too, fixed in
the next commit), and gateway-key-groups zh once, 12 of 12 alone (#1974).
Rebased on
|
||
|
|
a79d16c684 |
routing: a rule can match on conditions: effort, subagent, message content, agent (aipha2025 on X)
A routing rule takes field/op/value conditions (Rule.Where) beside its
existing match. Fields: reasoning effort, whether the request comes from
a subagent, the user's own message that opened the turn (content), and
the agent. Ops: is, is not, contains, starts with, regex, greater/less
than. Only Claude Code and Codex say when a request is a subagent's.
- provider: rulecond.go parses and evaluates conditions; grouprule.go
and ruleparse.go carry them in a rule.
- gateway: the request's effort, subagent flag and opening user text
reach the rule check (ir.go, rules.go); the trace names a rule's where.
- CLI: `when="..."` on a rule; TUI shows it.
- GUI: the conditions are edited inside the existing rule row (no
dialog), in every language (routing i18n).
- Docs: gateway-routing.md, site start pages (en, zh, ja).
Run:
- GUI: 124/124 on the touched files (routing-rule-ops, routing-rules-line,
i18n-keys and the routing files), chromium and webkit.
- A wider 236-file GUI run is red only where the old code is red too:
menu-input-scroll (#3402), webkit context-fold, intent-entry, row-swap.
- gofmt; go vet darwin, linux (nogui) and windows.
- go test ./internal/provider ./internal/cli ./internal/tui
./internal/gateway pass.
- After the rebase on origin/main
|
||
|
|
ef0d589ed7 |
library: a project's skills are picked from its menu, its card lists only those it has (POM_JUMPING on X)
POM_JUMPING on X: "skill加入本地项目是能否可选?之前添加到本地项目会把所有skill添加进去".
Nothing wrote every skill into a project: AddProject starts it with none.
But an opened project card listed every library skill as a row, each with
its agent chips, so the project looked like it had them all, and choosing
meant scanning every row for the chip to press.
Now the open card lists only the skills the project has (a skill unticked
in this view stays listed until the card closes, so a chip slip can be
put back), with "No skills yet" when it has none. A "Skills" app menu
(openProtoMenu, multi-select, with search past 8 skills) beside the copy
switch picks which go in. On close it writes only what changed:
- a ticked skill goes to the agents the project's skills are already
for, or, in a project with none, to every agent that reads a project's
skills and is installed;
- an unticked one comes out (agents []);
- skills not touched keep their agents as they were.
Several picks are one write: library.ProjectSkills (API
projects/skills, {dir, names, agents}); ProjectSkill now calls it.
New status strings "{skills} are in/out of {name}" in zh, zh-TW, ja, de.
Run (mote; first at
|
||
|
|
0e68455863 |
memory: pick how far back conversations are read, and the model's reasoning level (RealZeroP27 on X)
Learn from conversations read the last 7 days only (Back, fixed at switch-on) and asked its model with no reasoning level. Its row now has two more pickers, beside the model: - How far back it reads: 7 days (default), 30, 90, 1 year or All (State.Days; 0 stays 7 days, so an existing distill.json keeps its own Since until a range is picked). A longer range reads at once. Every range reads from the latest 400 conversations (memdistill.Listed) at 10 an hour (PerRun), so All is ~240 requests a day at most until the backlog is read; All's menu note says so. - Thinking: Default (none sent, as before) or one of the model's own levels, fitted and sent with room to think the way Vision and Searcher do (gateway.WithSideEffort over sideEffort/replyRoom/withFixedEffort). The nightly tidy uses the same level, and its row shows the picker when distilling is off. Fixed on the way, as the longer ranges depend on it: a conversation's mark was dropped after 30 days while Since stayed put, so anything older than 30 days inside Since was read again every hour. A mark is now dropped once it is before Since, or older than 30 days and past the oldest conversation listed. POST /api/memory/distill takes effort and days; a bad one is a 400. docs/subsystems/memory.md says all of this. Run (mote; first at base |
||
|
|
add47afd82 |
usage: a card's ⋯ opens its menu, Hide from Overview where it is seen (jen_celeus on X)
jen_celeus asked to hide providers with no usage information, OpenCode
Zen and the like, from Usage. The hide was already there
(UsageCardsHidden, Hide from Overview, the "n hidden" line with Unhide
and Show all), but it sat behind a right-click, a long press or the drag
handle's menu, and nobody found it. Each card's head now has a ⋯ button
(quotaCardMore), the Agents row's pattern: shown on hover and keyboard
focus, always shown where nothing hovers, opening the same menu
(quotaCardMenu, now anchored on the ⋯), a second click closing it. On a
phone it keeps 22px with a 44px-high hit area that stops at the card's
edge (an even -11px inset spilled past it: usage-accounts-fold,
usage-keys-fold and usage-shared-balance said "card spills"). The long
press leaves the ⋯ alone. Its label reuses "Actions for {name}", already
in every language.
Run (mote): usage-card-more.test.cjs (new: Claude beside a Zen card with
a plan and no windows; en, zh, zh-TW, ja, de at 1200, 560 and a 390 web
phone; chromium and webkit): the ⋯ is there with its label, hidden at
rest where hover is, shown on hover, never over the head's text where
nothing hovers, menu = Hide from Overview, toggles, the hide posts
{cardsHidden:["opencode-zen-free|plan"]}, no scroll, the "1 hidden"
line's Unhide brings it back, no page errors. The 154 GUI files that
load the Usage page plus i18n-keys, both engines: see the next commit's
record. gofmt; go vet darwin, linux -tags nogui, windows;
go test ./internal/gui/ (budgets) ok.
Broken by hand: without head.append(quotaCardMore(...)) the new test is
red in every subtest (chromium 0 of 16).
Not tried: the real app's WebKitGTK and Windows WebView2 windows; the
web page on a real phone.
|
||
|
|
60f0433d1b |
dsh: a model of its own for DeepSeek Harness's compaction (Musikrv77852 on X, #5395)
DSH compacts on the session's latest model (compaction-basic with no summarizationModel). A session on magpie/workbuddy/deepseek-v4.1-flash switched to another model compacted on WorkBuddy first, got 429, and the switch failed. DeepSeek Harness's opened row on the Agents page now has a "compaction model" square (compact_model), offered once dsh is on magpie's route. It is magpie's own Live setting (settings.DshCompactModel), so nothing is written into dsh's profiles and no restart is needed. The gateway moves a dsh compaction to it (dshCompactTo, Route.Moved why "dsh-compact") when the model is enabled, served by its exact id and allowed to the key; else the compaction stays as asked with a log line. The Routing page says why. On magpie's llm-pi-ai routes DSH sends no x-deepseek-harness-compact mark, so its compaction is now known by compaction-basic's own ask (@deepseek-ai/dsh-compaction-basic 0.0.1-rc.3, the latest) in compactAsks. As a result DSH compactions show as Compaction in Usage and Routing, and a group's Compact rule reaches them too. The options are spelt magpie/<id> like the model field's, so `magpie dsh deepseek/flash` still sets the model (fieldForValue gives a bare value to the first field offering it). CLI: `magpie dsh compact_model magpie/deepseek/flash`; API: /api/set. zh, zh-TW, ja and de strings added. Run (mote): go test -count=1 -timeout 45m on internal/gateway, provider: ok at the base before the rebase on 0842bc517; agent, gui, settings, settingsapi, and the gateway's TestDsh/TestCompacting/ TestRuleCompact: ok at this head. The first agent run caught the square reading dsh's profiles at a stopped WSL distro (TestWSLColdPlaceOpensNothing, #3896); its options now look at nothing at a cold place. go vet on darwin, GOOS=linux -tags nogui and GOOS=windows: clean. gofmt clean. GUI in chromium and webkit: dsh-compact-model (new, 5 languages x 2 widths), desktop-subagent-model, codex-subagent-model, routing-moved-why, i18n-keys, i18n-en-no-cjk, claude-subagent-effort-row, codex-start-model-field, model-test-why and agent-connect-no-models: 140 of 140 pass; after the rebase (i18n.js changed upstream) i18n-keys, i18n-en-no-cjk, dsh-compact-model and routing-moved-why 48 of 48. Broken by hand, each red: dropping the compactAsks line (TestCompacting, TestDshCompactMoved on all three protocols), skipping the move in serve (TestDshCompactMoved), dropping the agent check (TestDshCompactLeft's other agent), taking the square out of extra() and dropping the routing story's case (dsh-compact-model.test.cjs). Not tried: a real DeepSeek Harness desktop app (none on this Mac or on mote); the compaction text was checked against the npm package's source. DS Bot's requests can't be told from dsh's, so its compactions follow the same setting, though it has no square of its own. |
||
|
|
0842bc517e |
gateway keys: a key may keep some accounts out and use every other, later ones too (LeiWang_2000 on X)
A gateway key could only be held to accounts picked one by one, so an account signed in after the key was saved was never used. An entry "<provider>/!<account>" (access.ExcludeMark) now keeps that account out: the key uses every other account of the provider, one added later too, and never the one kept out. - access: AllowsAccount refuses a kept-out account first, and counts only the entries naming accounts to use for "the providers it names", so a provider with only kept-out entries serves every other account. HeldModels and AccountModels ignore kept-out entries (keeping one out holds the key to no model). An issued key keeps out what its issuer does (foldAccounts). CleanAccounts resolves the ref after the mark and refuses an account both used and kept out. ReplaceAccount moves kept-out entries too. AccountsShown renders "X; every account but Z" for the CLI and the gateway's refusals. - CLI: `magpie gateway-key accounts <id> relay/!Second` prints "every account but relay/Second"; list and models read it. - GUI: the key row's menu has "Keep accounts out", which opens the app's menu (openProtoMenu, no native select); a badge names what is kept out and opens the same menu; an account the key was held to and is now kept out leaves the held ones. Strings in zh, zh-TW, ja and de. - docs: reference.md and providers-accounts.md. Run (mote, at this tree): - gofmt -l internal/ clean; go vet darwin, GOOS=linux -tags nogui and GOOS=windows of access, cli and gateway: clean. - go test -count=1 ./internal/access ./internal/cli ./internal/gateway: ok. New: TestKeptOutAccounts, TestKeptOutFolded, TestKeptOutReplaced; TestGatewayKeyKeptOutAccountsKeyedRoutes (chat, messages, responses, count_tokens, images, videos, System One and /v1/models over a key provider, a remote magpie and a Decide provider: the kept-out key never asked, every account kept out asks nothing, a key added after the gateway key was saved is used); TestGatewayKeyKeptOutCodexAccounts (Codex sign-ins, one signed in later used); TestGatewayKeyKeptOutQuotaCards; TestGatewayKeyAccountsCLI extended. - GUI: gateway-key-kept-out.test.cjs, chromium and webkit, 1100 and 440 px, en zh zh-TW ja de: 20 of 20. Every gateway-*.test.cjs and i18n-*.test.cjs file in both engines: 496 of 516, the 20 red all gateway-card's count of the row menu's items (5, now 6), updated here; then gateway-card, api-key-theme, gateway-connect-keys, gui-de, gui-ja and gui-zh-tw: 39 of 39. - Again after rebasing onto |
||
|
|
4869d0c966 |
library: an MCP server switches off for every agent and app, and on again as it was (swang20201 on X)
An installed server in Library could only be removed. Each server row
now has a switch after its agent chips. Per-agent chips already
existed, but in Docker gateway mode there are none, and the MCP router
gives every server to any app at its address, so nothing could turn a
server off there.
ServerOn (POST /api/library/servers/on, `magpie library mcp off|on
<name>`) reuses the Hidden/Paused pair a plugin's hidden server
already has. Off: Hidden, with its agents kept in Paused. On: those
agents get it back, or none when it had none, so the router gives it
to other apps again. Its command, env, headers, sign-in, DisabledTools
and note stay in library.json. Off, it is also left out of every
project's files (syncProjectMCP) and of subagents' mcpServers
(renderSubagent), which before had only skipped a server gone from
the library. The router's held process ends on the next prune,
because Hidden/Paused are in its hubKey. An off row is dimmed, its
chips take no click, and it is health-checked only on a click.
Strings are in zh, zh-TW, ja and de. docs/subsystems/library.md has
a row for it, and mcp-router.md names it.
Run (mote):
- go test ./internal/library ./internal/cli ./internal/gui: ok.
- go vet ./..., GOOS=linux -tags nogui, GOOS=windows: ok.
- gofmt -l: empty.
- GUI: the 145 files that touch the Library, i18n-keys and gui-*, in
chromium and webkit. 2798 of 2881 passed.
- i18n-keys was red because the key "{name} on" also matched core's
"{name} on magpie". The key is now "Turn {name} on or off", and
i18n-keys and library-mcp-on are green (26/26).
- Nine files are red the same way on a clean origin/main
|
||
|
|
0549e5301a |
masking: Send requests unmasked is found from Settings › Privacy and holds on every route (CrazyMouse_TT on X)
CrazyMouse_TT runs a model of their own and wanted masking off for it.
The switch already existed (the provider editor's Advanced › Send requests
unmasked, provider.Unredacted), but nothing near masking pointed to it,
and it held only on chat-shaped routes.
- Settings › Privacy has a "Sent unmasked" row: each provider set so is a
button that opens its editor with Advanced open; with none, the row says
where the switch is (settingsJSON.UnmaskedProviders, redact plugin's
unmaskedRow).
- Images (draw.go), videos (video.go) and Ark's own API (native.go) go as
written when every model they may go to is such a provider
(unmaskedMembers); a group with one member left on stays masked, as a
chat's route does (unredactedRoute).
- A Remote magpie may be set so too (SkipsRedaction no longer refuses
it): it is sent the request as written with no X-Magpie-Masked-As, so
it masks by its own Settings and switches, once, before any vendor
(1d6d263ee's hop). Left off, it is masked here, as before. The editor
says so for a remote magpie.
- Default stays off for every provider: nothing changes for anyone who
hasn't ticked it.
app.js stays under TestCoreScriptBudget by a shorter unmaskRow call and
three trimmed comments (app.js -51 bytes vs base).
Run (mote, at this tree): gofmt -l clean; go vet darwin, GOOS=linux
-tags nogui, GOOS=windows clean; go test -count=1 ./internal/gateway
./internal/provider ./internal/cli ./internal/masking ./internal/gui ok.
GUI (chromium + webkit, 5 languages, 1100/440px):
provider-unmasked, unmasked-providers, i18n-keys, i18n-en-no-cjk,
redact-route: 126 pass, 0 fail. masking-records.test.cjs is red the same
on origin/main
|
||
|
|
b75aff1073 |
library: billion-context for Zed through its /bili/ prefix (CoMi6818 on X)
billion-context's README lists Zed, but Library's billion-context tab offered only Pi, omp, OpenCode and Claude Code. Zed has no plugin of bili's. Upstream gives it two routes: `bili zed`, a Linux-only launcher that leaves a provider on loopback direct (so it never passes magpie's gateway), and, on every system, the /bili/ prefix its docs give any client whose model address can be edited, with `bili start` answering on 8787. Zed is now a URL lane (biliURLLanes, internal/library/bili_url.go). Switched on, magpie has bili start answer (one the user runs is used; else magpie runs its own under KeepLinked's context, logged to bili-start.log, and starts it again at magpie's start while Zed is on), then agent.ZedThrough sets the magpie provider's api_url to http://127.0.0.1:8787/bili/<gateway>/v1 and saves the key for that address in the credential store, where Zed looks it up by address. A pick and a sync keep the prefix while magpie answers through it (zedReach, #1985's proxy recognition). Off puts api_url back on the gateway and ends magpie's bili start when nothing goes through it. Zed must be on magpie first; the error says to pick a magpie model. Run: - bili 0.1.213 on mote: bili start --port N, then /bili/http://127.0.0.1:<fake magpie>/v1 forwarded GET /, GET /v1/models and POST /v1/chat/completions with Authorization kept and bili's tools injected (repro/zedroute.sh). - mote: go test -tags nogui ./internal/library ./internal/agent (full packages), go vet darwin, GOOS=linux -tags nogui, GOOS=windows. - mote: library-bili, i18n-keys, i18n-en-no-cjk GUI tests (chromium and webkit). - win-run: go test ./internal/agent ./internal/library -run 'TestZed|TestBili'. - gofmt -l clean. Broken by hand: SetBili without the URL-lane dispatch, and zedReach without the proxy keep: TestBiliZedThroughPrefix and TestZedThroughBili go red; restored, green. Not tried: a real Zed app through bili (no Zed on mote), and the real keychain write (zedCredential stubbed in tests, as before). Other clients upstream lists (Cline/Roo/Kilo, Continue, OpenHands, Void, Cursor, Warp, launcher-only lanes) are not added here. |
||
|
|
65f93ac27d |
routing: a group's member may be pinned to one account, tried in the group's order (EastonXvii on X)
EastonXvii asked for a group like Codex/Astra on account A, then Astra on B, then Sol on C, tried strictly in that order, with the same model on two accounts as two members. Before this, Group.Accounts held the whole group to a set of accounts with no order among one provider's accounts, so the only way was one group per account. A member id may now end with the account: provider/model[:effort][:fast]#<account> (provider.MemberAccount, groupaccount.go). - Every list keyed by a member's spelling (rules, Fast, Off, Weights, Placed, EffortMaps, Pick) and membersFound's dedup key include it, so the same model on two accounts is two members. The vendor is still asked for the model's own id. A group saved before has no "#" and reads as it did. - SaveGroup stores the account's stable id (a typed name is resolved by ResolveAccount). It refuses an account on group/ and auto/ members, and a new account magpie doesn't have. One the stored group had already that is gone since stays, matching nothing. - Gateway: planLevel's keys() leaves the provider's other accounts out for such a member (memberHeld; Held rows with HeldOwn in the trace). Fallback goes to the next member, never to another account under the same member. count_tokens counts on the resolved member's account (heldByGroupAt). Images and videos: drawingTries keeps one try per member account, and each try runs on a request held to that account (memberOn). - Sharing and importing a group drop members' accounts. - GUI: Routing → edit a group → each model row has an account chip (openPicker menu): "Any account", each account, and "Also on another account…", which adds the model on a free account as a member of its own after the row. Strings in en, zh, zh-TW, ja, de. - CLI: models=relay/m#B,relay/m#A,other/m (by name or id); show prints "on <name> alone". TUI effort cycling keeps the account. Run (mote, at the pushed head after rebasing on |
||
|
|
ca5e537ecb |
usage: traffic over time in Requests' chart, and how fast it flows now (songlairui on X)
songlairui on X asked for the gateway's bandwidth: many LLM calls, base64
images above all, weigh on the network. Each request's row already kept
its bytes up (UpBytes) and down (DownBytes), shown in its details and as
the period's "↑ · ↓" under the Requests card. What was missing was
bandwidth over time and right now.
- The Requests chart's metrics take Traffic: each hour's/day's bytes up and
down, stacked by model, provider or agent. Its axis is in bytes ("4 MB"),
its tooltip splits a column into "↑ up · ↓ down", and the ranking's
values are bytes with the same split under each. A period with none
says "No traffic counted in this period". A chart point's Part now
carries up_bytes/down_bytes, from rows (Part.add) and from the request
page's cells (Part.plus). The cells already kept Totals, so no cache
version bump is needed.
- While requests are in flight, the Requests card says how fast traffic
flows now: "↑ 1.0 MB/s · ↓ 40 KB/s", over the last ~3s, read from the
new GET /api/usage/traffic a second apart. That route reports the
gateway's running totals (Server.Traffic) and its requests in flight.
The totals are atomics added where a row's bytes are added (sentUp,
downCount.Read). So a stream counts as it arrives, nothing is buffered
or scanned, and the totals and rows count the same bytes once. Polling
runs only while Usage → Requests is shown and the window is visible.
The line goes when nothing is in flight and nothing flowed. When another
magpie serves the gateway, the route answers {} and the page shows no
rate.
A Codex turn on the Responses WebSocket (
|
||
|
|
16a2dfac9c |
lan: a LazyCat app offers the box's LAN address, or says how to forward the port
mtoolstec on X (after v0.1.3432) runs magpie from the magpie-lzcapp
package on a LazyCat box. Settings -> Share on local network offered
https://magpie.<box>.heiyu.space/v1, which only devices with LazyCat's
client reach, and http://172.28.3.65:3425/v1, the container bridge,
named "Other containers on this host", which nothing off the box
reaches. Other devices on his LAN wanted http://192.168.0.100:3425/v1.
The package runs magpie on the app's bridge network, and LazyCat
publishes an app's ports only on heiyu.space, not on the box's LAN
address. Its env names the app's domain, never the box's LAN IP.
- On the box's own network (network_mode: host, as LazyCat's Emby, Lucky
and LAN Sheriff run), magpie now finds the box's LAN addresses. It sees
the box's bridges/veths, or host.lzcapp is one of its own addresses, and
takes the IPv4 of the default route's interface, minus host.lzcapp.
LANURLs lists them first and the app domain after. A MAGPIE_PUBLIC_URL
of the user's own (not the domain) stays first, and a pinned
MAGPIE_ADDR still serves only that address. The sidebar names the box
address, not the domain.
- On a bridge network that address can't be known. The domain is listed
alone, named "LazyCat client", and the container-bridge address is no
longer offered under LazyCat (ContainerHostURL ""). The row under the
address, in Settings and on the Gateway page, says to forward the port
with LazyCat's "LAN port forwarding" app (局域网端口转发工具). The CLI
banner (serve, web) says the same.
- New settings/gateway fields: lanLazyCat, lanLazyCatBox; lazyCat,
lazyCatBox (and boot.js's sideGateway). Strings are in zh, zh-TW, ja
and de.
- host.lzcapp is looked up only under LAZYCAT_APP_DOMAIN, with a 2s
timeout and no lock held. An answer is kept; a failure is retried after
a minute.
Package side: the magpie-lzcapp package (lazycat-contrib, czyt) needs
network_mode: host plus host.lzcapp upstreams and the net.* permissions,
or its usage needs the port-forward steps. An issue is filed there.
Run (mote, macOS, at this tree on origin/main ce6ae593c; then rebased
onto ab084fdf2; api.go, providers.go and i18n.js changed there too and
merged clean):
- gofmt -l: clean. go vet: darwin for gateway/gui/cli; CGO_ENABLED=0
GOOS=linux -tags nogui ./... and GOOS=windows ./...: ok.
- go test -timeout 45m ./...: ok (before the string reword; after it,
internal/cli and internal/gateway again: ok).
- wsl-run (Ubuntu 24.04): the LazyCat/default-route/LAN tests in
internal/gateway and internal/cli: ok.
- GUI: lan-lazycat (new: 2 engines x 5 languages x 1100/420px, 20 tests),
i18n-keys, i18n-en-no-cjk, gui-de/ja/zh-tw, lan-docker and
side-gateway-lan: 85 pass, 0 fail. A wider set (lan-*, gateway-*, connect-*,
key-page, sidebar, phone-*, remote-magpie and others; 835 tests) was
run before the reword. Its reds were the i18n placeholder check
(fixed: no <box IP> in the string), and phone-connect-menu 420 (#4706,
#4707) and remote-magpie (#4398). Those last two are red the same alone
on origin/main
|
||
|
|
fdc96dfe4d |
library: a billion-context tab switches its plugin on per agent and restores each file exactly
@Kling__Lab on X asked for billion-context (npm billion-context, CLI bili, github.com/ranxianglei/billion-context) beside RTK. The Library gets a billion-context tab after RTK, a card like RTK's: - No bili: its README's `npm install -g billion-context --prefix=~/.local` and Install billion-context (InstallBili; biliPath finds bili in ~/.local/bin when it isn't on PATH). - Installed: its version, a note that an agent switched on here can't also run billion-context-pi or opencode-acp, and a switch per agent that runs `bili plugin install|remove <agent>` (SetBili), read back from `bili plugin list`. - Offered for Pi, omp, OpenCode and Claude Code, the lanes that keep magpie in front: Pi/omp/OpenCode load it in process and still send to magpie; Claude Code goes through bili's proxy, which forwards to magpie's gateway. Not offered: Codex (MCP only), ZCode (routes only its own provider), Kimi Code (renames default_model to bili-kimi), dsh (its install failed through dsh's pnpm), Hermes (can't be tried in a sandbox HOME), and agents in WSL. bili's remove doesn't restore a file: it leaves `"packages": []` in Pi's settings and `extensions:` in omp's config, and after magpie rewrote Claude Code's settings.json it deleted ANTHROPIC_BASE_URL (Claude Code then went to Anthropic, not magpie) and put back DISABLE_AUTO_COMPACT. So switching on records each file before and after (bili-plugins.json in magpie's config folder), and off writes the before bytes back when the file is unchanged since, else merges JSON three ways; with no record (bili set up outside magpie) only a Claude Code ANTHROPIC_BASE_URL the remove took out is put back. bili's .bili-bak/.bili-last files go too. `GET/POST /api/library/bili`, `POST /api/library/bili/install` are named in the CLI parity list beside RTK's. Docs: site library pages (en, zh, ja) and docs/subsystems/library.md. Run: - go test ./internal/library -run 'TestBili|TestParseBiliList' on mote: ok (a fake bili mimicking pi/claude lanes, .bili-bak re-backup and claude's buggy remove; a fake npm for the install). - Full `go test -timeout 45m ./...` on mote at 16c67965f (this commit before the body was written, same tree): every package ok but internal/gateway's TestBurstTellsNoSpeed/responses_from_chat_burst (804ms burst read as a speed, load ~50 after a mote reboot); passes -count=3 alone at the same head; recorded on #2719, same test. An earlier full run at 8c8c63537 was all ok. - GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go vet ./... at 16c67965f: ok. gofmt -l: nothing. - GUI at 16c67965f: library-bili, i18n-keys, i18n-en-no-cjk, library-memory, library-rtk-gain, library-pi-extensions, Chromium and WebKit (library-bili: every language, 1100 and 420 wide). 80 of 80 pass. - The whole GUI suite is still running on mote at this head, started before the tag; two earlier whole-suite runs were cut short (mote ran out of disk mid-run, then rebooted), so their reds are not a record. Its result goes in a follow-up. - Real, in a sandbox HOME (named dir, bili 0.1.213 installed there, magpie web built from this branch on 3486/3487): through magpie's API, Pi and Claude Code switched on; `claude -p` and `pi -p` each answered "pong" through magpie's gateway (Claude Code via bili's proxy on 18788 -> 127.0.0.1:3486); switched off: Pi's settings.json, Claude Code's settings.json and .claude.json byte-identical to before, no .bili-* files left, commands/acp-cache.md gone; claude -p answered again straight to the gateway. Earlier, with bili run by hand, Pi, OpenCode, omp, Claude Code and Kimi each sent a request through a recording relay with bili's tools/headers on it. Broken by hand: skipping biliRestore turned TestBiliOnOffExact, TestBiliClaudeKeepsMagpiesRoute and TestBiliOffWithoutRecord red; dropping the no-record URL fix turned TestBiliOffWithoutRecord red; removing the tab turned all 22 library-bili cases red; removing the zh note string turned the zh cases red in both engines. Each put back. Not tried: Kimi, dsh, Hermes, Codex, ZCode lanes (not offered); WSL; Windows (the %APPDATA%\npm lookup and npm without --prefix are untried on the Windows box); OpenCode and omp switched through magpie's API (switched by hand with bili before); a real npm install from the button (sandbox had bili already; the test fakes npm). |
||
|
|
98c4b2e814 |
usage: a request opens on a page of its own
geesehowardt7 on X clicked a request on the Usage page to see where it came from. The click on its time opened Routing, which they hadn't asked for, and the row's details had no source address. A row's click, or Enter or Space on it, now pushes that request's own page (#ledReqPane, ledReqOpen/renderLedReq) over the list. The page gives the model and status, then ledDetail: time, agent, source IP (the previous commit's client_ip: loopback reads "This computer · 127.0.0.1", a gateway row from before the field "Not recorded", rows read from session files, other computers and magpie's own calls none), requested, provider, account, sent, served, effort, then status, error, duration, tokens, cost, credits, speed and the archive. Routing is the View routing link in it, and the time cell no longer links there. "Requests ‹" or Escape (not while a menu, dialog or field takes it) goes back to the list where it was left, with the row focused (ledReqClose). Leaving the Usage page closes it (ledLeave(true)), and a refresh keeps it. The in-table expanding row (ledOpen, tr.led-detail) and its narrow-window lc-opt copies are gone, since the page shows every field at every width. It slides in 200ms with the ease-out curve, and only fades with reduced motion. "Source IP" and "Not recorded" are added in zh, zh-TW, ja and de. The 20 ledger test files that opened a row's details now open the page. usage-request-page.test.cjs covers the page, the address, the way back, focus and a 560px window. docs/subsystems/gui-shell.md describes it. Run at this commit's tree (rebased on origin/main |
||
|
|
7c1dc198d1 |
usage: a turn over the Responses WebSocket counts what the socket was sent, and says so
A Codex turn kept on a Responses WebSocket sends only the new items as a
delta, but the row's ↑ was the whole HTTP body magpie built before the
transport ran, so a long conversation read as ~13MB up per turn
(matrix0487 on Discord). overSocket now records what each socket write
carried (wroteSocket) and, when the turn went out on the socket alone,
replaces the HTTP figure with those bytes (sentOnSocket); a turn that fell
back to HTTP keeps the HTTP body and adds any socket write made before the
fallback. errCodexSocketAgain's retry on a new socket counts both writes.
The row remembers that it went over the socket: Record.Socket (json "ws"),
packed as Flags bit 16384 (rowSocket, added to TestRowFlagsApart). The
Requests table's protocol badge says "Responses · WS" and the details'
Protocol line "Responses · WebSocket".
Run on mote at this commit (rebased on origin/main
|