d1fa254b1d0d43bb636ea5a4d7d99bc511a12e0b
6395
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d1fa254b1d |
gui: masked words and Never mask are a list, a row per word (noahhrreion on Discord)
noahhrreion: "希望脱敏词选项可以做成真正的列表,在一个小输入框里面不方便管理多个脱敏词". Settings → Privacy's Masked words was one comma-separated box. It is now a list (wordList in plugins/redact/settings.js): each word is its own row, edited in place (Enter or leaving the row saves, Escape puts it back, emptied is removed), × removes it, and the last row adds. Its sibling, Never mask under the mask actions, had the same box and gets the same list. Stored values are unchanged: redactWords and the allow list are still string arrays, saved through the same savePrefs / settings/redact-allow calls, and nothing is rewritten on open (the new test checks that opening the page saves nothing). Typed or pasted text splits as the old box did (, , and newlines, trimmed, empties dropped), so a pasted "a, b" is two rows. The Hide eye still shows every row as dots. New strings are in the redact plugin's i18n for zh, zh-TW, ja and de; the two old "separated by commas" hints are gone from the core i18n. The site's masking docs (en, zh, ja) say a row each. Run (on mote via mote-run, Chromium and WebKit): - new redact-words-list.test.cjs: 5 languages × 1100/400px × both engines, draw, add with Enter, paste-split, edit, Escape, ×, empty-and-Tab, reload; with i18n-keys 24/24 ok - redact-words-hidden, any-case, whole, mask-actions, redact-route, redact-kinds, redact-shape, settings-search, settings-sections, settings-lines-wrap, settings-hints, settings-groups, readable-focus, masking-records, mask-alert: 378/378 ok - go test ./internal/gui/ -run 'TestCoreScriptBudget|TestSettings': ok (app.js shrank; no budget raised) - screenshots light/dark, 1100/400px, both engines, looked at Broken by hand: without wordFocusBack (focus kept across a redraw) the new test goes red (waitForFunction timeout after the first add). Dropping the blur guard during a redraw (wordsRedrawing / isConnected) stays green in both Playwright engines, which fire no blur on removal; it is kept as a guard for engines that do, with no test that fails without it. Not tried: the real app on WebKitGTK / Windows WebView2; no Go files changed. |
||
|
|
4ca55c6b62 |
gateway: a guard test that Only switch Claude Code's sign-in keeps every route off the Claude accounts (zhangxiaoxiaoxx on X)
zhangxiaoxiaoxx on X asked for a switch so that, with Claude signed in, magpie never forwards or routes another agent's request onto it. That switch exists: Providers > Claude, "Only switch Claude Code's sign-in" (magpie accounts switch-only claude on, |
||
|
|
f4e52659a8 |
plugins: a pick listed as another id leaves with its model (axelburks)
A plugin's model the user lists as another id ("list as", SetModelID) is
picked under that id, but pluginListedIDs held the plugin's own ids. The
hourly relist and Refresh compared the pick with a list that never had
it, so "in the old list, not in the new one" was false, and a model the
plugin dropped stayed picked and on, as if typed in by hand. The built-in
providers' liveIDs already mapped through modelIDsOf; the plugin path
now does too. The list-as stays in settings, so when the plugin lists the
model again relistPicks puts the pick back under the same id.
Run: TestListedAsPickLeavesWithItsModel (new: aaa listed as
claude-opus-5.5 and picked, next list lacks aaa -> pick set aside, alias
kept, a hand-typed pick stays; aaa back -> pick back, alias intact), on
mote. Broken by hand: with pluginListedIDs returning the raw ids the test
fails ("dropped []"). go test internal/provider, internal/plugin: ok.
internal/gui: TestCoreScriptBudget (1535230 > 1533802) and
TestMainWindowCorners (mote's macOS) red, neither touched by this change.
Not tried: a real plugin sign-in.
|
||
|
|
525e69b976 |
gui: a page served anew reloads once, not once per read (visamzh on X)
667317159's servedAnew reloads a magpie web page once another version of magpie answers for it. Clicked back into on the Settings page, the page reads /api/update twice, for the badge and for the Version row, and each answer called location.reload(). When the second answer comes a few ms after the first, Chromium starts the reload again and the page is loaded twice. The whole GUI suite at |
||
|
|
759b4d1d7d |
agents: a new user's list is folded under Get started (Renzexi01)
Renzexi01 on X (一进来就这么复杂): a new user saw Get started and, under
it, every agent found on the computer at once. While the Get started card
shows and no agent is in use yet, the whole Agents list is folded under
it behind "Show all {n} agents" (en, zh, zh-TW, ja, de); the card's
second step already names the agents found, each connected in a click.
Once one is connected, or the card is put away, the list is as before:
the ones in use in view, the rest under "Show {n} more".
getting-started checks the list folded under the card, the button's
words and aria-expanded in every language, and the list back once an
agent is connected or the card put away. Tests whose fake state is a new
user with no agent in use, and which read the agents' rows, now set
guideHidden as a user past Get started has (account-arrange,
aside-native, agent-*, claude-picker-magpie-first, codex-accounts-via,
omp-profile-connect, picker-rail-current, picker-speeds, pop-phone-room,
reasonix-roles, snow-fields).
What was run, on mote through mote-run, at a9a82a1c3 (tree e91b8e625,
the same as this commit once its fixup was squashed in), on base
|
||
|
|
67bc50aa29 |
routing: a group switched off is listed after the ones on (justacati)
justacati on X: a group switched off stayed where it was among the ones on, so the list read as if it were still in use. Routing's group list now shows the ones on first and the ones off after them, each part in the order the user set. Moving a group (drag, Move up/down) moves it among its own part only: the last one on is not offered Move down into the ones off, and a drag only passes cards of its own part. The saved order is unchanged, so agents' pickers list groups as before, and a group switched on again is back in its place. group-switch-add-many checks the order after a switch off and on, and that Move down is not offered on the last one on. What was run, on mote through mote-run, at a9a82a1c3 (tree e91b8e625, the same as this branch's head once the fixup was squashed in), on base |
||
|
|
43345c0ca8 | docs: gateway-routing names the GPT ids sent output_config.effort | ||
|
|
9a539e131e |
gateway: a GPT model on a Messages endpoint is asked its effort in output_config.effort (zxz8009195489)
A custom provider with the Messages format serving GPT models saw every request at medium on its console. magpie said the level only as a thinking budget (translated from Responses/Chat reasoning.effort, or passed on from a Messages client), and said it in output_config.effort for an allow-list: effortInOutputConfig (GLM-5.2/5.3, MiniMax M3.1 Flash) and DeepSeek's host. A relay that maps Messages onto OpenAI reads the level from output_config, so a GPT model was left at the relay's default. gpt-<digit> ids join effortInOutputConfig, on any host: both the translated path (buildAnthropic) and the Messages passthrough (withOutputEffort, fitted to the model's levels when known) now send output_config.effort beside the budget. Claude and other vendors' models are unchanged. Run (mote, at this tree): new TestGPTMessagesEffortInOutputConfig and TestGPTMessagesEffortThroughGateway (local fake upstream) red on the old code (output_config.effort "" for low/medium/high/xhigh), green after; go test -timeout 45m ./internal/gateway ok (685s). Unchanged checks in the tests: a Claude model and kimi on a relay or their own host send no output_config. Not tried: a real relay (the reporter's is unknown), other packages' suites (only the gateway package changed), GOOS=windows/linux vet. |
||
|
|
e17b6cefc7 |
provider: the Qoder movers install opencode-qoder-auth 0.2.61 (plugins #692, #638)
0.2.61 puts business.model_key in the request, as qodercli 1.1.82 does, so Qoder and Qoder CN bill the model chosen, not Auto. 0.2.61 also holds 0.2.60's 429-message change (c1a625d is an ancestor of the 0.2.61 tree). Run (mote): go test ./internal/provider -run 'TestQoderMovers|TestMovedBuiltinsSayTheirPlugin|Mover' ok. With min put back to 0.2.60 the new TestQoderMoversNameTheModelInTheBusinessRecord fails. npm view @magpie-community/opencode-qoder-auth@0.2.61 --prefer-online --registry https://registry.npmjs.org prints 0.2.61. gofmt -l clean. Not run before this push: the full suite (run after the tag). Not tried on a real Qoder or Qoder CN account. |
||
|
|
247794c613 |
codex: an account that is out takes over for other models too (reverses f37742e14)
With one ChatGPT account out and nothing to serve Codex's own model on (provider.CodexServesWhileOut false), |
||
|
|
68c43bba65 |
copilot: a Copilot account draws with the image models its /models lists
Copilot CLI draws with an image model (GPT Image 2.5 Flare) at the API base's /images/generations and /images/edits, OpenAI-shaped. copilotModels kept chat models only, so such a model was never seen. It is now saved as a drawer (Draws, so agents' chat lists still leave it out), found by the entry's capabilities.type or, for an unknown type, by an id that names images. The gateway lists them in DrawersOf and sends generation as Copilot CLI does: model, prompt, size, quality (and n). Run: gofmt; go vet (host, GOOS=linux -tags nogui, GOOS=windows) for provider, gateway, catalog; go test of the same three packages, all ok, on mote. New TestCopilotDrawsItsImageModel uses a fake Copilot API. Broken by hand: copilotDrawsModel returning false turns it red. Not tried: a real Copilot account. The model's real id, its /models type value, n and the edits shape on Copilot's side are unconfirmed. |
||
|
|
6d1e3f1e29 |
gui tests: library-problems-hide and panel-open-once load with a minute's room
nav-timeout (#4470) holds every page given a short default timeout to a navigation timeout of at least a minute. Two files broke it on main: |
||
|
|
2741b749f9 |
sessions: a codex fork's rollout-<n> turn does not end the copied head (#5090)
ownTurn ended a Codex fork's copied head at the first turn id the parent's
file didn't hold (
|
||
|
|
90bf96a23d |
search: a plugin can give a web search API (its search hook)
treeman on Discord #help asked for web search to be pluggable so users can
add search vendors. A plugin's `search` hook, {search: {<id>: {name, keysURL?,
keyOptional?, url?, execute({query, count, key, url}, ctx)}}}, adds an API to
Settings > Models > Web search as `<plugin>:<id>`. It is added, keyed, ordered,
switched off and removed like Tavily or Brave. The built-in APIs stay built in.
How: host.js collects the hook's entries (id [a-z0-9-], an execute) into
Loaded.Searches and runs one with the `search` op (timeout from ctx, an error
with a numeric status comes back as a refusal). The host notes them in
plugin-searches.json (internal/plugin/search.go); provider.AllSearchVendors
adds the noted ones of plugins that are on to SearchVendors, so Ready, check,
the CLI and the GUI list see them. askSearchAPI hands a plugin vendor to
askPluginSearch below askSearchAPIKeys, so keys, rest on 401/402/403/429,
order, the masked query and the request-log row are the built-ins' own.
Run (mote, on this tree, whose base
|
||
|
|
df7c94bdf5 |
gateway: inline image descriptions survive a restart (#5121)
The vision description cache (Server.sights) was in memory only, so a restart, update or handover described every image of a long conversation again (62 calls in 2.5 minutes in the report). Completed descriptions of inline images are now appended to vision-cache.jsonl (0600) in the config dir before their waiters are released, and New restores them under the same 2048-entry LRU. URL images stay in memory (their bytes can change); failures are never written. Appends and compaction go through a file lock, a corrupt or truncated line is skipped (and backed up before compaction), and shutdown waits for pending saves within the drain window. Patch by MYCF711, applied clean on main. One change: the Unix permission test now makes the config folder before it pre-creates the file (it failed on a fresh sandbox, where the folder doesn't exist yet). Run (mote, at this tree): go test ./internal/gateway filtered to the vision/sight/cache tests, ok; gofmt -l clean; go vet ./internal/gateway for linux and windows, clean. Broken by hand: saveSight call removed from see(), TestDescriptionSurvivesGatewayRestart red (2 descriptions, want 1), green again with it back. Windows: the same filtered tests on xiaomi-gpu via win-run. Not tried: full go test ./..., go vet ./... for linux (wails cgo doesn't build off-platform on mote), a real process kill or a real handover, a real gateway with a real vision model. Co-authored-by: MYCF711 <323101370+MYCF711@users.noreply.github.com> |
||
|
|
6673171595 |
update: the app and magpie web follow each other's update (visamzh on X)
visamzh on X: with the desktop app and magpie web both open, an update
from either side left the other still offering it ("↑ 更新") until it was
quit by hand.
Cause: the app and magpie web are two processes over one program, each
with its own updater (state, download, latest) in memory. One restarting
to update puts the new binary in; the other is told nothing. Its
replaced() (the binary on disk is no longer the one it started from) was
read only on a click of its own Update or on magpie update's gateway ask
(restartBeside), which reaches only the process serving the gateway. And
a browser's page reloaded (backAsNew) only after a restart it asked for
itself, so magpie web's tab kept the old page and its pill even once
the process under it was new.
Fix:
- followReplaced (update_beside.go): every updater stats its binary each
5 s and, once another magpie replaced it, restarts into it through
restartBeside, once: at once when idle, else after the gateway's
requests (waitIdle), as for magpie update's ask. Not for what this
process put in itself (installed, set by install, cleared by
wontStart), not twice (followed), not for a build that isn't a release
(make dev, go build rebuild in place). It stops with backendCtx, so a
copy left draining after a handover doesn't look.
- waitFor (update_wait.go): a wait for the gateway restarts into what
another magpie put in whatever the feed says now; before, a feed out
of reach or a "latest" answer ended the wait with nothing restarted.
- boot.js names the version that served the page (bootPrefs.version);
app.js's servedAnew reloads a browser's page (web) when /api/update's
current names another, on the reads it already made (load, focus, back
into view) and once a minute while shown. The app's own windows come
back with their new process and are left alone.
- docs/subsystems/gui-shell.md describes it.
Run (mote, through mote-run, at
|
||
|
|
452c28a78c |
cli: GET /api/context/reply is named as the window's own (#5026)
TestEveryRouteHasACommandOrIsNamed was red on main: the route came in with |
||
|
|
0e1054ce19 |
statusline: the gateway serves Claude Code's status line to another computer (steven_4422)
steven_4422 (Discord) runs magpie in Docker and Claude Code on the host.
The status line square writes the host's settings.json, which the
container can't reach, with a command naming a binary inside the container.
GET or POST /v1/magpie/statusline answers the line `magpie statusline`
prints, as text/plain, so the host needs only curl:
curl -fsS -m 1 -H 'Authorization: Bearer <key>' --data-binary @- http://<host>:3425/v1/magpie/statusline || true
Claude Code's stdin JSON (session_id) adds the model, as /v1/magpie/route
does; ?session= and ?only= work too. The renderer moved to
provider.StatuslineText, shared by the CLI and the endpoint. A caller that
isn't this computer needs a gateway key (lanGuard, unchanged; the handler
also refuses a non-local caller without one). A read-only key is allowed
(GET and POST in readOnlyRoutes) and gets the windows without the model; a
key held to budget, models or accounts sees only its own (scopeQuotas).
corsGuard and origin checks are untouched.
magpie web shows the command in Settings -> About (en, zh, zh-TW, ja, de).
Docs: reference.md, agent-wiring.md, gateway-routing.md, docker pages en/zh/ja.
Run at this head (rebased on
|
||
|
|
59c1306035 |
claude: an auto-mode client's tool loop keeps its interactive run (#4804)
Auto mode's safeguards change with every tool batch: prior_turn_context grows by the turn before. An interactive Claude Code run read them once, from CLAUDE_CODE_EXTRA_BODY in its environment as it started. So a tool loop either started the run again (the whole conversation written to the cache again), or kept it and sent the classifier the context it started with, which is not what real Claude Code sends. Each turn's safeguards now reach the running run: - The bridge writes the extra body to <run tmp>/guard.json and hands its path to the helper as MAGPIE_CLAUDE_GUARD (mapped for WSL in newTap). - tap.js, on each /v1/messages request whose string body has a safeguards key, reads the file and puts its safeguards in the body. It also sets CLAUDE_CODE_EXTRA_BODY to the file's text, so Claude Code's own later reads agree. The first time, it writes guard.json.live. - setSafeguards rewrites the file (temp and rename, retried for Windows) instead of restarting, once .live exists. Without .live (a Claude Code that doesn't load the tap), it falls back to the old rule: keep the run when only the varying parts changed, otherwise restart. A beta change, or safeguards appearing or going, still restarts. The tap changes only the safeguards value; any other byte of the body is Claude Code's own. Bodies without safeguards, count_tokens and non-string bodies are passed through untouched. The tool-results path logged "process expired" alone while the run's end read "magpie ended it". It now aborts the run with the reason and logs "tool results process expired: <reason>". continueWith's "not waiting for tool results" does the same. Tests: - TestClaudeTUIToolLoopCarriesEachBatchsSafeguards: three tool batches with growing prior_turn_context, then the answer. Checks one run and that each request carried its own batch's safeguards. - TestClaudeTUIToolResultsLogWhyTheRunEnded: no tap and the rules change. Checks that the log has the reason. - TestTapPutsTheGuardFilesSafeguards (bun and node): the rewrite, the bodies left alone, the env, and .live. - TestTapEnv: MAGPIE_CLAUDE_GUARD is passed through, WSL-mapped. Run (worktree at |
||
|
|
d8b3749ef7 |
agents: Copilot CLI reaches magpie's models through its providers.json (BYOK)
tony9759 on Discord asked for Copilot CLI to be wired to magpie, since its
docs say it takes a custom model provider URL.
What Copilot does (1.0.105, @github/copilot-darwin-arm64's cli-main.js,
`copilot help providers` / `help environment`; GitHub docs
docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models):
env BYOK (COPILOT_PROVIDER_BASE_URL, _TYPE openai|azure|anthropic, _API_KEY,
_WIRE_API completions|responses) and a providers.json at
$COPILOT_PROVIDERS_CONFIG, else <COPILOT_HOME or ~/.copilot>/providers.json:
{providers:[{name,type,baseUrl,apiKey}], models:[{id,provider,name,
maxPromptTokens,maxOutputTokens,...}]}, picked as <provider>/<id> in
settings.json "model". Neither needs a GitHub sign-in. The multi-provider
file is marked experimental in the SDK types. The version BYOK started in is
not verified (github/gh-aw#25014 says 1.0.19; GitHub's changelog of
2026-04-07 announces it).
magpie writes the persistent file, not the environment: provider "magpie"
(openai chat completions, the gateway's /v1, the agent-named key) and one
models entry per catalog model, then model = magpie/<ref>. Only entries
naming magpie are magpie's; the user's providers, models and other keys stay
through connect, Sync and Disconnect (which also restores the model they were
on); a file that does not parse is never written over. COPILOT_HOME and
COPILOT_PROVIDERS_CONFIG are honoured (the latter added to agentenv.Vars).
Copilot's own models stay in the field's list.
Run at this head (a4fb75bfd's tree on
|
||
|
|
47b7ba3030 |
models: a model its provider lists at $0 says free in the pickers and Routing (jiangguochao666 on X)
jiangguochao666 asked for each provider's free models to show in Routing and the model settings, to route to them. The green free tag was shown only for a plan's free model or a model with "free" in its name. provider.PricedFree says a model is free only when its price for that provider is known to be $0: - A price the user set comes first (provider/model, provider/*, then the model's own key). A $0 one makes it free, and any other price, a paid tier included, makes it paid. - Otherwise the provider's own catalogs decide. A $0 from a plan's catalog (-plan, membership catalogs) is the plan's per-token price, not free. A $0 from only the model's maker is not free either: a relay serving Zhipu's free glm-4.7-flash may charge for it. - No known price means not free. FreeModel (Free first, Cheapest first routing) is unchanged. From the local models.dev cache this tags: - every model of NVIDIA NIM and ModelScope; - the :free / -free models of OpenRouter, OpenCode Zen and Go, Kilo, AIHubMix, ZenMux, Vercel, Requesty and other relays; - Zhipu's and Z.ai's glm-4.x-flash. No coding or token plan is tagged. Where it shows, with the hover "free: listed at $0 on this provider": - an agent's model picker (agent.Option.Zero); - the provider editor's model chips, and its Free only button (modelJSON.Zero); - Routing's Add a model and classifier pickers (modelRef.Zero). The word is new in en, zh, zh-TW, ja and de. Tests, each red on the old code: - TestPricedFreeIsTheProvidersOwnZero: own, plan, maker-only, unpriced and user prices. - TestPickerSaysAZeroPricedModelIsFree: Option.Zero, cleared at once by a price the user saves. - TestZeroPricedModelsSayFree: the editor's and Routing's JSON. - zero-priced-free.test.cjs: the three surfaces, in Chromium and WebKit, at 1100 and 420px, in all 5 languages. It checks the tag's text, hover and fit, that the paid model has no tag, that a plan's free model keeps its own hover, no sideways scroll and no page errors. Broken by hand (each restored, diff checked): - The source check ignored (maker and plan $0 count): the provider test goes red on the plan model and the relay's glm-4.7-flash. - PricedFree always false: the provider, agent and gui tests go red. - The user's price ignored: the provider and agent tests go red. - The badge's o.zero / m.zero and Routing's zero dropped in app.js and routing/client.js: zero-priced-free goes red, "the $0 model has no free tag in the agent's picker". Run at this commit's tree (base |
||
|
|
1cb346f2dc |
gui: on Linux the folder and Backups buttons start the opener and return (pkh1585)
pkh1585 on Discord: on Linux, clicking the Library's folder / Backups button froze magpie and the file manager that opened closed by itself. Cause: Linux openFolder was Wails' OpenFileManager, which runs the desktop's file manager (the inode/directory .desktop Exec, or xdg-open) with cmd.Run under a 10 second context. A file manager that isn't running yet stays in the foreground, so the click waited the full 10 seconds and then the context killed the window that had just opened. Windows had the same shape and was fixed earlier (folder_windows.go); macOS's `open` returns at once. Fix: proc.OpenFolder (Linux) starts xdg-open (else gio open, exo-open) with no stdio and a session of its own, reaps it in a goroutine, and returns. All callers go through Host.OpenFolder (Library folder, Backups reveal, usage and backup saves, logs/config reveals, browser reveal), so every sibling is reached. macOS keeps Wails' way (folder_other.go is now !linux). Run: - mote-run go test ./internal/proc, wsl-run (magpie-desktop) go test ./internal/proc: ok. New TestOpenFolderDoesNotWaitForTheFileManager: with the Wait made synchronous it fails on WSL (waited 1m0s); with Setsid off it fails (shares magpie's session); green with the fix, -count=3. - Real XFCE (magpie-desktop, DISPLAY :0, real Thunar): the old way (`timeout 10 thunar dir`) blocked 10s and killed Thunar (rc 124, no thunar left); `setsid xdg-open dir` returned at once and Thunar stayed up 12s later. - gofmt clean; go vet ./internal/proc for linux, windows (mote), linux (wsl); go vet ./internal/gui on macOS. Not tried: a built Linux magpie GUI clicking the real button (WSL has no gtk4/webkitgtk-6.0, so internal/gui can't build there, and linux gui vet wasn't run); Omarchy/Hyprland; AppImage env (LD_LIBRARY_PATH) leaking into the opener, which is unchanged; the full go test ./... suite and GUI tests (no GUI or JS file changed). |
||
|
|
b045362a92 |
routing: importing a shared group whose id is one of yours replaces that group (issennknight)
Import on the Routing page always added a new group. When the pasted text
carries the id of a group of the user's own (not one magpie found), the
box now says so before it is pressed: the button reads "Replace <name>"
and a line under the box says its models, routing and rules are replaced
and its accounts and folder rules stay. Pressing it posts groups/import
with replace, and provider.ImportGroupOver saves the text's group over
that one, in its place in the list. Matching is by id only; no other group
changes. Kept as the user has them, since the text can't carry them: the
group's accounts, its folder rules (that still fit the new members) and
its on/off switch. A name another group has gets a number. A text whose
id nobody has, a found group's id, or any import that doesn't ask to
replace adds a group as before. ImportGroup is unchanged.
Run on mote at the pushed tree before rebase:
- go test ./internal/provider (Share|ImportGroup): ok; the new
TestImportGroupOverReplacesSameID is red with the match switched off by
hand (replaced=false, id three-2).
- go test ./internal/gui -skip TestMainWindowCorners: ok. TestMainWindowCorners
fails on mote's macOS 27 box and on an untouched origin/main checkout
alike (
|
||
|
|
c360d9d30d |
gui: a tap that slides off its Form | JSON option still picks it (refeccd)
A trackpad's tap lifts a few pixels from where it came down. On the small options of a segmented control (Form | JSON in the MCP server editor) the lift can land off the option, so the browser clicks neither it nor the option it came down on: the press shows (the option shrinks) and nothing is picked, and the next tap, lifted in place, works. segsPress already clicked the same option again when a redraw replaced it between down and up; it now does so too when the option is still there but the press was let go off it, within tapLike's bounds (under 300ms, under 12px). A press dragged farther, or held longer, is still no pick, as for any button. Every segs control (the same helper) takes it, in the editors, Settings and the lists. Test: library-mcp-first-click presses near the top of the option, slides 8px up, off the switch, lets go inside 300ms, both ways, in en zh zh-TW ja de, Chromium and WebKit, at 1100 (desktop) and 390 (web). Red on the old code (12 of 22: every 1100 case in both engines), green with the fix (22 of 22), run through mote-run. Not tried: the reporter's own trackpad and video (not seen); the whole GUI suite is run before the push, see the push record. |
||
|
|
12d4825afa |
gateway: a turn of only waits (sleep, wait, delay, pause, poll) is not a tool loop
xiaozhi09400 (Discord, Codex): clock__sleep {"duration_ms":60000} called 8 times
while CI ran was stopped as "the same tool call, the same result". A wait
is asked again with the same arguments and answers the same by design; the
time passing is the progress, and a request carries no timestamps to
measure it, so the guard now skips a turn whose calls are all waits.
A call is a wait when the tool's own name (after server__ / namespace
prefix, so a server called "wait" does not count; snake and camelCase
split into words) has sleep, wait, delay, pause or poll, or when its
arguments are only duration keys with numbers (duration_ms, seconds, ms,
timeout...). A turn that waits and also runs another call is judged as
before. Any other tool repeated 8 times is still stopped.
Run (mote-run): TestToolLoopLetsWaitsBy is red on the old code (8 wait
shapes stopped; guard disabled by hand) and green now; ./internal/gateway
-timeout 45m ok (696s); GOOS=windows and GOOS=linux -tags nogui go vet ok;
gofmt clean. Not tried: a real Codex with the clock MCP server; Codex's
exact namespaced name is taken from the report (clock__sleep).
|
||
|
|
a6f5d738fc |
gateway: a group's serial walk has a total budget of 540s (#5113)
Nine members at a 60s first-token wait took 660s, past the 600s a client
waits. The client hung up first and the member it was on was told as the
failure. Nothing bounded the sum of the members' waits.
groupBudget (540s) counts from the walk's start. A member asked with less
left than its FirstToken gets only what is left (holdWriter.budgeted); when
that runs out, or the walk has used the budget, no further member is asked,
the member isn't rested (it was cut short, not slow), and the error is a 504
naming the budget. A client cancel was already read first (nobody blamed),
and is unchanged.
Reported by mycf_711 in #5112; #5113 stays open for the reporter.
Run at the pushed head (rebased on origin/main
|
||
|
|
e2d52b5012 |
provider: ZCode's mover min is 0.1.49, whose -Trial entry is no longer answered "quota exhausted" after a free-first refusal (Can4ry_ on X)
Can4ry_ on X: GLM-5.3-Flash-Trial answered "429 · ZCode's limited quota
for glm-5.3-flash is exhausted or temporarily unavailable" in magpie while
ZCode's own app was served. The plain GLM-5.3-Flash also kept going to
the Coding Plan after the Start Plan opened at 23:00. And there was no
freeFirst under Providers › ZCode.
zcode 0.1.49 (plugins 36a017a):
- A free-first gift refusal that isn't a quota answer (405/3012) now
rests only free first's use of the model. Before, it shared the rest a
-Trial entry obeys, so the Trial answered a local 429 without asking
ZCode.
- The local 429 keeps the spent words last. 0.1.48 appended "(ZCode
answered 429 …)" after them, so zcodeSpentWords didn't match and the
account rested whole.
- free first is a switch, "Free quota first", in the provider's editor
under Plugin options, just above Advanced (auth.options free_first,
on by default).
keepMovedCurrent updates every moved user to 0.1.49.
The gateway test gets 0.1.49's rested wording, which rests the Trial
entry alone, and 0.1.48's, which rested the account.
Correction to plugins 36a017a's body: its old-code block-page test
fails because the old code has no `sidelined` map. Its second plain
request did not go to the gift again.
Run on mote, at this tree (rebased on origin/main
|
||
|
|
7aff42d863 |
plugin host: the sign-in lock and file waits no longer freeze the event loop (#5112)
pause() was Atomics.wait, which blocks Bun's one thread. lockAuth spun on
plugin-auth.json.lock with pause(5) for up to 2 x AUTH_LOCK_STALE (20s),
and writeDurable and readFileSteady waited up to 500ms each, so one
plugin's renewal storm stalled every plugin's requests, model lists and
check-ins (499s while the port still answered). Reported by mycf_711.
- pause() is gone; sleep() is an awaited setTimeout.
- lockAuth, writeDurable, keepAuth, writeAuth and changeAuth are async,
and so are their callers (setAuth, removeAuth, settle, save, apiKey,
staleAccess, import/take/signOut, pi.js modify/delete).
- changeAuth takes in-process changes one at a time (authQueue) before
the file lock, so a host's own changes don't poll against each other;
the lock poll backs off 5ms to 50ms. Stale-lock takeover (10s) and the
change being made on a fresh read under the lock are unchanged.
- The sync readFileSteady (readAuth, hot path) no longer waits: it retries
twice at once, and readAuth keeps the last good read when the OS still
refuses (a failed read is unknown, not none). Under the lock the wait
is async (readFileSteadyAsync, 50 x 10ms as before).
Test: TestAuthLockWaitDoesNotFreezeTheHost holds the lock 600ms and checks
a timer keeps ticking while changeAuth waits, 20 concurrent changes lose
none, and a lock 11s old is taken over. On the old host.js it fails
("the lock is still held at 300ms": the loop froze 10s). Verified by
putting the old host.js and pi.js back.
Run (mote, at this tree): go test ./internal/plugin ./internal/gateway
./internal/provider all ok; gofmt, GOOS=windows/linux go vet of
internal/plugin clean. Not run: full go test ./..., a real Windows host
under a renewal storm. The serial-fallback total budget is #5113.
|
||
|
|
e4bc3eeb6f |
gui: the context window card's head keeps its title, icons and model apart at every width
packinggoods on Discord, in #feedback: in a narrow window the Routing page's "Context window" head drew the provider's icon over the end of the title. The mono model id (remote-magpie/claude/cla...) and the Live pill sat beside it. The cause was .ctx-fold, the title's button when the card can fold. It had min-width:0, so it shrank under the route, and the title's nowrap text ran on under the icons. The title no longer shrinks (flex:none). The route and the state now go together in .ctx-end, and the head wraps. Where the title leaves them too little room they take a line of their own, ending at the right, and the model id is cut there with an ellipsis. A folded card stays one line. At 520px and below it drops the agent's name and the lab part of the route. At 420px and below it drops the route and the state's word, keeping the state dot and the bar. The fold button keeps an outer height of 20px (margin -1px), so opening the card doesn't move the page. New test, ctx-head-narrow.test.cjs. It uses the reporter's model, live and counted, with and without the agent, with and without a known window. It runs en, zh, zh-TW, ja and de, at 1100 down to 340px, open and folded, in Chromium and WebKit. It checks that the title's text is whole, that no drawn parts overlap (boxes clipped to their overflow ancestors), that an icon is never part-cut, and that nothing runs past the card. Run at this head (rebased on a fresh origin/main), on mote, both engines: ctx-head-narrow, ctx-route, context-window, routing-context-fold, routing-ctx-still, routing-ctx-fold, routing-live-patch and i18n-keys: 188 pass, 0 fail. The whole GUI suite is running on WSL (Linux, both engines) and had not reported when this was pushed. Mote was busy with three other sessions' full suites. The owner's rule is to ship a verified fix at once. Any red it finds that this change caused gets an issue. Broken by hand: ctx-head-narrow on the old context.css/js is 52 of 52 red (e.g. "open at 580px: the title is whole ... cut:true", "title and lab icon overlap"). Not tried: the real Wails app (WebKit on macOS, WebKitGTK on Linux, WebView2 on Windows). |
||
|
|
9ce59b8340 |
routing: a request's row says the credits its reply said it cost (jiabubu)
jiabubu on Discord (#feedback): the Routing page's request list showed no credits for a request that spent them. The gateway already read a reply's usage.credit (#2512) into the usage ledger, which the Usage page shows, but the route trace's RouteUsage had no field for it. RouteUsage now carries Credits (the reply's, nil when it said none). The Routing page's request row shows "N credits" after its cost, or alone when the request has no known price (it read "—" before), with the Usage page's help text under the pointer; By session sums them in the session's cost, shown even when no request in it was priced. The help text "What it cost in its plan's credits, as the reply said" moves from the Usage plugin's i18n.js to the core's, since two plugins say it now. Tests: TestPluginPlanCreditsReachTheLedger also checks the route's usage carries 0.01 on every endpoint (red without the field: Credits <nil>). routing-credits.test.cjs: credits alone, priced plus credits, none, and a session's sum, in chromium and webkit, en zh zh-TW ja de, at 1100 and 420, with no overflow. Broken by hand: the old client.js makes routing-credits 10 of 10 red. Run at the pushed head on mote: gofmt -l clean; go test -run 'TestDailyCredits|TestPluginPlanCredits|Credits' ./internal/provider ./internal/gateway ok; GOOS=linux go vet -tags nogui and GOOS=windows go vet of provider, gateway, gui ok (rebased on origin/main |
||
|
|
ec3111d873 |
usage: a pool set aside counts in its card's credits a day (jiabubu)
jiabubu on Discord (#feedback): Usage → Overview's "Credits used per day" for WorkBuddy left out the extra credits, and read 0 every day while only extra credits were spent. The WorkBuddy plugin (0.2.19) sends the plan's "Credits" and "Extra credits", the one whose running out doesn't stop the account set aside (aside: true), usually Extra credits. creditWindows dropped every window set aside whenever the card had one that wasn't, a rule meant for CodeArts, whose buckets set aside are its 总积分's credits again. So WorkBuddy's extra credits, Kiro's bonus credits and a MiniMax credits window set aside were never counted. Now every credit window is read, and noteDailyCredits tells a breakdown from a pool by what the readings used: a window set aside counts unless the card's counted windows in its unit used at least as much over the same span, which makes it their credits again (CodeArts). It is kept as creditsAccount.Part; a window set aside that is a breakdown, with no days of its own, isn't shown. No vendor is named in the rule. Days before this release can't be recovered: magpie never kept the extra credits' readings, so the chart counts them from the first reading after the update. Tests: TestDailyCreditsPoolSetAside, WorkBuddy's card shaped as the plugin sends it for a China free account (CN_FREE_SUMMARY's 0 / 500 and 282 / 2900 in the plugins repo's workbuddy usage.test.mjs), the plan untouched while extra credits grow, then the plan spent and set aside instead; and a Kiro card with bonus credits. Red on the old credits_daily.go (no days for Extra credits or Bonus credits). TestDailyCreditsEveryVendor (CodeArts' buckets) still counts only 总积分. Broken by hand: Part always false makes TestDailyCreditsEveryVendor red (基础积分 counted beside 总积分). Run at the pushed head on mote: gofmt -l clean; go test -run 'TestDailyCredits|TestPluginPlanCredits|Credits' ./internal/provider ./internal/gateway ok; GOOS=linux go vet -tags nogui and GOOS=windows go vet of provider, gateway, gui ok (rebased on origin/main |
||
|
|
b92b3bc5b1 |
provider: raise the ZCode mover min to 0.1.48
0.1.48 (npm, checked with npm view --prefer-online) puts ZCode 3.17.2's prompt texts in the Start Plan request (jinpy666's plugins#682). 0.1.46 said 3.17.2 in the headers with 3.14.3's system blocks in the body, which zcode.z.ai has answered with 405/3012 since 11-03 while the ZCode app works on the same accounts (plugins#348, Discord reports). Run: go test -timeout 45m ./internal/provider on mote, gofmt -l clean. Not tried: a real ZCode account; the plugin side rests on #682's live run. |
||
|
|
7785c42787 |
provider: raise the ZCode mover min to 0.1.47
0.1.47 (npm, checked with npm view --prefer-online) sends a free gift
model such as GLM-5.3-Flash-Trial to ZCode spelled as the registry does
("GLM-5.3-Flash"), as the 3.17.2 app sends it, not the lowercase bucket
name, and the plugin's own 429 says when ZCode answered 429 to the last
request for the model (rested a minute). Reported on Discord as the
free Flash model failing in magpie while working in the ZCode app.
Run: go test -timeout 45m ./internal/provider on mote: ok. go vet for
linux and windows: no errors. gofmt -l: clean. The plugin side ran
bun test packages/zcode on mote.
Not tried: a real ZCode account; the cause is not proven. A 405/3012 is
ZCode's account risk control (plugins#348) and this does not lift it.
|
||
|
|
4c0cfafcf8 |
gui: a tap that slides a few pixels is a click, not a drag (refeccd)
A trackpad's tap-to-click presses and lets go within tens of ms and the pointer can slide a few pixels between. dragRows and dragCards lifted the row after 4px and marked the handle dragged, so the click that followed was swallowed: an agent row's logo, a provider row, a usage card took a second tap. A press let go under 300ms and under 12px from where it came down now sets nothing down and lets the click through (tapLike). A real drag, held or long, still moves the row. Reported by refeccd (Discord #feedback, 2026-11-03). Run at the pushed head (mote, node --test, Playwright chromium + webkit): tap-click.test.cjs (new; en/zh, window/panel, slid 0/5/9px; 26 ok), and account-arrange, agent-grip, drag-rows-shift, fold-show-grip, gateway-key-arrange, grip-inset, group-arrange, group-member-drag, list-sort, panel-arrange, usage-arrange, click-scroll: ok. Broken by hand: with the old app.js tap-click is 18 of 26 red (every slid 5px and 9px case, both engines); the 0px case passes on both. routing-rule-drag chromium is red on the old app.js too (known: #3789, #5088), not from this. Not run: the whole GUI suite (another session's was running on mote), a real trackpad tap (can't be done from a test), and hover-revealed controls that shift under a tap, none found to be the cause. |
||
|
|
7033f50722 |
gui: the panel opens the main window from its edge nearest the tray
isaac_bai on Discord, after v0.1.2857 named the header's icon "Open the
main window": with Windows' taskbar at the bottom, the panel stands above
the tray and its header is the panel's whole height from the icon; the
button left of Quit was where his pointer already was. yogurt36 had asked
for one opener, not two, so the panel still has exactly one, now on the
edge nearest the tray:
- Hung below its icon (the Mac's menu bar, a taskbar or bar at the top)
it is the header's icon, as before.
- Standing above it (Windows' bottom taskbar, a bottom panel on Linux) it
is "Open the main window" left of Quit in the foot (#openMain), and the
header has no icon. The string is the one the icon's name already
uses, in all five languages.
Which side: once togglePanelNow has placed and shown the panel,
tellPanelSide reads the panel's bounds and its screen's and sends
magpiePanelOpenAt("foot") when the panel is nearer the screen's bottom,
"head" otherwise (panelOpenAt, panelside.go; the Mac is always "head").
Under Wayland a window can't read where the compositor put it, so there,
and until the app says, layout.js sets body[data-open-at] by the system:
"foot" on Windows, "head" elsewhere. CSS shows one of the two from it.
Tests:
- TestPanelOpensTheWindowFromTheEdgeNearestTheTray: Windows bottom/top
taskbar, a tall panel, a second screen above the first, Linux X11
bottom/top, Wayland, a screen not read, the Mac, unknown places; only
"head" or "foot" reach the page.
- TestPanelToldItsSideWhenShown: both show paths in togglePanelNow call
tellPanelSide after placing; app.js has magpiePanelOpenAt.
- panel-open-once.test.cjs, Chromium and WebKit x en/zh/zh-TW/ja/de:
on a Mac platform exactly one opener, the header's, named per
language, opening /api/window/main, foot ["profBtn","quit"]; told
"foot" it moves. On Win32 exactly one opener, the foot's, left of Quit
(["profBtn","openMain","quit"]), the foot's buttons fitting apart with
their words whole at 360px, opening /api/window/main; told "head" it
moves back; an unknown side changes nothing.
Run on mote via mote-run:
- At this head (rebased on
|
||
|
|
8468afecb3 |
claude: a turn's images say they are attached, so the file notes after them are not taken for the images
Claude Code notes each image it is given ([Image: source: .../images/N.jpg])
in a note after the message, with a path in the gateway's temp folder. With
no history before the turn, nothing said what they are: the model took the
paths for the images, said it could not see them and quoted the paths as on
another computer (sinsoul1647 on Discord, v0.1.2862, 7 tool-result photos).
The prompt (renderClaudePrompt) and a saved session's turn (renderClaudeTurn)
now say the images, tool results' too, are in the message.
Tried: real claude 2.1.316 on mote against a fake Anthropic server, with
-p user images, MCP tool-result images, a url source, the TUI paste and a
resumed transcript: every one reached the API as image blocks, so the loss
is the model's reading of the notes, not a dropped image.
Not tried: the reporter's client; whether the model stops quoting paths.
Broken by hand: with the note left out, TestClaudePromptSaysToolResultImagesAreAttached is red.
Run at the pushed head (rebased on
|
||
|
|
8e27369bd6 |
browser: record_start and record_stop make a GIF of what an agent did
Asked for in chat ("Magpie Browser MCP 也要支持录屏哦"), like
claude-in-chrome's gif_creator. The browser tool gets two actions:
- record_start: from now on, after each action that can change the page
(not tabs, snapshot, text, console, screenshot, tab_close), the gateway
takes a picture of the session's window, 800 wide, with the action and
what it was done to written in a strip under it (the url, ref, key or
drag; never what was typed).
- record_stop: the frames as an animated GIF, a second a frame and the
last three, each frame after the first only the rectangle that changed.
It is kept an hour behind the image server's tokened files link and
named in FilesMeta, so `magpie tool` saves it; the text says to curl it.
The gateway does it all through browser_screenshot, so every extension
version records and nobody has to reload theirs. At most 300 frames;
a recording nobody stops goes after 30 minutes. A picture an action's
screenshot: true asks for is the same one the frame is made from.
Run on mote (macOS, Chrome for Testing 1234 headless):
- GOOS=darwin/linux/windows go vet ./internal/gateway, gofmt -l: clean.
- MAGPIE_BROWSER_CHROME=... go test ./internal/gateway -count=1
-timeout 45m: ok (794s).
- New: TestBrowserRecordsAGIF (real Chromium: navigate, type, snapshot,
navigate → 3 frames, GIF fetched from the link, 800 wide),
TestBrowserGIFFramesHoldWhatChanged, TestBrowserRecSayKeepsTypedTextOut,
TestBrowserRecordStopWithNothing.
Broken by hand: with browserRecWorth always false, TestBrowserRecordsAGIF
is red ("no frames").
Not tried: a real headful Chrome, Edge or Arc; Windows and Linux browsers.
|
||
|
|
51fa4b7eb0 |
browser: agents work in tabs of their own, behind the user's
The owner: Magpie Browser "老是会代替掉用户正在浏览的网页". A call that
named no tab, from a session with none, took the tab the user had in
front and navigated it away under them. Now:
- such a call opens a new tab of the session's (about:blank), behind the
shown one, in its Magpie tab group, in the window used last, or an
unfocused window of its own when none is open (open() in background.js);
- browser_tabs new / tab_new open behind too; front: true shows the tab,
for when the user asked to see it (background is still taken, and is
now the default);
- a screenshot of a tab behind shows it for the picture, then gives the
window back the tab the user had in front;
- a link with target=_blank clicked in a tab behind: Chrome shows the new
tab and names the user's shown tab as its opener. It is still followed,
grouped in the session's group, and the user's tab is put back in front.
- the tool descriptions say so; the user's tabs are acted in only when a
call names one.
Extension 0.1.4. When an older one connects, the gateway writes this
magpie's over its folders (browserext.Refresh; only folders already
written, never a newer one's: browserext.Older), so the browser picks it
up when it starts again or on the extension's reload in
chrome://extensions. Before, only opening Library's Browser page did. The
dir helpers moved from gui to browserext for it.
Tried and dropped: telling the extension to chrome.runtime.reload()
itself. In Chrome for Testing 1234 on mote an unpacked extension that
calls it never comes back (headless and headful, --load-extension and
CDP Extensions.loadUnpacked, with an onInstalled listener), which would
leave the user with none until a restart.
Run on mote at
|
||
|
|
1e1068c86c |
codex: "Same as the lead" holds every subagent to the lead's model (cleverpigo on X)
cleverpigo (Windows, Codex App 26.1027.6604.0) had Codex's lead on WorkBuddy's DeepSeek-V4.1-Flash, the subagent model on what the GUI called "Same as the lead", and the Routing page still showed a subagent on gpt-5.6-sol through Codex's own sign-in. Cause: that setting, unset, never held a subagent to anything. Since |
||
|
|
50265256ba |
library: a note on a skill or an MCP server, the library's own (youyo.p_10001)
youyo.p_10001 on Discord: with many skills and MCP servers installed, you can't tell what each is for or which to use. A skill has the description its author wrote for models, often in English and about what it does, not why you installed it. An MCP server has nothing but its command and its tool list. So each now takes a note in the user's own words. - Server.Note and Skill.Note in library.json: one line of at most 200 characters, whitespace run together (checkNote), as a hook's description (#2011). A longer one is turned away, not cut. - The server editor has a Note field under the name. A skill's reader (2a19043af's file reader) has one over its files: Save shows once it changes, saves the file being edited with it, and a changed note is asked about before the dialog closes. SkillNote, POST skills/note. - A row shows the note in place of its command or description, so rows keep their height; the tooltip gives the note, then that line. The skills' filter matches notes. - No agent is given a note: not in any agent's MCP entry, a project's file, the MCP router's list or a skill's copied SKILL.md. - A sync carries it (CarriedSkill.Note; a server goes whole), and clearing it is carried too. An older magpie on another computer doesn't know notes: a bundle it writes has none, so a sync from it clears them. The TUI's server editor keeps a note as it was. Run at the pushed head: Run at the pushed head (on origin/main |
||
|
|
a80575cc86 |
library: an MCP server's command wraps, and the editor shows the server as JSON (hema_17384)
hema_17384 on Discord: in Library > MCP servers, the editor's Command
field was one line, so `npx -y universal-db-mcp --type sqlserver --host
... --user sa --password ... --database ...` was cut off, and they asked
to see and edit the server as JSON.
- The command is a box that wraps (lineBox, a textarea of one row that
grows with autosize). It is still one line: Enter saves, Escape
closes, and a newline is a space between words (a shell's \ before it
too, except on Windows, whose lines keep their backslashes). At 390
wide it wraps over several rows; nothing scrolls sideways.
- The editor's head has a Form | JSON switch (the app's segmented
control, not a <select>). JSON is the server as Copy config gives it
for Claude Code: {"mcpServers": {name: {type, command, args, env}}},
or {type, url, headers} for a URL, with ${NAME} references as written.
An edit there is read as a paste is (serversIn) and becomes the form's
at once. JSON that isn't one server's marks the box invalid, says so,
and keeps the dialog from saving or going back to the form, and
counts as unsaved for Cancel. The agents, sync and the startup
timeout and OAuth app stay in the form and are kept as they were.
⌘/Ctrl-Enter saves from the box; a paste into it is the box's, not
the dialog's "paste a README's JSON".
- Strings in en, zh, zh-TW, ja and de.
Run at the pushed head (on top of the note commit, which shares these
files):
Run at the pushed head (on origin/main
|
||
|
|
94d0fbfcd3 |
provider: the ZCode mover installs opencode-zcode-auth 0.1.46 (plugins#676, #678)
ZCode 3.17.2's marketing feed answers empty to the 3.16.3 the plugin
signed in as, so from 11-03 the daily claim found nothing (plugins#676,
jinpy666; rick_49551 on Discord). 0.1.45 (#678, jinpy666) reads the feed
under 3.17.2's version header and drops billing/preview, which the 3.17
client no longer polls. 0.1.46 sends every call as 3.17.2, since the
client says the Start Plan balance judges capability by the real
app_version, and takes a sign-in whose only Start Plan starts later, as
the client's resolveStartPlanBalanceAvailability does, instead of
refusing it as "ended or never started" (sliyrainbow on Discord, whose
account works in the official client). Checked against
zai-org/ZCode@a9fe401. Raising min moves every moved user onto 0.1.46
through keepMovedCurrent.
npm has 0.1.46 as latest (published 2026-11-03T13:41:44Z, plugins
8fc12a3).
Run on mote at this change (on f168dd278; the rebase onto
|
||
|
|
93b1b49047 |
gui tests: searcher-pick waits for the reloaded Settings to be drawn (#1745)
After the reload, the test took the first searcher row it found and
scrolled to it. Settings draws the row when the page opens and again
when load() has the state, so on a busy machine the row was replaced
under scrollIntoViewIfNeeded: "Element is not attached to the DOM"
(webkit zh alone on WSL at
|
||
|
|
f168dd2784 |
gateway: a relayed Messages stream is read in whole events, however its reads are cut (#4868)
anthropicTextCalls (the filter that turns calls a model wrote into its
text into tool_use blocks, on a Messages passthrough that offered tools)
split each read with bytes.SplitAfter on "\n". The piece ending a read
always left a trailing empty slice, which line() took for the blank
line that ends an SSE event. So an upstream that flushed `event:` and
`data:` in separate reads had its events dispatched early: a
content_block_start reached the client without its data ("Unexpected
end of JSON input"), or a held block start was joined to the next
event without a blank line ("Unexpected non-whitespace character after
JSON"). Claude Code retried and gave up; hugemulberry on Discord sees
499s often.
The filter now reads whole events with tidyEvents and eventData, as
responsesTextCalls, phaseTidy and idTidy already do. Because tidyEvents
hands out slices of a buffer the next write reuses, the held block
start and stop are copied (startHeld, stopHeld); nothing else the
filter keeps past an event points into the buffer (pending and held
are strings, m is read within the call).
Siblings: the other SSE writers that cut a read on its last "\n"
(textCallTidy, geminiTextCalls, chatTidy, crTidy, usageSniffer) handle
each line alone and keep no event across lines, so the trailing empty
piece goes on as nothing; phase.go's withData and redact's splitEvent
split a whole event. Only this filter gathered lines into events.
Port of oDaiSuno's fix (7bee8c4d0) and tinytub's regression tests and
doc line (d1a7b02a8); yetone/magpie PRs are collaborators-only. Added
here: TestAnthropicTextCallsSSEChunksKeepFraming feeds each stream in
two reads cut at every byte (LF and CRLF), and
TestAnthropicMessagesSSEChunksKeepFraming cuts the handler's upstream
after each line and adds a request with no tools.
Run on mote at this tree (origin/main
|
||
|
|
bdb856b23c |
icon: the bird is white in macOS 26's clear and tinted icon styles, where it was a dark glass bird on a dark tile
psikent (Discord #feedback, 11-03) sent a dark Launchpad where magpie's icon was a near-black tile with a near-black, glassy bird. AppIcon.icon gave the bird a fill for the light and dark appearances only, so in the Clear and Tinted styles (System Settings, Appearance, Icon & widget style), which draw from the tintable rendition, actool used the light fill: the bird at 0.086 grey, whose luminance is what the system tints. On a dark tile that is dark on dark. The bird now has a "tinted" fill of white, so it takes the tint (or the clear glass) at full brightness. Light and plain Dark are unchanged. Not (a) or (c): the shipped Assets.car (v0.1.2816 in /Applications, same sha as build/darwin/Assets.car) matched icon.json, its dark rendition already a 0.957 bird on the dark grey tile, and the release build (magpie-releases release.yml, `make app`) copies that file. Run at this head, on mote (macOS 27.2, Xcode 27.2): - xcrun actool on build/darwin/AppIcon.icon, as `make icons` runs it; that output is this Assets.car (sha 72fe0ee3). The old one was made by Xcode 26.5; StorageVersion 17 and the 25 renditions are the same, and this Mac's macOS 26.2 assetutil reads it, the tintable group now filled with Color-2 (white). - A test bundle (build/darwin/Info.plist, magpie.icns, the Assets.car) drawn by IconServices for appearances 0-3 x variants 0-3, and by NSWorkspace iconForFile under AppleIconAppearanceTheme RegularLight, RegularDark, ClearLight, ClearDark, TintedLight and TintedDark (mote's setting put back after). The old Assets.car reproduces the report in ClearDark and TintedDark; the new one shows a bright bird in all six, and RegularLight / RegularDark look as before. - Broken by hand: a colour-coded icon (light red, dark green, tinted blue) showed Clear and Tinted draw from the "tinted" fill. Not tried: drawing it on macOS 26 itself (no macOS 26 test box; mote is on 27), and macOS 15 or older, which use the flattened renditions that this change doesn't alter. IconServices' variant 1 with dark appearance (no setting in the six themes maps to it) still draws the light bird on a black tile, as before. |
||
|
|
d16dcba227 |
routing: the stage's agent and magpie columns grow with their words, up to 15% of the stage
refeccd on Discord (#help): on the Routing page, in a full-screen
window, the stage kept the agent and magpie in columns of 124px each, so
the agent read "Claude Desk…" (and its model auto/claude-opus… was cut)
while the group's member rows ran on across the rest of the stage.
The two columns are now fit-content(max(124px, 15%)): as wide as their
words, at least 124px (min-width on .rt-srcs/.rt-hub, dropped again in
the narrow layout), at most 15% of the stage. Where 15% is no more than
124px (a stage up to ~826px) they are exactly as before, so the member
rows lose nothing on a narrow window; the narrow layout (560px and less)
is unchanged. The stage's ResizeObserver now also watches the agents'
and magpie's cards, so the wires follow a card that changes width while
the stage keeps its size (a new agent name or gateway address).
Run, on mote:
- new routing-stage-wide.test.cjs: 60/60 (chromium + webkit, en zh
zh-TW ja de, 2560/1920/1100/800/560/390px): name, model and address
read whole at 1920+, columns 124px..15%, exactly 124px where 15% is
less, wires start and end at the cards, no sideways scroll.
- broken by hand: with the old routing.css the same test is red in all
20 cases at 2560 and 1920px ("Claude Desktop" cut, columns 124/124).
- every routing-*.test.cjs + i18n-keys at 8d7583a78 (this change on
|
||
|
|
4c0c6c02b8 |
plugin: keep idle plugin sign-ins alive in the background (#5080)
A plugin with auth.refresh had a sign-in renewed only when something used the account (a request, its models, usage or check-in) within its refreshLead of expiry. An account left idle past its token's life lapsed. OrcaTerm's WeChat token lives two hours, and after that its refresh answers SESSION_EXPIRED for good, so the user had to sign in again (orinsid, magpie-community/plugins#675). The gateway now renews each such sign-in as it comes due (provider.KeepPluginsSignedIn, started beside KeepPluginsListed): - Due times come from plugin-auth.json through filememo (plugin.RenewAt: expires less the lead the host reckons, now listed as Provider.Renews/RenewLead). Nothing is asked, and no host started, until an account is due. The loop sleeps until the next one, at most 5 minutes, and renews them one after another. - A due sign-in goes through the host's own renewal (host.js keepSignedIn, which shares renewal() with fresh()). It is one at a time per account whoever asks: a request arriving meanwhile waits for the same promise, under the cross-process lock file, through the account's proxy. - Kept: accounts switched on and not marked, of a plugin provider not switched off, hidden (leftAlone) or being moved. - A failed renewal marks nothing. It is held back for 1m, doubling to at most 30m, for that sign-in only. Only the plugin's signIn:"expired" marks it, as at a request. - A plugin can opt out with auth.keepAlive: false. None in the plugins repo needs to: no refresh costs quota, the ones rotating single-use refresh tokens (Cline, Factory, Nous, SenseNova, CodeArts, Qoder, MiniMax) rotate at use already, and kimi-work's reference accounts and Raccoon's desktop reuse never refresh another app's token. Docs: provider-plugins.md "A sign-in nothing uses"; leftAlone list in providers-accounts.md. Run at the pushed head, on mote (mote-run), -tags nogui: - go test -count=1 -timeout 45m ./internal/plugin ./internal/provider ./internal/gateway: ok (109s, 119s, 637s), rebased on origin/main |
||
|
|
b088fd0f09 |
gui: the panel's header icon is named "Open the main window"; a double-click on the Windows tray icon opens it
isaac_bai on Discord missed the "Open magpie" button beside the quick panel's Quit, and was setting the tray click to open the main window just to get back to it; he asked for a double-click on the tray icon. History: the foot's button (#openMain) was taken out on purpose in |
||
|
|
78667e9b77 |
gateway: a request in flight shows its model's context window
packinggoods on Discord: Routing's context window card said "the model's
window isn't known" for a request on remote-magpie/claude/claude-opus-5-5
that was still answering, though the remote magpie's list gives that
model's window. The window was put on a route's prompt only when the
request ended (calibrate at the route's end). A live request always
showed it as unknown, on every provider.
Now the window of the model a try goes to is read as the try goes out.
That is windowOf(c.p, c.model), the same call the route's end makes. It
is kept on the route (Route.window, unexported), and the prompt shows it
while the request is under way (livePrompt). This holds whether the
prompt is read before or after the try starts. A fallback to another
model updates it. At the end the answering model's window still comes
first, as before. Codex turns through magpie's Codex backend now work out
Codex's own window (CodexWindow, else models.dev) when the turn begins,
not when it ends, so they show it live too.
Run at this head (rebased on
|
||
|
|
6cfe786351 |
agent: Codex that can't be joined again isn't connected by its helper models alone (#3868)
why8023: Codex switched off and on again showed 「已接入」 with its subagents' and memories' models back, while its own model never reached magpie. |