1ccacad63281094de8a3372d5a507d38f9969e5c
7507
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7dd965ed22 |
gui: the tray's allowances show without their history, and stay as drawn when nothing changed (#3192)
parkavenue9639 found three things on the tray panel's Allowances tab: - loadQuotas waited for /api/usage/quotas/history (45 days, and a remote magpie's too) in one Promise.all with the allowances, so the skeleton stayed until the curves' history came. The history is now read on its own (loadQuotaHist); the cards are drawn as soon as the allowances are in, and drawn again when a history that differs lands. Of two history reads on their way, the later asked stands. - The window coming back (focus, visibility) ran renderPanelQuota from load() and again when the quotas came, each a rebuild of cards that had not changed (and, while loading, a restart of the skeleton's shimmer). Those two calls are now lazy: the panel is drawn only when something it draws from changed (the allowances, a new history, used or left, the curves' range, folded options, the settings, language, tab, peek, arranging, or the minute, for its clock deadlines). Every other caller draws as before. - renderQuotas went on to build the Usage page's cards, trend and curves in the panel, which never shows that page. It now stops after the panel's own draw there. renderQuotas' local `const mode` (the Used/Left picker) shadowed the page's mode, so the new panel check hit its temporal dead zone; it is `pick` now. The fold check `mode !== "panel"` beside it compared that element, so it was always true; it is dropped, which changes nothing. Tests: panel-quota-lazy.test.cjs, every language, 440 and 360 wide, Chromium and WebKit: with the history held the card is drawn and no skeleton is left; the panel draws no #subscriptionUsage cards; loadBack with the same answers keeps the card and group nodes; a changed allowance is drawn. tray-cell-click waited for the card to be replaced after the window's focus; with the same allowances it is kept now, so it waits for the refresh to finish and checks the highlight on the card as drawn. Red 4 of 4 at the old wait, green with the new one. Run: - panel-quota-lazy at the old app.js: red in every case; at this change 20 of 20. - The whole GUI suite (826 files, --test-concurrency=3, load 40 to 90) at e0abb65ff on |
||
|
|
b0d46ca7fe |
gateway: a routing group's reply has its DSML close and finish mended as a member's own does
喜欢一个人 on Discord later said the model alone works and only their routing group "DeepSeek-V4.1 flash" (several entries of the model, in order, fallback last) breaks from Alma. TestDSMLThroughGroup sends the reporter's bytes through such a group: a native call followed by "\n</||DSML|| calls>" cut inside the full-width pipes, and the whole text-written block, answered by the first member and by the second after the first's 500, on Chat streamed and whole, Responses streamed and whole and Anthropic streamed and whole. Each must give the exec_command call, no DSML, no stray "\n" message, finish tool_calls / stop_reason tool_use, nothing of the refused try, and the tries counted. Alone vs group, read in the code: the tidy is the same. textCallTidy, chatTidy and chatWhole are set up in passthrough, textCallSee in translate and streamTranslated, per try inside attempt; none of them is keyed on the model, provider or group (chatToolNames reads the request's tools), and holdWriter drops a refused try's held bytes and switches on FirstToken only before anything was let through (started()). So the group path leaked exactly what the model path leaked, which the two commits before this fix. What a group does change is what the upstream is asked: a member the catalog marks as not reasoning (quietTo) is sent no reasoning ask in a group only, and a FirstToken group moves on from a slow member. Either can change how the model writes its reply (thinking off), which is a likely reason the reporter saw the residue only through the group; neither bypasses the tidy. Ran: the test at this head, ok. At origin/main |
||
|
|
9a0df964e4 |
gateway: a relayed Chat reply that made calls and ended "stop" ends "tool_calls", streamed and whole
喜欢一个人 on Discord (v0.1.1299, deepseek-v4.1-flash through a relay, usage row stop "stop"): the agent loop ended mid-turn. Their first ask: when a reply calls tools, finish_reason must be tool_calls on every path. Checked each path on origin/main |
||
|
|
d1173c8c16 |
gateway: DeepSeek's calls close left in a reply's text (</||DSML|| calls>) is dropped, after a call the upstream made too
喜欢一个人 on Discord (v0.1.1299, macOS arm64, a Responses client translated to Chat, deepseek-v4.1-flash through a relay, 232312 in / 645 out, stop "stop"): the client got the text "\n</||DSML|| calls>" and the agent loop ended mid-turn. Their history has ||DSML|| calls> 712 times against 133 <||DSML||invoke. Reproduced on origin/main |
||
|
|
c358e76607 |
zcode: on Windows, write where ZCode reads, %HOME% before %USERPROFILE%
Gearclickist on Discord: magpie connects ZCode without an error, but
ZCode on Windows never lists magpie as a provider; on a Mac it does.
ZCode 3.14.3 (the same JS in the Mac and Windows builds, diff -rq of the
extracted app.asar) picks its data folder from setting.json's dataBaseDir,
then ZCODE_DATA_BASE_DIR, then process.env.HOME, and only then
os.homedir() (USERPROFILE). magpie used Go's home, which on Windows is
USERPROFILE. With HOME set (Git Bash, MSYS2, Emacs and the like), ZCode
reads %HOME%\.zcode\v2\provider_config.json and magpie wrote
%USERPROFILE%\.zcode\v2\..., a folder ZCode never opens. On a Mac HOME is
Go's home too, so the two always met.
appdir.ZCodeHome gives %HOME% on Windows when it is set, absolute, and
the folder asked about is USERPROFILE (a folder given on purpose is
kept). The agent target, the ZCode credential and team readers and the
library target use it. ZCode's CLI database stays under USERPROFILE (seen
on Windows below), so the sessions reader is unchanged; its comment says
why.
Run:
- go test ./internal/agent/ -run TestZCode; the new
TestZCodeOnWindowsUsesTheHomeZCodeReads forces zcodeOS=windows with
HOME and USERPROFILE apart. Broken by hand (ZCodeDataIn(home) back in
zcode()): red, "ZCode's folder on Windows with HOME set: .../001/.zcode
... want .../003/.zcode".
- gofmt -l; go vet for darwin, linux (-tags nogui) and windows.
- Windows box, sandbox folders only, HOME and USERPROFILE set apart:
ZCode 3.14.3 for Windows, extracted and started there, kept its logs,
workspace and provider_config.json under HOME\.zcode\v2 and only
cli\db under USERPROFILE. The old magpie.exe's `zcode provider magpie`
wrote profile\.zcode\v2\{config,provider_config}.json (the bug); this
build's wrote home\.zcode\v2\..., beside ZCode's own files, and nothing
under the profile.
- Full suite (go test -timeout 45m ./..., one at a time on the box):
68 packages ok, exit 0, at d87be7f13 and again after rebasing onto
|
||
|
|
b00c82acfa |
masking: each kind is masked, sent with a warning or held back; a Never mask list and Try it (#1977)
Settings › Privacy gets two sections under What to mask:
- When a value is found: Mask, Warn or Block per kind (redactActions;
a kind left out is masked). Warn sends the value as written and records
it with a placeholder nobody remembers, not counted as masked. Block
masks it as before and the gateway answers 400 naming the kind and the
value's hint, never the value, with nothing sent (maskBlocked); the
record is kept as Blocked. The secret kinds come first, the personal
ones behind Show all kinds. A Never mask list (redactAllow) lets a whole
value go as written in any case; a longer value it is part of is masked.
- Try it: POST /api/masking/preview masks a text as a request would
(redact.Preview) and remembers nothing: no placeholder stands for it
afterwards and its values aren't masked later as seen before. The page
shows the vendor's text, what was found and what would be done, and
keeps the text in no storage.
The masking card counts requests held back and values sent as written; a
call whose values only went as written gets an amber badge on Recent calls
and the Routing log. zh, zh-TW, ja and de throughout. Docs: gateway-routing
and gui-shell.
Broken by hand: the new GUI badge assertion fails on the old maskedBadge
(no .warn badge drawn); TestSettingsSaveKeepsWhatItDoesNotSend went red
until the two settings were in its fixture; "{n} held back" turned
i18n-keys red against the routing plugin's "{n} held" and was renamed.
Run at this tree (base origin/main
|
||
|
|
9b0f48612b |
gateway: a plugin's model that searches by itself can be the web searcher
01huadalang (Discord #feedback, 10-20): Settings › Web search offered only Antigravity; Trae's search model couldn't be picked, "可能也有别的模型能搜索 但是识别不到". partSearcher and modelSearches answer false for every provider with an account behind it, so no plugin-served provider was ever offered, and a plugin had no way to say which of its models searches. A plugin now marks such a model with `searches: true` (in its config models or the list its models hook gives). host.js passes it on, plugin.Model carries it, and pluginCatalog makes it WebSearch "native". partSearcher offers a plugin provider with such a model, with those models only, at rank 4 (as Command Code's search models); remoteSearch asks it in plain words, the way it asks Command Code's. A client's own web_search sent to that model still goes to magpie's searcher (searchesModel is unchanged): the plugin's upstream takes no web_search tool. Behaviour change: a marked plugin model ranks ahead of Antigravity and Google (rank 5) when magpie picks the searcher itself. Run: - TestPluginSearchModelIsASearcher (new; a fake plugin's model marked searches answers a weather question with a URL): red on the old code (the picker offers [], want the plugin's fake-search alone), green now. - Broken by hand: host.js without the `searches` passthrough; the test goes red at the picker. - gofmt -l clean; go vet darwin, linux -tags nogui, windows on gateway, plugin, provider, catalog. - set -o pipefail; go test -timeout 45m ./... at this tree: 68 ok, no FAIL. Not tried: the Trae plugin itself. It declares nothing about search yet; marking Trae CN's search_agent there needs a Trae account to try it with, which this machine doesn't have. No GUI files changed. |
||
|
|
6fc532198f |
provider: a CLI's sign-in is asked again only when its files change (#3185)
magpie asked each agent CLI who is signed in once a minute, for as long
as it ran. cursor-agent is a Node program that asks Cursor's servers:
~0.5s of CPU and ~200 MB each time. devin auth status took ~1.9s wall.
On a laptop that is a process spawned every minute, all day.
cliIdentity now takes a mark: a cheap fingerprint of where the CLI keeps
its sign-in (Cursor: authInfo in ~/.cursor/cli-config.json; Devin: a hash
of its credentials file). While the mark reads as it did when the answer
was asked, nobody can have signed in or out, and the CLI is asked again
only after 30 minutes. A changed mark, or one that can't be read, is
asked at once as before. The mark is a file read, never the keychain, so
nothing that can block runs under the identity's lock.
Run:
- TestCLIIdentityAskedOnASignInChange: red with unchanged() forced false
("sign-in unchanged, a minute on: asked 2 times"), green with the fix.
- go test ./internal/provider -run 'CLIIdentity|Cursor|Devin': ok.
- Real use: magpie serve in a sandbox HOME holding copies of the owner's
Devin and Cursor CLI installs and sign-ins, Providers open in WebKit,
every child of serve logged every 0.3s for 5 minutes, caches warm:
origin/main
|
||
|
|
21fb17e4df |
gateway: a remote magpie's list carries only the decision models picked there (GokoShiki)
GokoShiki on Discord: the remote magpie's Gateway page showed the 24 models picked there, and this magpie, with it added as a Remote magpie, listed 51, the extra ones OpenRouter's. /v1/models, asked by another magpie with X-Magpie-Deciders, added provider.Deciders(): every decision model of OpenRouter (and of a plugin, a remote magpie, a Bailian plan), picked or not. This magpie read each one as a model of the remote's, and with no picks of its own exposed them all. It now adds OfferedDeciders, the ones the remote's own group pickers offer since coeo91's report: with picks saved, the picked ones; with none, every one, as before. TestRemoteMagpieListsThePicks runs two magpies: the remote under one HOME with OpenRouter (two chat models and one decision model picked of 40 + 27), DeepSeek (one picked) and a fake Grok plugin; this magpie under another HOME adds it through an httptest server serving the remote's real /v1/models reply, and must expose exactly the remote's picks, plugin and DeepSeek models included. Run at this tree (on origin/main |
||
|
|
a80b1f2208 |
Revert "redact: more file names that read as addresses stay as written (willz on Discord)"
This reverts commit
|
||
|
|
b35e6a8b57 |
redact: more file names that read as addresses stay as written (willz on Discord)
willz (#feedback) asked to tell image names like image@2x.png apart from emails. |
||
|
|
b1a2eec2c1 |
gui: the warm-up reads Codex's effort under the tight GC too
The warm-up's last step reads Codex's per-thread effort from the whole ledger right after the usage page's read, while that page still holds every row (~300 MB live on the owner's history). It ran at GOGC 100, so the heap was let grow to about twice that: a heap profile every 2 s of a cold start showed heapSys going 342 -> 622 MB while live stayed ~300, in the seconds after QueryPage returned. It now runs under underTightGC like the usage read. Footprint (phys_footprint, what Activity Monitor shows), cold start on a clone of the real history (15,176 files), alternating, two runs each: |
||
|
|
b3f5953495 |
routing: an open group's heading looks as every editor's does, not as the Models fold chip
The owner, 10-21: on an opened routing group the heading's space above
differed from below, and its line curved at the ends. The heading had
the class .fold to fold back into its row, and .fold is the Models
head's chip: padding 3px 6px 3px 4px, a 6px radius, the faint colour and
a pill background on hover. On the heading that gave 3px above against
8px below, rounded ends on its bottom line, a dimmed name and a box over
it on hover. It now has its own class (folds), which keeps the pointer
and adds a focus ring; the layout is .editor .ehead's, as on every
other editor.
Run on origin/main
|
||
|
|
083b1c8e7c |
gui: masking's flow draws whole curves in the middle's own pixels
The flow from agents through the shield to vendors drew its ribbons in a 0..100 viewBox stretched to fit, with a pathLength-1 dash left on each after the draw-in, so at most widths they showed as broken dashes, and the nodes stretched as wide as the card. Now the curves are drawn in the middle's real width (again as it is resized), wider and darker by their share, and a draw-in dashes them by their own length and clears it after. Dots run along each curve, grey on the way in and accent after the shield, unless motion is reduced. The nodes are at most 200px and the flow at most 760px, centred; the shield sits in two quiet rings. No gradient. Run: screenshots in Chromium at 1100 and 2000px (light, dark) and WebKit at 640 and 1100px: every curve whole, no page error. |
||
|
|
4042aa4d1d |
usage: a row keeps the strings its chunk shares once, in Shapes
The usage page holds every row of the period at once, and a packed row was 328 bytes, 140 of them 35 string ids. On the owner's real history (364,013 calls in 6,445 chunks) only five of those vary call by call: the error, the request id, the archive, the response id and the message id. The other 30 (agent, provider, model, session, endpoint, client...) repeat for most rows of a chunk: 364k rows have 7,300 distinct sets. So a row keeps those five ids and a Shape, an index into its chunk's Shapes table, which holds every other set once. packedRow is 216 bytes. A snapshot (process-private, nothing on disk) writes the table once after the strings and per row the shape and the five ids, so archives shrink too. block() renames and re-prices per shape, not per row. Same output: |
||
|
|
f5b0157420 |
gateway: a tool Claude Code's tool search loads goes to OpenAI's Responses API where it was loaded (#2660)
Through /v1/messages translated to a Responses provider, every deferred
tool ToolSearch loaded joined the top-level tools on the next request, so
the prompt changed from its first bytes and the cache missed on each load
(maximia's probe: cached tokens dropped on every request after a load).
Now, where Request.LoadedInPlace is set, a deferred tool (defer_loading,
Tool.Deferred) that a tool_result's tool_reference names (toolRefs,
Part.Loads) goes in an {"type":"additional_tools","role":"developer",
"tools":[...]} item right after the run of tool outputs that loaded it,
once, and not in tools (buildResponses). Parallel results and one result
naming several share one item; a tool named again isn't repeated; the
output's text is as before. A history whose loading result is gone
(compaction, edits) puts the tool back in tools: a new prefix, expected.
Scope (loadsInPlace): OpenAI's own API with a key (api.openai.com,
*.api.openai.com), whose tool search guide documents the item and says
its tools load at the end of the context so the cache is kept; and a
provider the user sets with `magpie provider set <id> additional-tools=on`
(Provider.AdditionalTools, kept by the GUI's save like codexAsSent).
Nothing else: xAI answers the item 422 (#350), the ChatGPT backend has
been seen taking it only for Codex's Responses Lite, Azure, plugins and
relays are untried. An upstream that refuses a request holding the item
with a 400/422 naming additional_tools is asked again with every tool in
tools, logged ("turned away additional_tools ... loaded tools go in tools
from now on") and not sent the item again while magpie runs.
Not handled: a tool a tool_addition block in a system message loads (MCP
late tools, the advisor) stays in tools. Not tried against a real
upstream: no OpenAI key or custom Responses relay was used; the item's
shape and position follow OpenAI's docs, and the fixtures follow
maximia's three-request probe (Claude Code 2.1.302) and the
tool_reference shape Claude Code 2.1.306's binary writes.
Tests: TestLoadedToolsKeepThePrefix (top-level tools and instructions
identical across the three requests, each input a prefix of the next),
TestLoadedToolsInOneItem (parallel, batch, repeat), TestLoadedToolsWhereNotTaken
(unsupported upstream unchanged; compacted; non-deferred),
TestLoadsInPlaceScope, TestLoadedToolsThroughTheGateway (off by default on
a relay, on with the flag, refusal retried without the item and not sent
again), TestAdditionalToolsPair (CLI). Broken by hand: with the
buildResponses placement disabled, the first two and the gateway test go
red; with the refusal retry disabled, TestLoadedToolsThroughTheGateway
goes red.
Run at cff7dc67d (this change on
|
||
|
|
52209522a0 |
gui: the masking card is flat and shows the lines the vendor got
The owner found Settings › Privacy's summary card unrefined: a glow behind it, a gradient on the number, a gradient banner for the local model, a gradient area chart and gradient ribbons. It is redrawn in flat colour, with one new part that shows what masking did. - The number is larger (52px, 600), and the days under it are a bar a day on a hairline. Today is in the accent, the other days are a quiet grey and a day with nothing is a dot. Pointing at a bar says its day, as the chart did. - What the vendor saw: the newest lines around masked values, from /api/masking/records?limit=12 (read again with the summary every 15s). Each placeholder is in its kind's colour and says what it stood for while pointed at. On first show a marker is drawn over each one and lifted to the placeholder. It is left out when no line is in memory, as after a restart. - What was kept and Found by are two columns of rows: a dot, a name, a count and a hairline meter of its share. Each row opens its records, as the chips did. The local model's banner is now its row under Found by, with the old sentence as its tooltip. - Agents to vendors are joined by hairlines whose weight and opacity follow their share, around an outlined shield with no glow. - maskSnipTexts and maskPlace are shared with the records view, which drew the same lines and placeholders. masking-records.test.cjs checks the bars (zero days as dots), the rows, the model row, the vendor's line with both placeholders, a placeholder's value on hover, a kind's row opening its records, and that nothing in the card has a gradient. Run at this head (origin/main |
||
|
|
62a3e79b7b |
redact: more file names that read as addresses stay as written (willz on Discord)
willz (#feedback) asked to tell image names like image@2x.png apart from emails. |
||
|
|
82fb0702fc |
gateway: a test run fails when any route writes a held request body in place
A held body is shared, not copied: decodeJSON's strings point into it, and factsOf reads it once for every later reader. Writing it in place would change what those readers see. Nothing guarded that. In the gateway's tests only, checkHeldBody records a held body's hash when it is listed and compares it at its release. TestMain fails the run, naming the body, when one changed (heldWrittenAfter). Production code pays one nil check per hold. No change in allocations (BenchmarkLargeRequest anthropic 45.58 MB/op before and after; the hook is nil outside tests). TestHeldBodyWrittenIsCaught writes one byte of a held body and expects the guard to catch it, and a body left alone not to be reported. Broken by hand (the comparison replaced with `_ = unchanged`): red, "a held body written in place was not caught at its release". The whole gateway package passes with the guard on, so no route writes a held body today. Run (darwin arm64, go1.26.8, sandbox HOME, load 40 to 90 from other sessions' suites): - go test ./... -count=1 -timeout 45m on the series' final tree at |
||
|
|
47ca891b1b |
gateway: a request's capture for Recent calls is copied once, not twice
captureRequestBody wrote the body's first 256 KiB into a bytes.Buffer and then copied the buffer into a string: 512 KiB allocated for every request of 256 KiB or more. It is now one string conversion of the same bytes, and the same truncated flag. BenchmarkLargeRequest, ~2 MB conversation, B/op before → after: anthropic 45.84 → 45.58 MB anthropic-group 57.30 → 57.03 MB chat 36.61 → 36.35 MB responses 46.04 → 45.78 MB In the 60-min soak before ( |
||
|
|
41147956d2 |
gateway: a conversation's turn count and folder come from one parse of it, not one each (yg6888 on X: ~1 GB)
turnOf (affinity), dirOf (the trace's folder) and tellWorkPlace (a plugin's work-place headers) each parsed the whole conversation for a number and a folder. A parse decodes every message and tool output into strings of its own, so a long conversation was decoded twice over on every request for them. In the 60-min soak before ( |
||
|
|
2481750d92 |
gateway: a request body is read once into a slice of its declared length, not grown and copied (yg6888 on X: ~1 GB)
readBoundedRequestBody read every body with io.ReadAll. In Go 1.26 that reads into growing chunks, then copies them into one final slice, so each body was allocated about twice. With a declared Content-Length (and no Content-Encoding to decode), readSized now reads into one slice of that length. The length is the client's word, so it is not trusted: - the first allocation is at most 1 MiB (sizedReadFirst); the slice doubles from there, up to the declared length; - a client that declares 512 MB and sends 5 bytes costs at most sizedReadFirst; - a body longer than declared is read whole, still under the body limit (the LimitReader around it); - with no length, or an encoded body, it is io.ReadAll as before. BenchmarkLargeRequest, ~2 MB conversation, B/op before → after: anthropic 55.37 → 53.81 MB anthropic-group 66.82 → 65.26 MB chat 44.83 → 43.27 MB responses 55.37 → 53.81 MB 1.56 MB less per request, about 0.8× the body. In the 60-min soak before ( |
||
|
|
5090f3215b |
gateway: a call dropped from Recent calls is let go, not kept in the ring's array (yg6888 on X: ~1 GB)
record kept the last 40 calls by re-slicing the oldest off. The dropped call stayed in the backing array, request and response captures and all (up to 256 KiB each), until an append outgrew the array and copied the ring to one about twice its size. So up to ~80 calls' bodies were kept for a page that shows 40. keepRecent now moves the last 39 down in place, clears the tail and appends, so the array holds exactly the calls shown. Every reader of s.recent copies what it needs under the lock, so moving the ring in place changes nothing they see. Measured, before ( |
||
|
|
20444bb05d |
gateway: the large-request benchmark ends each request's context, as a server does
BenchmarkLargeRequest served httptest.NewRequest's context.Background, which never ends. holdBody lists only a body whose context can end, so the benchmark measured a gateway that never held a body: decodeJSON copied every value, and nothing kept for a body's later readers was ever kept. A served request's context ends when it is answered; each request now gets one that does. Same tree, -benchmem, -benchtime=30x, ~2 MB conversation (B/op): anthropic 61.27 MB with Background, 55.37 MB with an ending context chat 52.64 MB 44.83 MB responses 75.28 MB 55.37 MB The rest of this series is measured with it. Run (darwin arm64, go1.26.8, sandbox HOME, load 40 to 90 from other sessions' suites): - go test ./... -count=1 -timeout 45m on the series' final tree at |
||
|
|
d3db461bbb |
redact: the local model's secrets leave UUIDs, digests and paths, and client_metadata goes as written
The owner's masking records showed Codex's turn metadata with every id as
{{SECRET_…}}: installation_id, session_id, turn_id, window_id,
context_window_id, root_turn_id, and a skill's file path in the
instructions. The local model (OpenAI's Privacy Filter) labels a UUID a
secret: run on Codex's x-codex-turn-metadata it took each id, and on a
log it took a request id and "sha256 9b74…". The vendor and magpie's own
sessions match a turn by those ids, so masking them can break what
depends on them, and hides nothing worth hiding.
- modelTakes: a secret the model finds is not taken when it names a
thing (namesThing): a UUID, with window_id's ":0" after it too; a
digest with its algorithm's name; a file's path. A password or a key
it finds is still masked, and the rules' secrets (sk-…, password=…,
API_KEY: …) are unchanged.
- client_metadata is in defKeys: the client's ids, which no model
reads, go as written, as tools and stream_options do.
docs/subsystems/gateway-routing.md says both.
TestModelSecretIsNoID uses what the real model labelled "secret" on these
texts (pf-serve with the q8 model, run here): the UUIDs, the request id,
the sha256 digest, plus the reporter's path; the password and the
32-hex key beside them are still masked. Broken by hand: without
namesThing 5 values are masked, without client_metadata in defKeys a
user word in it is.
Run:
- At 3fff6c011 (on origin/main
|
||
|
|
1414705159 |
gui: the warm-up's read of the whole usage history runs under GOGC 25, so a cold start peaks ~130 MB lower
The warm-up's last big read, the Usage page's QueryPage over all time,
holds every row of the history unpacked at once (129 MB of rows, 271 MB
live at that moment for this history), and at Go's default GOGC the heap
grows to twice what is live before collecting: Activity Monitor's
footprint peaked at 555-587 MB there, on a magpie that rests at ~200 MB
once it is done. underTightGC lets the heap grow by a quarter during that
read and puts back what was set; a GOGC the user set lower, or off, is
kept. Holding fewer rows at once needs the page built in passes over
packed chunks (rowRef points into unpacked ones), which is the next step.
The whole warm-up under GOGC 25 gave the same peak for ~11 s more CPU, so
only that read is.
Measured with startheap-runs/fp.sh: cold start (calls and sessions caches
deleted) of a 6,437-file history, phys_footprint sampled every 2 s and
footprint's own phys_footprint_peak at the end, run until the caches stop
growing for 30 s; every run wrote the same 6,437 files / 70,069,451 bytes.
Machine at load ~85-140 from other sessions.
before (
|
||
|
|
1bd99194ea |
provider: Claude Code stays listed, signed out, when every saved account's sign-in is gone
LeeHom on Discord: two Claude Pro accounts vanished from Providers, and
signing one in again showed the other as "needs sign in again". While
Claude Code is signed out, the claude provider is built on
claudeStandIn's account. claudeStandIn skips an account whose sign-in
Claude Code let go of (claudeLoggedOut's claudeLogoutLapse) or that is
still Held. With every saved account like that, it returned "", no claude
provider was made, and the subscription and both accounts left the GUI,
the TUI and `magpie providers` at once.
claudeStandInAccount and Logins now ask claudeListed: the stand-in, else
the signed-out account seen last. A Held account is never listed this way,
because the sign-in Claude Code left on disk would then be served
(TestClaudeSignedOut still holds). The listed account's token still fails
with the lapse reason (claudeSavedDir), so nothing is served on it.
claudeStandIn itself is unchanged, since addLogin and logins_on rely on
it.
The app's row already said "{user} is signed out" when every login in use
had lapsed. Provider.SignedOut is that rule in Go. With it, `magpie
providers` says "○ <user> is signed out · sign in again" and the TUI says
"○ <user> is signed out", instead of a green "signed in". The CLI's key
column moved into keyColumn so it can be tested. The providers-accounts
doc row says this.
Tests:
- TestClaudeAllSignedOutStaysListed: signed in, a second account
logout-lapsed, then Claude Code signed out. It fails on the old code
("Claude Code left the Providers list with every account signed out:
false") and with SignedOut returning false (both broken by hand).
- TestProvidersSaySignedOut, in cli and tui: a signed-out account reads
as signed out and a signed-in one still reads as signed in.
Run: gofmt -l clean; go vet ./... (darwin), GOOS=linux go vet -tags
nogui ./..., GOOS=windows go vet ./...; go build for all three.
Then go test -timeout 45m ./... under a sandbox HOME at base
|
||
|
|
d771138c41 |
provider: WorkBuddy's mover min is 0.1.29, which sends a refused system prompt again as the user's instructions
Wing on Discord (10-21) got 400 11128 "Illegal API invocation from an unapproved channel" from WorkBuddy with an agent whose lines the plugin didn't reword. WorkBuddy checks only system and assistant messages, against lines it knows. Since 0.1.29 (magpie-community/plugins af360a5), a chat it refuses that way is sent once more with its system prompt moved into the first user message, inside <instructions> tags, and WorkBuddy's default system prompt in its place. The refusal still rests no account, as since |
||
|
|
c627652e9a |
settings: lightweight mode is off for a user who never chose
The owner, 10-21: "要默认关闭「轻量模式」,不然太卡了". With it on, the window is made again and its page loaded again on every opening, which is slow. |
||
|
|
1b9b97f8db |
gui: a provider's dialog grows out of its icon and name, as an add sheet tile's does
The owner, 10-21: the provider editor's opening was stiff ("太生硬"), and
the add sheet's, opening a vendor's tile, is the one to follow. Both run
through openModal's morph, but a tile is narrower than the dialog, so the
dialog starts shrunk to it (scale ~.4) and zooms out; a provider row is
wider than the dialog, so the scale stayed 1 and the dialog opened as a
full-size strip widening over the row, its text at full size from the
first frame.
A provider row is now measured as a tile: from its left edge to where
its name and host line's words end (rowOwnRect, the text nodes' extents;
a range over the block spans its whole width), the row's height. The
dialog grows out of that and folds back into it, as a tile's does.
Run on origin/main
|
||
|
|
3c38fe5c99 |
agent: Zoo Code (VS Code) through its autoImportSettingsPath (wani on Discord)
wani on Discord (#feedback) asked for Zoo Code (zoocode.dev), a fork of Roo Code for VS Code and JetBrains. Route: Zoo Code keeps its provider profiles in VS Code's SecretStorage, which magpie can't write. The one file it reads is the one its zoo-code.autoImportSettingsPath setting names. On every activation (src/utils/autoImportSettings.ts, Zoo Code 3.90.0) it imports that file as Settings → Import does (importSettingsFromPath). magpie writes <User>/globalStorage/zoocodeorganization.zoo-code/settings/magpie-import.json with one profile, "magpie": apiProvider openai on the gateway's /v1 Chat Completions, key magpie-zoo-code, the chosen model, and an openAiCustomModelInfo built from the catalog (contextWindow, else Zoo's own 128000 default; maxTokens only when an output limit is known). It points the setting at that file in the default settings.json and in each VS Code profile's. A value the user set themselves is stashed and restored by Disconnect. The file sits outside magpie's folder so that a sync keeps an address the user moved (kept.away skips magpie's own folder). Requests say "ZooCode/<version>", and usage names them zoo-code. Limits (also in docs/reference.md → Zoo Code): - Zoo reads the file only at start: the notice asks for Developer: Reload Window. - While connected, each start switches Zoo back to the magpie profile. - Disconnect stops the import but can't delete the imported profile from SecretStorage. The user switches away from it or deletes it in Zoo. - VS Code Stable only. JetBrains is not wired. Zoo Code for JetBrains runs the extension in its own extension host, which is handed an empty configuration on every start (RPCManager.startInitialize in Zoo-Code-JetBrains), so the setting never reaches it. Its secrets sit in ~/.zoo-code/secrets.json, an internal store with no lock and no documented format. Neither is a clean route. Tests (internal/agent/zoocode_test.go): - TestZooCode: connect, model switch, a stale key that Check reports and Sync fixes, and disconnect putting the user's own import path back byte for byte with the file removed. - TestZooCodeFresh and TestZooCodeProfiles: VS Code profiles, including one made after connecting. - TestZooCodeDetectAndUA: Roo alone is not detected; ZooCode/3.90.0 maps to zoo-code. Broken by hand (the restore disabled): TestZooCode and TestZooCodeProfiles went red. The generated file was checked with bun against Zoo's own zod schemas (providerSettingsWithIdSchema, isProviderName; zod 4.6.7 from its repo): valid, every field kept, current profile in apiConfigs. Run, set -o pipefail, GOMODCACHE pinned, sandbox HOME: - First full run, with this change on |
||
|
|
049040283e |
codex: a searched conversation under Codex's web.run isn't sent the hosted web_search beside it (Savin on Discord)
Savin (#help, magpie 0.1.1296, Codex 0.163.0-alpha.10.2, signed in with ChatGPT): the turn failed with the ChatGPT backend's "a single request can't contain both a client-declared function web.run and the hosted tool web_search". Who adds which: - web.run is Codex's own. codex-rs/ext/web-search (tool.rs) declares it as a function "run" in the "web" namespace, and spec_plan.rs's hosted_model_tool_specs leaves the hosted web_search out whenever web.run is registered: on a Responses Lite model (whose requests take no hosted tools at all), or with the standalone_web_search feature on. Codex never sends both itself. - The hosted web_search was magpie's. provider.DeclareSearch (#1270) adds the cached-only {"type":"web_search","external_web_access":false} to any ChatGPT-bound request whose input replays a web_search_call without declaring search. declaresSearch looked only for a web_search* type, so a conversation that had searched with the hosted tool and went on under web.run (a Lite model, a newer Codex, or magpie's own searcher's web_search_call items) got web_search added beside web.run, in the additional_tools item for Lite or in the tools. The backend then refused the turn. What changed: declaresSearch counts web.run as the conversation's search. It matches the namespace "web" holding a function "run", and a function named "web.run". DeclareSearch then leaves the body as Codex sent it. This covers both routes that call it: codexBody (a ChatGPT account in magpie) and codexUpstreamOn (Codex's own sign-in relayed). Nothing the client declared is dropped. web.run is the tool the backend serves this client (through /alpha/search), so magpie no longer adds the tool that conflicts with it. A namespace other than "web" with a "run" function still gets web_search declared. Not verified: whether the ChatGPT backend accepts a replayed web_search_call under web.run with no hosted tool. That is the request the official Codex client sends to it directly. It was not probed on a real account, and the test fake assumes it is accepted. Tests: - TestDeclareSearch: new cases cover web.run in Lite's additional_tools, web.run among the tools, the flat "web.run" function, and another namespace's run. - TestSearchedConversationUnderWebRun: protectedSearch now refuses a request that carries both tools, with Savin's error. The test covers Lite on Codex's sign-in (relayed byte for byte) and two turns on a ChatGPT account (Lite and tools). - On |
||
|
|
e68a0b1db5 |
sessions: a prompt's title reads only as far as it keeps, not through a regexp and runes of the whole prompt
title collapsed white space with regexp's \s+ over the whole prompt and
then made runes of all of it to cut at 160. A pasted file as the prompt
went through both whole: sessions.title was 0.45 GB of a cold start's
first 2 minutes (cxPrompt 334 MB, ccPrompt 112 MB). It now collapses and
counts in one pass and stops at 160 characters, then looks only for
whether anything but space follows. The result is the same: each run of
\t \n \f \r and space one space, Unicode space trimmed at both ends, a
byte not UTF-8 kept as it was in a short title and U+FFFD in a cut one.
The regexp `space` had no other user and is gone.
Run:
- TestTitleAsBefore (new): equal to the old code on the edge cases
(159/160/161 characters, \v and NBSP and U+0085 at the ends, invalid
bytes, CJK) and on 20,000 random strings of those runes.
- TestTitleOfALongPromptAllocatesItsTitle (new, a ~900 KB prompt): red
with title pointed back at the old code ("50 allocations"); green now,
at most 8 allocations and 4 KB.
- go test ./internal/sessions/ ok, and with -race ok.
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui ok.
|
||
|
|
4c0afc26d7 |
sessions: scan buffers and zstd decoders are kept on a small shelf across garbage collections, let go after 10 s unused
The line readers, long-line buffers and zstd decoders scans use were kept
only in sync.Pools, and a pool lets what it holds go at every second
collection. A cold start collects about once a second (155 GCs in its
first 2 minutes), so the pools were mostly empty when asked. A probe
build counted, in those 2 minutes: 611 new 1 MiB line readers, 205
long-line buffers taken from an empty pool (114 more from one too small,
833 MB in all) and 281 new zstd decoders (~3 MiB each).
A shelf keeps up to 4 of each (per line-reader size class; long lines up
to 4 MiB, longer ones still go to the pool), takes before the pool and
gives back before it, and lets everything go once nothing was taken or
given back for 10 s, so an idle magpie holds none of it. A full long-line
shelf keeps the larger buffer.
Run:
- TestLineReaderKeptAcrossCollections, TestLongLineKeptAcrossCollections
(new): with the shelves' takes removed both are red ("a 1 MiB line
reader was made again after three collections", "a 2 MiB long-line
buffer ..."); green now. TestShelfFullKeepsTheLarger,
TestShelfLetsGoWhenIdle (new, waits for the state, 10 s bar).
- go test ./internal/sessions/ ok; -race ok (the first try raced on a
test writing the idle time as a global under a live timer; it is a
field of the shelf now); -race -count=20 on the new tests ok.
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui ok.
- Cold start in a sandbox HOME (startheap-home, calls and sessions
caches removed), serve --web, run until the caches stop growing; both
wrote the same 6,437 files, 70,069,451 bytes. With this and the two
commits before (objectEnd, prefixHash), two runs each, alternating:
old: 12.57 / 11.92 GB allocated, 145 / 149 GCs, CPU 2:01 / 1:55,
settled at 213 / 192 s
new: 7.38 / 7.23 GB allocated, 85 / 87 GCs, CPU 1:52 / 1:50,
settled at 191 / 161 s
RSS at the end is unchanged (714-748 MB): the peak is the warm-up
listing holding every row, not these buffers.
|
||
|
|
002b4eb080 |
sessions: prefixHash reads into one pooled buffer instead of io.CopyN's
io.CopyN made a new buffer for every call, and for each of the 16
samples of a long file (64 KB a call). Every session and call log is
hashed this way on a cold start: io.copyBuffer via prefixHash was 0.78 GB
of 11.57 GB allocated in the first 2 minutes. It now reads into a pooled
64 KB array: ReadFull for a short prefix, ReadAt for each sample. A
sample short of its window is still unknown (""), as CopyN's error was.
The hash is byte-for-byte the same, so stored sample-v1 hashes still
match.
Run:
- TestPrefixHashUnchangedAndUnbuffered (new): equal to the old
CopyN code at 0, 1, 4095, 4096, 65535, 65536, 65537, 1 MiB and 3 MiB,
and "" past the end as before; with prefixHash pointed back at the old
code it is red, "hashing a long log allocated 65 KB"; green now (under
-race the pool drops some puts, 13 KB, so the bar is 24 KB).
- go test ./internal/sessions/ with -race ok; -race -count=5 on the new
test ok.
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui ok.
|
||
|
|
a0f3b33b1f |
sessions: a Claude reply's tool blocks and usage are decoded from their object, not by a decoder copying the rest of the line
ccTools and ccReply's usage each opened a json.Decoder over the rest of the line, and the decoder copies what it reads ahead into its own buffer. A long tool input was copied once per tool block and once for usage. In a cold-start heap profile (11.57 GB allocated in the first 2 minutes) this was the largest site: Decoder.refill, 1.6 GB, via ccReply/ccTools. objectEnd now finds the end of the object (brackets outside strings) and json.Unmarshal decodes only those bytes, which still checks them. Run: - TestClaudeReplyDecodesWithoutCopyingTheLine (new; a 1 MiB tool input plus a Skill tool through claudeLine): red on the old decoder path, "a 1024 KB reply allocated 4100 KB to read"; green now, under 256 KB. - TestObjectEnd (new): nesting, braces and escapes in strings, unterminated, a leading space, empty. - go test ./internal/sessions/ ok, and with -race ok (79s); -race -count=5 on the new tests ok. - gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui ok. |
||
|
|
c79400556c |
agent: a Claude model on Bedrock runs to its own window in Claude Code, not 272K
划船不靠桨 on Discord (0.1.1306) asked why magpie sets CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000 for a 1M model. writeCompact already skips the working window for Anthropic's Claude models and for routing groups made only of them (provider.ClaudeGroup). But the agent package's claudeModel only knew a name that starts with "claude", so a 1M Claude model listed under Amazon Bedrock's name (us.anthropic.claude-opus-…[1m]) was held to 272K, while a group of the same model ran to 1M. claudeModel now asks provider.ClaudeModel, which takes the vendor prefix off first. The reporter's own setup (a deepseek-v4-flash auto routing group of WorkBuddy, Qoder and a newapi relay) is not this bug. A probe in a sandbox HOME showed 272000 for group/auto-deepseek-v4-flash, its [1m] form and auto/deepseek-v4-flash, the group listed at its largest member's 1048576. That is settings.WorkingWindow, the default for any non-Claude model or mixed group over 272K ( |
||
|
|
e656888867 |
library: Library → Instructions gives Devin its global AGENTS.md (#3151, eqe365 on Discord)
eqe365 on Discord (#3151): Devin CLI reads AGENTS.md, but Library →
Instructions listed Devin as keeping no user-wide instructions file.
Devin's target had Skills and MCP and no Instructions.
Source: the docs Devin CLI 3000.11.92 ships with it,
share/devin/docs/extensibility/rules.mdx ("Rules & AGENTS.md" → Global
Rules). It reads global rules from ~/.config/devin/AGENTS.md
(%APPDATA%\devin\AGENTS.md on Windows) at the start of every session, and
the singular AGENT.md there too. Devin's folder (a.Dir) is already that
folder, so Instructions is AGENTS.md there, or AGENT.md when only that
one exists (firstThere). The GUI is data-driven and needs no change.
Test: TestDevinInstructions (internal/library/agent_skills_test.go)
checks:
- the target is AGENTS.md before the file exists;
- Save writes the shared block after the user's own text;
- with only AGENT.md present, that file is the target.
With targets.go reverted it fails: "Devin's instructions: "", want
.../.config/devin/AGENTS.md before the file is there".
Run with this change on origin/main
|
||
|
|
b855cfee9e |
redact: a file named like an address (…@2x.jpg) is not masked as an email (#3029)
vdxz on Pi with personal data masked: /Users/…/Pictures/261020_14-16-11@2x.jpg
went to the model as /Users/…/Pictures/{{EMAIL_…}}, and Pi could no longer
read the file. A Mac saves an image at twice its size with @2x before its
extension, which the EMAIL rule reads as user@2x.jpg.
realEmail leaves an address whose last label is a file extension no
top-level domain has (fileExt: jpg, png, gif, webp, svg, heic, pdf and
the like; py, md, sh, zip and mov are domains and stay out of it). The
local model's EMAIL spans pass the same check now (modelTakes), so it
can't mask the name the rule leaves. An address beside the file's name
is still masked.
TestFileNameIsNoEmail uses the reporter's path. Broken by hand: with
redact.go as on main the rule's half fails, with model.go as on main the
model's half fails.
Run at this head (on the #3143/#3144 commit, origin/main
|
||
|
|
88119d4f67 |
redact: Codex's tool server names, stream_options and snake_case words go as written (#3143, #3144)
Two reports from hibaliqya-yonma (v0.1.1306, Codex Desktop through
/backend-api/codex), each a 400 on every request until masking was
turned down:
- #3143: a user's word that is part of an MCP server's name went into a
Responses function_call's namespace as mcp__{{TERM_…}}. Codex checks a
namespace against ^[a-zA-Z0-9_-]+$, and the call is replayed every
turn. namespace is kept as name is, and so are the server's name in
its siblings: a Responses mcp_call's server_label, Anthropic's
mcp_tool_use server_name.
- #3144: the local model took stream_options.reasoning_summary_delivery,
"sequential_cutoff", for a name. stream_options is a request setting
now (defKeys, with reasoning and text), and the model's name is never
a snake_case word (snakeWord), wherever it is, so an enum or an
identifier in a tool's arguments or in code is not taken either.
The same word in the user's own message is still masked, and a name
beside it still is. docs/subsystems/gateway-routing.md says both.
Tests from the reporter's bodies: TestMaskJSONKeepsReasoningSummaryDelivery,
TestMaskJSONKeepsToolServerNames (namespace, server_label, server_name),
TestModelTakesNoSnakeWord. Broken by hand: with json.go and model.go as
on main, all three fail; with the change they pass.
Run at this head (origin/main
|
||
|
|
ba319a7587 |
gateway: the lone tool_choice none goes to the Grok plugin only (#3110)
|
||
|
|
19527ca8dd |
gateway: tools turned off with none declared reach a plugin as tool_choice none (#3110)
Cause: buildResponses wrote tool_choice only inside its tools block, so a
Chat "none", Anthropic {"type":"none"} or Gemini NONE with no tools was
dropped on the way to Responses. A provider plugin that adds a
server-side tool (Grok's x_search, plugins PR #263) couldn't tell
"tools off" from "no choice". The other builders (Chat, Anthropic,
Gemini, Code Assist) send no tool choice without tools, which is what
their vendors accept (OpenAI Chat refuses a lone tool_choice), so they
are unchanged.
Fix:
- buildResponses keeps a lone "none" (only "none"; "" and "auto"
still go unsaid).
- forwardTranslated strips it again for every non-plugin upstream, and
for a plugin on api.x.ai or Copilot (refusesLoneToolChoice, the #378
rule now shared with passthrough). A vendor never sees it.
- The grok plugin's body shaping (grokPluginBody) keeps a lone "none";
the built-in's grokBody still drops it. grok plugin 0.1.18
(magpie-community/plugins aee6b9d, on npm) drops any lone tool_choice
itself before Grok, so the mover's min goes 0.1.17 -> 0.1.18.
Run at this commit (worktree on
|
||
|
|
efd1b697e4 |
sessions: a cached file's calls are read into a slice made for them
loadCalls appended each decoded patch to a nil slice, so every cached
file's calls grew through append's steps. In a warm start's 30s
alloc_space profile (sandbox HOME, ~380k calls) that append was 509 MB,
the largest single site. Each frame now grows the slice once by its
patch count (slices.Grow), which a frame of new calls fills exactly.
TestLoadedCallsAreSizedOnce: 3000 cached calls came back in a slice of
3246 on the old code (red, run with the change stashed); 3006 now, the
allocator's size class. It also reads back a second appended frame.
go test -tags nogui ./internal/sessions/ ./internal/usage/: ok.
At 8b48dc5d6 (this commit and the two beside it, on
|
||
|
|
80d32fd609 |
usage: a Claude Code call skips the desktop-root path arithmetic
sessionResolver.desktopIdentity ran filepath.Rel and strings.Split
against every desktop root for every claude call, though only a file
under a root's local-agent-mode-sessions can name a desktop identity.
In a warm start's heap profile (sandbox HOME, ~380k calls) that was
178 MB from Rel and 98 MB from Split in the first 30s, about a fifth
of what gui.warmUp's first Requests read allocated. A path without the
folder name can't produce a Rel whose first segment is that name, so
the guard is exact.
TestDesktopIdentityOfCLICallAllocatesNothing: 6 allocs per call on the
old code (red, run with the change stashed), 0 now.
go test -tags nogui ./internal/usage/: ok, TestDesktopSessionAccountMetadata
unchanged.
At 8b48dc5d6 (this commit and the two beside it, on
|
||
|
|
16d20c0b3d |
usage: a packed block keeps its compressed bytes, not S2's worst-case buffer
s2.Encode makes its output MaxEncodedLen(len(src)) long, more than the
rows' own bytes, and pack kept the archive as a slice of it
(slices.Clip trims the capacity, not the allocation). Every cached
session block and every gateway log block (log_index.go) so held its
whole uncompressed size plus S2's slack, while Bytes counted only the
compressed length, so the cache budget undercounted it too. pack now
encodes into pooled scratch (the rows' bytes and S2's output) and
copies the archive out at its own length.
Measured on a sandbox HOME (a clone of a 23 GB Codex + Claude Code
history, ~380k calls), magpie serve --web, warm call caches, heap
profile from /v1/magpie/heap:
- at rest (2 min): s2.Encode's archives 17.2 MB -> 9.2 MB (slices.Clone)
- at the warm-up's peak (6 s): archives 45.3 MB -> 30.6 MB
- liveHeap at 30 s 96.1 MB -> 90.3 MB, footprint 213 MB -> 203 MB
TestPackedArchiveHoldsOnlyItsBytes packs 100 blocks of 2000 rows and
measures what stays reachable after a collection. On the old pack it
fails: "100 packed blocks hold 16035 KB for 3887 KB of archives"
(3 of 3 runs); with the change it passes, and blocks packed through
the same scratch read back their own rows.
At 8b48dc5d6 (this commit and the two beside it, on
|
||
|
|
a00900d642 |
provider: ZCode's mover installs plugin 0.1.20, a team's plan beside the account's own (plugins #285)
An account with a GLM Coding Plan of its own and a seat on a team's could
only reach its own plan through the plugin. zcode 0.1.20 (plugins
d87dd8f, on npm) adds "ZCode: a team's GLM Coding Plan", which signs in
to the team seat as an account of its own, "<email> (team)". Raising the
min lets keepMovedCurrent bring every moved user to it.
Run at the parent
|
||
|
|
5fadf6aceb |
gui: Settings' gateway row is titled an address, and says only its port is typed here (Chicring on Discord)
Chicring: Settings showed "网关端口" (gateway port), but the row showed
MAGPIE_ADDR's host:port.
What the field takes, from the code: renderPort posts to
/api/settings/port, and setPort (internal/gui/port.go) accepts only a port
from 1024 to 65535 (settings.CheckPort). The gateway listens on that port,
on 127.0.0.1, or on 0.0.0.0 while shared on the LAN. When MAGPIE_ADDR is
set, it is the whole host:port and comes first. The row then shows its
value and is disabled. So the row is the gateway's address, but only its
port is typed here; it isn't a second way to write MAGPIE_ADDR.
The row is renamed in every language: Gateway address / 网关地址 / 閘道位址 /
ゲートウェイのアドレス / Adresse des Zugangspunkts. The new hint says "Only
the port is set here, 1024 to 65535; MAGPIE_ADDR=host:port sets the whole
address instead. Agents magpie connected move with it. Now {url}". With
MAGPIE_ADDR set, the hint says "MAGPIE_ADDR={addr} sets the gateway's whole
address, host:port: unset it to set the port here". The CLI help (cpu,
healthcheck, heap, quota, statusline) and setPort's comment named
"Settings' Gateway port". They now say "the port in Settings' Gateway
address".
Test: gateway-port.test.cjs pins the new name and hints in en and zh. With
MAGPIE_ADDR set, it now also checks that the field shows 127.0.0.1:3426
and that the row's name and aria-label say the address. gui-zh-tw, gui-ja,
gui-de and i18n-keys cover the other languages. Broken by hand: on the old
app.js it is red, "not ok 1 - en expected: 'Gateway address' actual:
'Gateway port'", and zh red against '网关地址'.
What was run. The whole suites ran at dcf7eeae3, which was these two commits
on origin/main
|
||
|
|
4bea86d0a3 |
gui: a provider that asks its own decision models (OpenRouter, Ollama …) shows System One's endpoint, not Jev's (Outvi V on Discord)
Outvi V added OpenRouter and its editor named the decision address field "Jev 端点". The hint gave Cloudflare's …/accounts/<account id>/ai/run as the example. Cause: the title was "System One endpoint" only for a decide-only preset whose name had no "jev". Every preset that also serves conversations got "Jev endpoint". The hint gave Cloudflare's address to any preset without a workspace ID. The placeholder was already the provider's own Decide URL. Fix: only Jev's own decide-only presets (TypeSafe Jev, Jev · Vercel AI Gateway, Cloudflare Workers AI · Jev) keep the Jev title and the Cloudflare hint. Every other provider shows "System One endpoint" with a hint of its own: "The address its decision models are asked at, POST …/systemone under it". Every preset that reaches this path is covered: openrouter, opencode-zen, ollama-cloud, bailian-token-plan, ollama, omlx and mlx-serve, plus the decide-only bailian-decision and qwen-decision, which already had the right title. The new string is in zh, zh-TW, ja and de. Test: decide-endpoint-label.test.cjs opens each of the ten presets with a Decide URL from the add sheet, and edits a saved OpenRouter, in en, zh, zh-TW, ja and de. The three Jev presets must show Jev's title and the Cloudflare hint. The rest must show System One's title and their own hint, with no Cloudflare or Jev in it. The saved OpenRouter's placeholder must be https://openrouter.ai/api/v1. Broken by hand: - The old app.js line: red in every language, for example "expected: 'System One endpoint' actual: 'Jev endpoint'" and zh "'System One 端点' vs 'Jev 端点'". - Cloudflare's hint forced onto every provider: red, "expected: 'The address its decision models are asked at …' actual: \"The address Jev is asked at; …Cloudflare's…\"". At this commit alone, decide-endpoint-label, system-one, remote-magpie, i18n-keys, gui-zh-tw, gui-ja and gui-de passed in both engines: "# tests 42 # pass 42 # fail 0". What was run. The whole suites ran at dcf7eeae3, which was these two commits on origin/main |
||
|
|
5c557c793c |
usage: the allowance cards come in the Providers page's order (Zhenbao TONG on Discord)
Reported: Zhenbao TONG moved a provider on the Providers page, and the
tray panel's Allowances tab kept the old order.
Changed: provider.InProviderOrder(qs) (internal/provider/quotas.go) sorts
a copy of the quota cards, stably, by the provider's place in All().
Providers it doesn't know go last. Used by /api/quotas's two routes
(internal/gui/usage.go) and the TUI (internal/tui/pages.go). The app.js
comment says the order now comes from the server.
Test: TestQuotaCardsInProviderOrder (quotas_order_test.go). Broken by
hand:
- InProviderOrder as the identity: "as added: [a/a1 remote:x/r c/c1
b/pro a/a2 c/$1]".
- sorting without the clone: "Quotas' list was sorted in place".
Not covered: the /api/quotas wiring has no test beyond the function's
unit test.
Run, go1.26.8 darwin/arm64, sandbox HOME, private GOCACHE:
At this stack on origin/main
|
||
|
|
0084291888 |
gui: Hide accounts hides them in the whole window, Providers and its editor too (Zhenbao TONG on Discord)
Reported: Zhenbao TONG turned on Hide accounts to take a screenshot. The Providers page and its editor still showed account emails, because the mask covered only the Routing and Usage views. Changed (internal/gui/assets/app.js): the mask's root is body in every mode, so every page and sheet of the window is masked. It is turned on from #rtMask and #usageMask as before, and the panel has none. mask(root) takes a root, and the MutationObserver masks again only the roots that changed, not the whole body. Test: internal/gui/tests/window-mask.test.cjs, with Hide accounts on, on Providers, its editor and the other pages. 5 languages x widths 1000 and 420 x chromium and webkit. Broken by hand (the old app.js mask): chromium en and zh at 1000 red, waitForFunction timed out on `#view-providers .pii`. Run, go1.26.8 darwin/arm64, sandbox HOME, private GOCACHE: At this stack on origin/main |