dccfefdf722ea25f5cf2be1798d5686e43b89fbd
3690
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
dccfefdf72 |
library: a skill brought in from an app's versioned folder follows the app's updates (#2635)
iomect's ego lite keeps its skill in a framework version folder and points its own links at the current one: ~/.agents/skills/ego-browser -> ~/.local/share/ego/ego-skills ~/.local/share/ego/ego-skills -> ~/.local/share/ego/active_version_dir/Resources/ego-skills/ego-browser ~/.local/share/ego/active_version_dir -> /Applications/ego lite.app/.../Versions/0.6.0.12 .../Versions/Current -> 0.6.0.12 ImportSkill linked the library to the fully resolved folder (Versions/0.5.1.13/...). After the update to 0.6.0.12 the old folder was still there, so the library and every agent it gives skills to kept the old skill. importSkill now links to linkVia(f.at, f.real), and Source.Dir is that same path. linkVia follows the found entry's links one at a time, and stops at the first one outside every skills folder (the agents', the shared ~/.agents/skills and the library's): for ego that is ~/.local/share/ego/ego-skills, which the app keeps pointing at its current version. A Versions/<v> part is named Versions/Current when Current is a link to that same version, which covers an entry that links straight into the versioned folder. If that path doesn't resolve to the same folder as today, linkVia returns the resolved folder, as before. Nothing else changes: every comparison of Source.Dir already goes through realDir. Tests (skill_version_test.go): - TestImportedSkillFollowsAppUpdate uses the reporter's layout (ego lite.app, ego Framework.framework/Versions, active_version_dir, ego-skills, ~/.agents/skills/ego-browser), brings it in at 0.5.1.13, then moves the app's links to 0.6.0.12 and checks the library's skill is 0.6.0.12's, listed and not missing. - TestImportedSkillThroughVersionsCurrent does the same with an entry linking straight into Versions/0.5.1.13. - TestImportedSkillPlainLink checks that a link to a plain folder is still linked to that folder. Broken by hand: - with `via := f.real` (the old link), FollowsAppUpdate and ThroughVersionsCurrent went red (the skill stayed "ego 0.5.1.13"); - with the Versions/Current step taken out, ThroughVersionsCurrent went red. Not done: a skill brought in before this keeps its old resolved link until it is brought in again, or its link in the library is replaced. No ego install here; the tests use the layout from the reporter's ls. Run: gofmt -l clean; go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags nogui ./... clean. go test -timeout 45m ./... under set -o pipefail with a sandbox HOME, load ~280: 65 packages ok (internal/library 352s), internal/gui red with 8 real-window AppKit tests killed at their deadlines (#2645). internal/gui doesn't use this code. It passed alone with the real HOME, with this change (186s at load ~260-341) and on |
||
|
|
ebf3f48f7f |
usage: a reported call takes first_text_ms and flow_ms, so a reasoning reply tells its speed and a burst is held (#2637)
POST /v1/magpie/usage/requests turned away first_text_ms and flow_ms as
"not a field a reported record takes", so a reported reasoning reply was
timed from its first reasoning token and a burst-at-the-end reply was
never held. The ingest now takes both, validated like ttft_ms (whole
milliseconds, 0..ingestMaxMillis, null = unset), and checks:
- first_text_ms <= ms, and first_text_ms >= ttft_ms when both are set
(the first text is content too);
- flow_ms <= ms*10/8+1, since the gateway's flow is the tenth-to-nine-
tenths span scaled by 10/8 and can exceed ms.
The fields reach usage.jsonl through the Record, so DecodeOf, Row.Decode
(ThinkPace, HeldShare) and the Reported totals read them as they do the
gateway's own rows. docs/reference.md and gateway-sessions.md say so.
Tests: TestUsageIngestTellsSpeed posts the reporter's literal repro
(grok-4.7, out 307, reasoning 129, ms 5035, ttft 4632, first_text 4700:
178 tokens over 335ms), a burst held by flow_ms, an even reply told, and
a ThinkPace hold, and checks the totals. TestUsageIngestTimesChecked
covers each bound, its edge, null and absent fields.
Broken by hand: old code fails both tests (field refused); dropping
FirstText tells repro-1 0; dropping Flow tells the burst 601/4035;
removing the ttft check accepts first_text 299 < ttft 300; bounding flow
by ms rejects the valid 1501.
Run at
|
||
|
|
333c167575 |
routing: a rule can set the reasoning its model is asked for (#2633)
dengtongcai asked for a routing rule that picks both the model and the reasoning it is asked for (a quick question goes to a cheap model at low). A rule now has an output field, useEffort (low|medium|high|xhigh|max). When the rule matches, its member is asked for that effort. A member's own fixed effort still wins. Otherwise the rule beats the model's suffix, the turn's pick and the agent's pick. The existing effort condition is unchanged. - The value is fitted to the model's levels (max -> high on a model that tops out at high). A model with no Efforts is sent what the agent asked, untouched. Unset changes nothing. Failover members are not affected. - The trace records it: Rule.UseEffort and the try's RuleEffort (the second Try construction in the candidate loop was missing it). - Saving a group rejects an unknown value or one on a pause (cleanRules). The CLI takes use-effort=; the TUI and CLI lists show " at <effort>". - GUI: a chip after the rule's model, picked from the app menu (pickFrom, no native select), set/changed from the rule's menu. A pause clears it. Strings in zh, zh-TW, ja, de. - A Gemini-protocol client is left unchanged, as with every effort magpie sets. - Docs: docs/subsystems/gateway-routing.md; site docs intent and start (en, zh, ja). What was run, at d4c03a2c5 (rebased on |
||
|
|
8bb9375e74 |
library: another app's MCP server in an agent's config is offered to bring in, not taken for the agent's own (#2635)
iomect's Codex server, written in ~/.codex/config.toml as
[mcp_servers.netcatty-external]
command = "/Applications/Netcatty.app/Contents/Resources/app.asar.unpacked/electron/cli/netcatty-external-mcp"
args = []
env = { NETCATTY_EXTERNAL_MCP_DISCOVERY_FILE = "…" }
never showed under the Library's servers found in agents. The TOML was
read correctly; the cause was appOwned. It marked any command under a
".app/Contents/" as one the agent's app writes itself (Codex's node_repl
and cua_repl,
|
||
|
|
d4a1b9baa7 |
gateway: a </think> inside code no longer ends a reply's thinking; a plugin's text keeps its <think> (#2634)
Kane-Kuroneko's Qoder replies through Codex began mid-sentence at a
backtick: the Chat decoder took any reply whose text began with <think>
as inline thinking up to the first literal </think>, even one inside an
inline-code example ("使用 `<think>...</think>` 标签"), for every Chat
upstream.
- The close is looked for only outside Markdown code (mdCode in
chat.go): an inline span (taken to end with its line, so a stray
backtick can't swallow the answer) or a fenced block. Backtick runs and
a close split across chunks are held, as the tag tail was.
- A plugin's Chat reply is read as OpenCode reads it, its text as it came
(decoderFor, used by streamTranslated, the continuation path and the
search path): the plugin knows its vendor and gives reasoning apart.
Qoder's plugin sends reasoning_content and has no splitter of its own.
- A reply that already gave thinking in reasoning_content/reasoning has
no leading-tag lookup in its text.
- The line breaks after a close are left out however they're chunked:
one character a delta used to leave "\n" at the head of the answer.
- Codex titles/descriptions/predictions (codex_titles.go) strip a leading
block with the same close rule (afterThought), the sibling cut.
MiniMax (
|
||
|
|
c1e95f919b |
gateway: a key held to accounts is told only of the image and video models they serve (#2579)
A gateway key held to some accounts was told, in /v1/models' image and
video lists (drawerObjects, videomakerObjects), of every image and video
model its held models named, whether or not an account the key may use
serves it. Its chat list already applied accountServes; the two media
lists applied modelAllowed alone. Both now apply both, as entryAllowed
does. Reported by ggbdpq; the patch and test are ump45nose's
(fix/2579-image-video-account-serves, 592cc4db), with a t.Cleanup added
and the doc comments and failure message reworded.
Siblings: the other modelAllowed-only callers are not model lists (the
codex and desktop subagent picks, chatGPTSearchers, quotas_scope, which
handles accounts in card(), and videoModelHeld). The Drawers/Videomakers
uses in draw.go, video.go and drawing_route.go resolve a model, they do
not list them.
Run at this commit's tree (base
|
||
|
|
6f950653fc |
gateway, codex: a model turned away for an image says why magpie takes it for text-only and where Accepts images is (KimYx0207 on X)
mark_li21 pasted an image in Codex through magpie and was told the model
doesn't take images, with no hint of why or where that is changed;
KimYx0207 asked that the refusal say the model's list has no image input
and point to Providers → Names & levels, so nobody switches models or
reinstalls Codex first.
Codex turns the image away itself ("… does not support image inputs.
Remove images or switch models."), and magpie can't word that. What it
can:
- Codex's /model: a model magpie hands Codex without "image" now reads
"<name> (text only: Accepts images is in its provider's Names & levels
in magpie) via magpie". It still ends " via magpie", which is how
catalog.MagpieAdded tells magpie's entries from Codex's own. A model
that sees and a routing group read as before.
- The gateway's own 400 (every other agent): after "does not support
image input" it says why — Accepts images turned off by the user for
it, or the provider's model list marking it as not taking images, or no
model in the group marked as taking images — and names
Providers → <provider> → Names & levels, before the note on image
recognition it already gave.
Tests: TestCodexCatalogSaysTextOnly; TestTextOnlyRefusalSaysWhyAndWhere
(the user's own answer, a group); TestKnownTextOnlyModelRejectsImagesBeforeUpstream
now checks the why and the where on all four APIs. With codexcat.go and
gateway.go put back, all three are red.
Real use: a catalog from codexcat.Catalog handed to Codex 0.162.1 under a
sandbox CODEX_HOME (model_catalog_json, a dead provider URL); /model
lists "Text Model (text only: Accepts images is in its provider's Names
& levels in magpie) via magpie" and "Sees Model via magpie". Pasting an
image there wasn't tried.
Run at origin/main
|
||
|
|
df3734b959 |
proc: the login shell's variables count only when exported, and Codex's proxy detail names the variable it read (#2627)
ReneXiong: Codex showed the "proxied" drift, "through the proxy at
http://127.0.0.1:7890, set in HTTP_PROXY", while Codex went direct. The
value was fish's universal http_proxy from an old Clash setup, never
exported (`set -S` says "unexported"), so no program fish starts has it.
shellEnv asks fish beside the login shell (zsh), and shellProbe printed
"$http_proxy" in the shell itself, which expands unexported variables too;
mergeShellEnv then filled zsh's empty value with fish's.
Fix at the shared reader: every shell is now asked to run
/bin/sh -c 'printf ... "$PATH" "$CODEX_HOME" ...', the form nushell already
used (still with its ^). A child sees only exported variables, so each
value is what an agent started from that shell gets. This covers every
reader of the probe: Codex's proxy (codexEnv), Claude Code's provider
switches (claudeShellEnv), and agentenv.Vars such as CODEX_HOME and
CLAUDE_CONFIG_DIR that magpie takes into its own environment; an
unexported zsh or bash variable no longer counts either, which matches what
an agent run from that terminal sees. Proxy variables are still merged from
fish when the login shell has none: a fish user who exports one runs Codex
with it from fish, so taking proxies from the login shell only (the
report's other suggestion) would miss that case.
codexProxyFor named HTTP_PROXY (or HTTPS_PROXY, ALL_PROXY) for a value in
the lowercase variable. It now names the one it read, in both the reqwest
and respect_system_proxy paths, and the detail's NO_PROXY advice matches a
lowercase name too (and not "the system's proxy settings").
Other proxy readers checked: the daemon's carried env, wslrun's proxyVars,
netproxy and the plugin host read magpie's own environment, not a shell;
the WSL probe scripts ask for no proxy variable.
Tests: TestLoginEnvUnexportedNotCounted, a login shell with the reporter's
literal values unexported beside an exported NO_PROXY; TestShellEnvRealFish
now writes the reporter's literal fish_variables lines and checks that
http_proxy, https_proxy and all_proxy read empty;
TestCodexProxyNamesItsVariable. Broken by hand, each went red: the old
in-shell printf (unexported values read back, in the fake shell and in real
fish 3.7.1), and env() naming keys[0].
Run: go test ./internal/proc and the codex proxy tests on darwin;
TestShellEnvRealFish, TestShellEnvFishLogin and
TestLoginEnvUnexportedNotCounted on real fish 3.7.1 in an alpine container
(linux/arm64), green with the fix and red without it; gofmt -l clean; go vet
-tags nogui ./... for darwin, linux and windows; the full go test -tags
nogui -timeout 45m ./... under pipefail, both fixes together on
origin/main
|
||
|
|
742d6c06e0 |
gui: on Linux the window and its desktop entry name each other, and the icon is installed (#2626)
unfallenwill: the dock and the app grid showed a gear for magpie on Linux.
The desktop entry registerScheme writes had no StartupWMClass, and its
Icon=magpie named an icon nothing installed.
What the window reports, from the source (not guessed):
- GTK3 (gtk-3-24): an X11 window's WM_CLASS is (g_get_prgname(),
gdk_get_program_class()), the class being the prgname with its first
letter upper-cased; a Wayland xdg_toplevel's app_id is g_get_prgname(),
falling back to the program class.
- Wails v3.0.0-beta.24 (gtk3 build, which magpie's Linux build uses):
LinuxOptions.ProgramName goes to g_set_prgname before
g_application_run. Without it the prgname is the executable's name,
magpie-linux-amd64 for a release run as downloaded, which no entry names.
So magpie now sets ProgramName "magpie" (internal/gui/desktop.go), making
WM_CLASS ("magpie", "Magpie") and app_id "magpie", and the entry says
StartupWMClass=magpie. An ApplicationID was not used: WebKitGTK keys its
data folder by the prgname (~/.local/share/<prgname>), so "magpie" keeps an
install.sh user's data where it is. A binary run under another name had
its data under that name; keepWebData moves it to ~/.local/share/magpie
before the first webview, unless magpie's folder is there already (Go's
os.Rename refuses an existing directory, which is the guard).
registerScheme also writes a 256px icon to
$XDG_DATA_HOME/icons/hicolor/256x256/apps/magpie.png (temp file and rename,
skipped when the bytes match), and rewrites an earlier entry for the same
executable that lacks StartupWMClass. Flatpak is left alone as before.
install.sh's own entry gets StartupWMClass=magpie too. The icon is
build/icon/gen.go's 256px output (make icons now writes it), the same bytes
as site/public/img/icon-256.png.
Siblings checked: the autostart entry starts the app and needs no
StartupWMClass. The repo has no deb, rpm, AppImage, AUR or flatpak
packaging (#2225 plans deb/rpm); install.sh is the only other entry.
Tests: TestRegisterScheme checks the entry's StartupWMClass and Icon and
the installed PNG (256x256); TestRegisterSchemeBindsAnOlderEntry;
TestKeepWebData (moved, magpie's folder there already, no localstorage);
TestLinuxWindowNamedAsItsEntry (gui build); install.test.mjs asserts the
line. Each was broken by hand and went red: entry without StartupWMClass,
icon not installed, the short-circuit without the StartupWMClass check,
keepWebData returning at once, linuxOptions without ProgramName.
Run: the Linux tests cross-compiled (linux/arm64, nogui) and run in a
busybox container, the whole internal/gui package passing there;
TestLinuxWindowNamedAsItsEntry on darwin; node --test site/install.test.mjs
10/10; gofmt -l clean; go vet -tags nogui ./... for darwin, linux and
windows; the full go test -tags nogui -timeout 45m ./... under pipefail, both
fixes together on origin/main
|
||
|
|
ed0335f75c |
gateway: an assistant turn cut off before it said anything is left out of what a Chat upstream is sent (#2599)
timonwong (#2599): after the user stops a reply while the model is still thinking, the agent keeps a turn with no text and no calls and sends it again on every later turn. Translated (buildChat) or relayed, it reached the Chat upstream as {"role":"assistant","content":""} (reasoning_content alone, on DeepSeek), and DeepSeek and Kimi turned every request of the conversation away: "Invalid assistant message: content or tool_calls must be set". One rule, withoutSilentAssistants (chat.go), runs on both Chat routes: buildChat before pairToolMessages (Claude Code, Codex and Gemini clients, and the plugins fed by buildChat), and silentAssistantsOut in passthrough next to developerAsSystem (a Chat client's own body). An assistant message with no content or only blank text parts, and no tool_calls or function_call, is left out; the user messages it stood between join into one (texts with a blank line, else their parts in order), so no two user messages stand in a row. A prefill (prefix, partial, a Resume), a legacy function_call, a refusal and an audio reply stay. A relayed body without such a turn goes byte for byte. TestChatThinkingOnlyAssistantKeptOutside- Exchange pinned the old pass-through; it now expects the joined message. Built on ggbdpq's patch (cb438ebb on their fork) and its fake upstream, written again because the review found it missed shapes the issue names: - after a tool result it kept the empty turn ("a strict template wants the reply behind its tool message"), so the interruption mid tool loop still sent content "" and still got the 400. tool then user is what any agent sends when the user writes after a tool result; it is now left out. - the relay dropped an assistant with a legacy function_call or a refusal and empty content, and a client's own prefix/partial prefill; kept blank text-part arrays (still refused); joined only string users; re-marshalled with HTML escaping. - its Resume check compared a joinSplitCalls turn index with len(r.Messages)-1. Verified (sandbox HOME, pinned caches, go1.26.8 darwin/arm64, base origin/main |
||
|
|
e903d87fbe |
gateway tests: TestUsageKeepsTimeToFirstToken sends each event after the agent got the last, not a fixed gap (#2575)
The test's vendor (paced) spaced its reasoning, text and end with a fixed
80ms sleep, and that sleep was all that kept them apart. On a loaded full
run the gateway read late, found the reasoning and the text waiting
together, and timed both at once ("usage ttft 228, first text 228" for
responses_from_chat). The gateway timed what it read correctly; the test
assumed the scheduler keeps up.
ump45nose's patch (test only): paced takes a heard hook, and the gap
before each marked event after the first starts only once the agent
(hearing, a ResponseRecorder that watches its body for "hmm" and then
"hi") has been sent the one before, with a 10s give-up so a missing word
fails instead of hanging. Every case runs twice, "on time" and "late",
where the gateway's first write to the agent is held three gaps while
the vendor's events come in. Other paced users leave heard nil.
Verified (sandbox HOME, pinned caches, go1.26.8 darwin/arm64, base
origin/main
|
||
|
|
ec64543952 |
claude: a switch gives a Claude subscription's run the agent's instructions as its system prompt, in place of Claude Code's
Every request through a Claude subscription is answered by the real
Claude Code, which sends its own system prompt, with the agent's
instructions in the run's first user message. Settings › Replies › Short
Claude system prompt (claudeLeanPrompt, off by default) starts the run
with --system-prompt-file holding the agent's instructions instead
(without a client Claude Code's billing line, plus the tool-choice
line), and the first message holds the conversation alone. The file is
under the distro's mount in WSL. A request with client cache marks
(#1717) is never lean. The mode is part of the run's identity, so a run
started in one mode never takes the other's turns. The row says the
risk: requests look less like Claude Code's own.
Measured with a real Claude subscription, Sonnet 5.5, Claude Code
2.1.301, off then on:
- chat client, ~600-token prompt, 2 tools, 3 turns: 10,048 -> 6,580
input tokens (-35%)
- claude -p as the client, Read and Bash, 4 requests: 85,453/85,471 ->
81,948/81,977 (-4%)
A fixed ~0.9-1.2K tokens a request.
Run at this head (rebased on
|
||
|
|
72d6103e28 |
gateway: a Chat tool in MCP's or another API's shape goes upstream as a Chat function tool (#2622)
jinyue806 (#2622): ZCode sends its tools on /v1/chat/completions in MCP's shape, {"name","description","inputSchema"}, with no type and no function object. magpie relayed them as they came, and SenseNova turned every request with tools away ("field Tools[0].Type invalid, should be set"; a flat {"type":"function","name":…} got "function cannot be empty"). A missing type is invalid Chat Completions for every upstream, not SenseNova only, and the translated routes were broken too: parseChat read no name from such a tool, so Messages and Responses upstreams were offered a tool named "". shapeChatTools puts a tool with its name at the top (no type, or type "function" without a function object) into {"type":"function","function": {name, description, parameters, strict}}, parameters taken from parameters, inputSchema or input_schema; other fields stay beside it. It runs right after liftMessageTools at the same two choke points: handle, for every Chat body before routing (relay, schema fixers, redaction, plugins), and parseChat, for a body that never came through handle. A tool that has its function, a hosted tool (any other type) and one with no name are left alone, and a request with nothing to shape is relayed byte for byte. Verified: - TestChatToolInAnotherShapeIsShaped sends the reporter's curl body with each of the four tool shapes from the report through the Chat relay, Messages and Responses. With shapeChatTools made a no-op by hand all 12 subtests FAIL: relayed as {"name":"f","inputSchema":{…}} as it came, and translated as {"name":"",…}. TestShapeChatToolsLeavesChatShape (byte for byte on Chat-shaped/hosted/nameless tools; strict and cache_control kept) FAILs on the same break. Both pass restored. - gofmt -l: clean. go vet -tags nogui ./... for darwin, linux, windows: ok. - Full suite at |
||
|
|
a69cd07075 |
gateway: a Chat tool call kept with an empty id goes with one made from its place (#2611, RunMintOn)
RunMintOn's session held an assistant turn whose tool call had "id":""
and a tool result with "tool_call_id":"". magpie relayed it unchanged on
Chat->Chat, and WorkBuddy AI turned the whole request away (400, 11133).
Chat->Messages sent tool_use id "" and Chat->Responses gave the call a
random id while its result kept "".
- chatCallIDs (chat_call_ids.go) runs in attempt for every Chat request,
before the relay, the translation and a plugin's fetch alike (a moved
WorkBuddy AI goes through the plugin, so the edit must come first). An
empty, null or missing call id gets "call_" + a hash of the call's
message index, position, name and arguments: the same on every resend,
so the prompt-cache prefix holds. A result with an empty tool_call_id
takes the turn's unanswered calls in order. A body that already has its
ids comes back byte-identical.
- chatTidy gives a stream's first fragment of each (choice, index) call an
id when the upstream sent none, and drops an empty id on later ones;
chatWhole fills a whole reply's empty ids.
- docs/subsystems/gateway-routing.md says so.
Tests (chat_call_ids_test.go), fixtures from the issue's literal bytes,
against a fake that refuses as WorkBuddy AI does:
- TestEmptyCallIDRelayedWithOne, TestEmptyCallIDReachesPluginWithOne
(movedFake workbuddy-ai), TestEmptyCallIDTranslatedWithOne (messages,
responses), TestChatCallIDsLeavesWhatHasIDs, TestStreamedCallGivenAnID,
TestWholeReplyCallGivenAnID.
- Broken by hand, each watched red: edit removed (relay and plugin get
the 400; translations send an empty or unpaired id); a random id in
place of the placed one ("the made id changed between requests");
stream mend off (first fragments' ids ""); whole mend off ("id":"").
Run at this change on origin/main
|
||
|
|
b7d9616d0e |
gateway: TestMaxRPMGroupPrefersMemberWithRoom checks the route never queued, not a fixed 1s (#2520)
The test gave the second request's round trip 1s as a stand-in for "didn't
wait for A's minute", and a loaded machine went over it (1.13s) with the
routing right. It now reads the second request's route from the trace:
done, one try, to pb, Queued 0 (the trace's Queued holds the wait for
room in the minute too). The time bound stays as a backstop at half the
minute, and the minute is now 20s instead of 5s, so the bar is 10s:
nothing waits for it when the routing is right.
Based on ump45nose's patch, which read usage.Load's record. The review
found that record's Queued and Tries are 0 for a non-streaming request
even after a 20s wait (Queued is filled only when TTFT > 0), so only its
provider check carried weight; the trace's try carries the wait
(Queued:19984 in the hand-broken run). The patch's 2.5s bar was also
under this machine's 2.97s round trip with B held 1.2s.
What ran (worktree at origin/main
|
||
|
|
ff72eeda52 |
source: the last-source budget test reads which context ended instead of racing sleeps (#2608)
TestDoLastSourceUsesRemainingBudget slept 1100ms (official) and 700ms
(mirror) under a 2s parent, leaving ~300ms for scheduling. It now uses a
controlled RoundTripper: the official request waits on its candidate
context and must end with context.Canceled (its half of the budget), and
the mirror request must carry the parent's deadline and end with
DeadlineExceeded no earlier than it. A second test adds #2608's 350ms
pause before the mirror request. Patch by ump45nose; the review dropped
an unused parentDeadline field.
What ran (worktree at origin/main
|
||
|
|
81313b9121 |
gui: the core script budget makes room for 10-16's core work (#2612)
TestCoreScriptBudget was red on macOS and ubuntu CI on main from |
||
|
|
9228bd443f |
library: skills are grouped by source when the skills CLI keeps its lock under $XDG_STATE_HOME (@_yukirock on X)
skills 1.7 writes its global lock to $XDG_STATE_HOME/skills/.skill-lock.json
when that variable is set, and only to ~/.agents/.skill-lock.json otherwise.
The Library read only the ~/.agents one, so with XDG_STATE_HOME set every
`npx skills add` skill had no repository and the "By source" view could not
group them. Both locks are now read, the XDG one winning per skill, since a
lock written before the variable was set still names older skills.
XDG_STATE_HOME joins agentenv.Vars, so the desktop app takes it from the
login shell like the other folder variables (TestFolderVarsAreListed).
Not handled: a project install's ./skills-lock.json.
Run (worktree at origin/main
|
||
|
|
1978eabe58 |
agent: Codex's background compaction is turned on from Settings › Long conversations (#2490, #2493)
Codex 0.163 can compact a long conversation in the background while a
turn goes on ([features.async_compaction]). A new row under Long
conversations turns it on, with the share of the window it starts at
(empty: Codex's own 65%). magpie writes it into each Codex config it
routes (codex_async.go):
- [features.async_compaction] enabled = true and
model_async_compact_threshold_percent. Codex reads the threshold only
in that table; one at the top level is ignored (tried).
- capabilities = { remote_compaction = "v2" } on [model_providers.magpie].
Codex starts a background compaction only on a provider with v2, which
it gives OpenAI and Azure alone. Tried with Codex 0.163 against a
sandbox gateway and a fake upstream reporting 70% use: without the
capability, no compaction in a whole turn; with it, compaction_trigger
requests ran beside the turn's steps and the next step's input held
the summary. The capability is written for a feature the user turned
on by hand too (#2493 asked whether magpie supports it: it didn't).
putProvider carries the table's capabilities over when a model switch
writes it again.
- What magpie wrote is in the stash (codex.async). A value the user set,
or changed since, is never written over and stays when the switch is
turned off; a bare async_compaction = true, an inline or a dotted
table is the user's as written. A config that doesn't parse is not
written to.
Not tried: Codex signed in with ChatGPT (openai_base_url to magpie on
the built-in provider, v2 by default), only the custom provider path.
Tests: TestCodexAsyncCompactionWritten, ...KeepsTheUsers and
...KeepsUsersCapability (internal/agent), each red with the matching
part removed by hand (no writing; no capability carry-over; no
ownership check on enabled). codex-async-compact.test.cjs: Chromium and
WebKit, en/zh/zh-TW/ja/de, red with the 1-100 check removed;
compact-at, i18n-keys, settings-general, settings-search pass.
TestSettingsSaveKeepsWhatItDoesNotSend holds the two new fields.
gofmt clean; go vet -tags nogui on darwin, linux, windows.
Full suite: go test -tags nogui -timeout 45m ./... (pipefail, suite-lock) at the four #2494/#2504/#2505/#2490 commits on origin/main
|
||
|
|
a2c4aab1ba |
gateway: DSH's session header and compaction mark are recorded, also through a remote magpie (#2505)
h4rk8s asked that the Requests list tell DSH's context compactions apart
and attribute usage per DSH session, also when the call goes through
Remote Magpie, from the headers DSH sends and never from the prompt.
- x-deepseek-harness-session-id joins sessionHeaders, after the others:
sessionOf / nativeSessionOf / conversationID take it, so usage, the
Routing page and affinity see DSH's session, and passOnCaller already
sends a native session header on to a remote magpie.
- x-deepseek-harness-compact set (any value but "", 0, false, no, off)
makes callKind "compact", which PurposeOf groups as Compaction. Only
display reads that kind; routing is unchanged.
- withCaller keeps the mark on the caller and passOnCaller sends it on to
a remote magpie, so the other magpie records the call as a compaction
too. Neither header reaches a vendor (the request to it is built fresh).
- docs/subsystems/gateway-sessions.md says so.
Run:
- TestDshMarksSessionAndCompaction: direct and through a remote magpie
(two gateways over httptest), marked and unmarked with a summarizing
system prompt. Red on the old gateway.go/codex_backend.go/
remote_magpie.go (session "", kind "", remote sent neither header),
green now; asserts the vendor saw no x-deepseek-harness-* header.
- TestRemoteMagpieKeepsTheSession still green.
- gofmt -l clean; go vet -tags nogui for darwin, linux, windows.
Full suite: go test -tags nogui -timeout 45m ./... (pipefail, suite-lock) at the four #2494/#2504/#2505/#2490 commits on origin/main
|
||
|
|
51adf96958 |
agent: a compat switch set by hand on a DSH model stays through a model refresh (#2504)
h4rk8s: a compat parameter set in DSH's Models page (maxTokensField, say)
went each time magpie wrote its routes again, because the route's
"models" list was put whole, and a model that only works with it failed
again.
dshPutRoute now carries every compat key from the model as it is in the
file onto the same model as magpie writes it, when the model is on the
same route and that route is still on the same protocol (api). A model
new to the route, or one on a route whose api changed, starts without
them. A switch magpie sets itself (forceAdaptiveThinking) is put as
magpie has it now. Name, contextWindow, maxTokens are still written from
the catalog.
Run:
- TestDshRefreshKeepsHandSetCompat: red with the dshKeepCompat call
removed ("the hand-set compat went: map[]"), green with it; two syncs
in a row keep it, deepseek/flash takes none, the stale name/context are
rewritten.
- TestDshKeepCompatNotAcrossProtocols: an api change drops it.
- gofmt -l clean; go vet -tags nogui for darwin, linux, windows.
Full suite: go test -tags nogui -timeout 45m ./... (pipefail, suite-lock) at the four #2494/#2504/#2505/#2490 commits on origin/main
|
||
|
|
ee2a7c7e86 |
sessions: OpenCode child rows no longer crowd the parent out of the trace window
What changed - traceOpenCodeWindow keeps the latest main sessions. A child is not exported, so it no longer takes one of the Limit places. Limit newer children were filling the window and the parent was not read. The JSON store and the SQLite store share that window. Run - TestOpenCodeChildrenDoNotEvictParentTrace failed on |
||
|
|
1eba266a90 |
gui: a moved Factory's waiting sign-in has one "Use an API key instead" link, its key import's
plugin-other-ways.test.cjs was red on main in both engines since |
||
|
|
e80fc7dc5d |
tests: TestFailOpen cuts only the spin short, not the throw and the string
It set the request limit to 50ms for all three hooks. In a full
go test ./... run (on bff7cbd24) the string case ran past 50ms
under load, and was counted "took too long" instead of "returned neither":
state {... Calls:3 AvgMicro:44471 Failures:3 Last:onRequest: took too long ...}
Now the throw and the string run under the normal 250ms limit, and only
the spin gets 50ms.
Reproduced by injection: an 80ms busy loop in the string hook gives that
exact state line on the old test and passes on the new one. -race
-count=20 passes.
|
||
|
|
7d7dba31ae |
provider: removing or turning off a moved subscription's plugin moves nothing back
The built-ins are being retired (the owner, 10-16: 陆续把内置Provider下线掉),
so the last way back to one is gone. MoveBack, moveBack and releasePlugin
are removed, with the Left flag they set.
- SetPluginOff only turns the plugin off. A moved subscription stays
moved, off with it.
- RemovePlugin records the moved ids as the new state "removed". The
record keeps its accounts, which plugin.Remove leaves in the plugin's
auth store. Nothing moves or installs it by itself: MoveRetiring
skips it and keepMovedCurrent reads only "plugin".
- HandOver turns a removed record whose plugin is installed and current
back into "plugin", record and all. So does Adopt (the editor's Move).
- MoveRetiring moves an old "back" record again, whatever Left said.
- Plugins page, rm/off confirms: "{names} stops working until the plugin
is installed again. Its accounts are kept." / "... while the plugin
is off." The status after removing no longer says it is back on the
built-in.
- Strings: five old strings dropped ("Moving back…" among them), three
new ones in zh, zh-TW, ja and de.
- `magpie plugins rm`/`off` say the same in their output.
- Docs: provider-plugins.md (the states table, the Move-back paragraph)
and AGENTS.md.
Tests:
- TestNoWayBack is new. It covers a "back" record moved again, the
plugin turned off (still moved, accounts kept), removed (removed, not
reinstalled by keepMovedCurrent or MoveRetiring), installed again
(HandOver), and removed again then Adopt.
- TestReleasePlugin and TestMoveBackKeepsLapse asserted the way back
and are deleted.
- TestMove, TestHandOver, TestMoveTidiesItsPlugin and
TestAdoptBeforeSigningIn no longer call MoveBack. TestKeepMovedCurrent
uses the removed state.
- plugin-release.test.cjs checks the new asks and that the status names
no built-in.
Run:
- Broken by hand:
- With HEAD's migrate.go, TestNoWayBack is red at "turning the plugin
off moved it back".
- With HandOver's removed branch disabled, it is red at "installed
again: map[], moved false".
- go test -tags nogui ./internal/provider -run
'TestMove|TestNoWayBack|TestHandOver|TestKeepMovedCurrent|TestAdopt|TestInstallPlugin|TestWorkBuddyCheckin|Plugin|Migrat':
ok.
- GUI (NODE_PATH playwright, --test-concurrency=1): plugin-release,
plugin-move and i18n-keys, chromium and webkit: 17/17.
- gofmt -l clean; GOOS=linux and windows go vet of provider, gui and cli.
- Full suite: go test -tags nogui ./... -count=1 -timeout 90m at this commit rebased on
|
||
|
|
f9ceac1628 |
provider: a move onto the plugin takes every account, and no model holds it back
The built-ins are retired (the owner, 10-16: 一定要下线完毕), so a move
can't be held back by something only the built-in could fix. Before, a
move failed when every account was lapsed, when one account's check
failed (the vendor unreachable through the plugin), when the vendor
refused every account, or when a model in use wasn't in the plugin's
list. Each of those left the user on a built-in that is going away.
Now Move installs the plugin and imports every account:
- one the vendor refuses goes along marked lapsed, as before;
- one already lapsed, or whose check fails otherwise, goes along untried
and unmarked, for the plugin's own reads to judge, and is logged;
- no model is checked against the plugin's list.
Only an install failure, the plugin not serving the id, or a sign-in the
plugin won't import fails the move, which puts everything back and is
tried again after moveRetry. The movers' served (Devin, Cursor) and
builtin (ZCode) hooks, modelsInUse, modelNames, lapsedAll and devinBase
had no other use and are gone, with the tests of the hooks. The page still
translates an older magpie's lapsed, unserved and account whys, which
migrations.json can hold.
Tests:
- TestMoveEveryAccountLapsed and TestMoveTriesEachAccount are new, and
TestMoveToPlugin's first case is now a refused account that moves.
importAuth is a seam: the fake mover's "r-noimport" sign-in fails part
way, so TestMoveToPlugin, TestMoveTidiesItsPlugin and TestMoveCutShort
still test putting back.
- TestMoveCutShort's cut-short record now carries the sent sign-in's
hash, as a real move writes it. Without it putBack took the built-in's
sign-in as renewed. The old test passed only because the check renewed
the token a second time.
- Broken by hand: with a failed check or a refusal returning an error
again, TestMoveToPlugin and TestMoveTriesEachAccount go red.
What was run:
- go test -tags nogui ./internal/provider -run
'Move|HandOver|Lapse|PutBack|Retir|Adopt|KeepMoved|ReleasePlugin|
ZCodeStartPlan|Devin|Cursor' passes.
- go vet passes and gofmt -l is clean.
- At ab7b28510 on
|
||
|
|
9fcf6a6e7f |
provider: every deprecated built-in moves onto its plugin, and there's no way back
The owner, 10-16: 陆续把内置Provider下线掉…一定要下线完毕. The plugins now do what the built-ins did (the parity batch up to |
||
|
|
1d6f461a99 |
plugins: the Unofficial, on GitHub section shows while GitHub hasn't answered, looking, with cards still to come
On a slow line the section wasn't drawn until /api/plugins/github
answered, so Discover read as having no unofficial plugins (yetone:
当还没加载完的时候,压根就不显示,会让那些网慢的用户以为没有非官方插件).
While it waits, the section stands in its place before the field: its
head and hint, a quiet "Looking on GitHub" with three breathing dots
(role=status, aria-busy on the section), and three card-shaped ghosts
(logo, name, author, button, two lines, two chips) a soft light passes
over, each card a beat after the last. When GitHub answers, its cards
come in where the ghosts were with a short staggered fade-up. A search
while it waits shows the same. When the ask fails (and nothing was
loaded before) the section says "Couldn't ask GitHub: <error>" with Try
again, instead of disappearing. prefers-reduced-motion stops all of it.
Strings in zh, zh-TW, ja and de.
Run:
- new internal/gui/tests/plugin-github-wait.test.cjs: 18/18 on this tree
(Chromium and WebKit; en, zh, ja, de; 980 and 440 wide; held, search
while held, let go, 502 then Try again, no scroll on the click).
With MAGPIE_WAIT_ASSETS at origin/main's assets: 9/9 red (Chromium).
Screenshots of each state looked at.
- GUI files around it (plugin-*, i18n-*, builtins, nav-sub*,
click-scroll, old-webkit, mobile-web): 602/620 under load. The reds,
rerun one file at a time here and on origin/main
|
||
|
|
a751f5282e |
gateway: TestRequestBodyProgressRenewsIdleDeadline leaves a loaded runner ten gaps of room in its idle window (#2567)
The 408 on macOS CI (run 38888578439, |
||
|
|
a4fa7bbd8c |
gui: "Waiting for a request" is a core word, and app.js's comment no longer says "New group" (#2586)
i18n-keys' "a plugin's words are its own" was red on main |
||
|
|
2c72563dd1 |
usage: Requests splits and filters by gateway key, with "No gateway key" for the calls none made (#2521)
MauriceCarlo asked for two things on Usage → Requests. 1. The gateway-key filter should show even when one key has calls. The picker hides itself under two options, and with one key it had one, so calls made with that key couldn't be told from calls made with no key. A "No gateway key" choice (callerKey=none) now sits beside the keys whenever the period has calls with no key, or it is the current pick. A single key's picker therefore shows and separates the two. The hidden condition itself is left to #2499, which another session has. 2. The trend chart and the ranking can split by gateway key. LED_SPLITS gains "Gateway key". It's offered only while the period has a key's calls, and it falls back to Model otherwise. A click on a rank row picks that key, or none, and a second click lets go, as the other splits do. Server: - usage.Dimensions gains "callerKey". A row's key is its CallerKeyID, or NoCallerKey ("none") when it has none, and the filter takes "none" as calls without a key. - Filter.Without(d) is the one place that clears a dimension's own pick, so the by-split lists every value. RequestPage's fast and slow paths both use it now; they each had their own switch. - usageapi names the split's shares from the key labels: "No gateway key" for none, the ID if a key was deleted. - OwnPage keeps a held key's view to its own share in by and in the chart's split, so one key never learns another's name or numbers. The series was already only its own rows. - docs/reference.md documents callerKey=none and by.callerKey. "No gateway key" goes into the core i18n.js. The gateway keys page says "No gateway keys yet", and i18n-keys' "a plugin's words are its own" matches on substrings. Tests: - TestCallerKeySplitAndNone runs the fast and the slow path over {}, one key, none, and none+an agent, and checks by.callerKey. Broken by hand, it goes red: once with the none clause in the filter removed, and once with Without's callerKey case removed. - TestUsageOverGateway: on loopback the split names both keys. A held key's by.callerKey is only its own. With the OwnPage scrub skipped, it goes red (another key's name leaked). - usage-ledger-key-split is new, in both engines, all five languages, and 1400 and 760 px. It checks: - the picker's options with the none choice; - filtering on none; - the split's rows, and a click picking and letting go; - no sideways scroll; - that a period with no key's calls shows neither the picker nor the pill. 32/32 pass. With the none option removed by hand, 11 go red. Run on origin/main |
||
|
|
dc1a9cde27 |
gui: Usage → Requests lists the first token's time in a column of its own (#2522)
tianxia3111 asked to compare time to first token down the request list (首字时间). Until now it showed only inside a row's details and the Duration tooltip. A "TTFT" column (zh 首响, zh-TW 首響, the word the row details and Routing already use) now sits before Duration. Its header tooltip reads "Time to first token". A row told from a session file's times gets "≈", like Duration does. A row with none (not streamed, or failed before a token) shows a faint dash, not 0 ms. Narrow windows: ledFit used to have two stages, tight (Sent, Effort, cache) and tighter (the price reference, shorter names). The new column pushed the reporter-sized 975px window of #860 into tighter, so the price reference went. A stage between them, tight2, now hides only the TTFT column (LED_COLS opt level 2 → .lc-opt2). The hint then says the first token is in each row's details too. "TTFT" and "Time to first token" go into the core i18n.js, not the plugin's. Other code says those words too, and i18n-keys' "a plugin's words are its own" would fail otherwise. Tests: - usage-ledger-ttft is new: the header and its tooltip, the value and the dash, the ≈, and the column leaving at a narrow width with the hint. It runs in both engines and all five languages, 12/12. - usage-ledger's column lists and usage-speed's narrow hint are updated, and usage-ledger-detail finds Duration by its class. - The staged tree alone (index checked out): i18n-keys, usage-ledger-ttft, usage-ledger, usage-speed and usage-ledger-detail all pass, 61/61. Run on origin/main |
||
|
|
440f66701f |
gateway: a 429 for native compaction's one account says the compaction pinned it, not that every account is capped (#2517)
When a conversation was compacted natively, only the key or account that sealed the compaction can read it (#1099), so checkpointReaders keeps the candidates to that one. When that account was at its usage cap, the 429 and the call record said "every account that serves X is held at the usage cap", although the other accounts were never candidates. That sent lm0711 looking at routing modes, which can't change it. checkpointHeld tells this case apart: the plan held only the sealer's account(s), and others were left out for the checkpoint. The error then names the account and its window, says the compaction it sealed is what keeps the conversation there, that routing mode and stays don't change that, and to raise the cap / spend credits or start a new conversation. The record reads "native compaction's account at its usage cap" (or its credits / both variants). cappedError and cappedRecord are unchanged for every other 429; their text is split into heldReasons and heldAdvice so both share it. docs/subsystems/gateway-routing.md says so. Test: TestNativeCompactionWriterAtItsCap seals a checkpoint on one account, caps it, and checks the 429 body and the record. Broken by hand (checkpointHeld returning nil), it fails with the old "every account" text. Run on origin/main |
||
|
|
61ca3924cb |
library: a pasted "npx skills add owner/repo --skill x" reads as its repo
The skills page's add field now takes the command a skills page offers
to copy (npx, bunx, pnpx, pnpm or yarn dlx, bun x, with -y, --skill and
--agent flags) and installs from the repository it names (RockyShowlle
on X). Anything else is used as typed.
Run at base
|
||
|
|
83f3316cfe |
library: a pasted repo binds a skill copy identical to its own, so it updates
When a skill in the library is a copy whose every file matches the
repository the user pastes, it is now bound to that repository, as if it
had been installed from there. Before, it was only grouped under the repo
and never updated (RockyShowlle on X). A copy that is linked from
elsewhere (npx skills, a git checkout) or that was edited stays grouped
only.
Run at base
|
||
|
|
9b04c4e20f |
plugin: async gateway request hooks, run in Bun before routing and after the reply (#2118)
A package's magpie.hooks entry (or a *.hooks.{js,mjs,ts,mts} file) exports
`async onRequest(body, ctx)` and an optional `onResponse(reply, ctx)`. They
run in the Bun plugin host, so a hook can await I/O, for example a context
service like PowerContext, which the sync moejs middleware can't. The
gateway still makes one model request per client request. A hook adds
context to the body; it doesn't register tools or run a loop, so magpie
doesn't become an agent runtime.
Ported from Tsukikage7/magpie#1. Changes from the fork:
- The entry name is magpie.hooks / *.hooks.*. The fork's magpie.gateway /
*.gateway.mjs is already the middleware's alias, so a hook importing
node:fs was also loaded as moejs middleware and failed there.
TestGatewayHookNamesApartFromMiddleware fails if the two sets overlap.
- onRequest is rolled back, and counts as failed with no onResponse, when
it throws, times out, returns non-JSON, or changes tools, tool_choice,
function_call, functions, toolConfig, model or stream.
- onResponse gets the client-facing reply, merged through the gateway's own
stream decoder, collector and renderer (no second merger).
- Codex's native passthrough (/backend-api/codex) runs the hooks too,
without the sync middleware.
- The run ends with the request handler, not the client connection. Codex
hangs up on response.completed, and the reply it got is still captured
as a success. TestGatewayHookSeesReplyAfterClientHangsUp is red on the
old `r.Context().Err()` check and green with -count=3.
- ctx.origin is host-derived (local / gateway-key / remote). Headers, keys
and peer addresses never reach the hook.
- Plugins page: a hook package shows a "Request hook" chip, a diagnostics
line (outcome code, calls, avg ms, bytes, failures; no content), and
Options. Strings are in en, zh, zh-TW, ja and de.
Docs: docs/subsystems/gateway-request-hooks.md (new), provider-plugins.md,
gateway-middleware.md, and site docs plugins.html in en, zh and ja.
Real use, sandbox HOME on 127.0.0.1:3486 with the owner's real Codex Pro
sign-in. The probe hook adds a codename note and logs both callbacks:
- /v1/responses, /v1/messages, Gemini generateContent: stream and
non-stream. onRequest's note reached the model (the answer had the
codename), and onResponse got success=true and the whole reply.
- /v1/chat/completions: with the probe also changing `model`, the change
was rolled back (the reply came from the asked model) and no onResponse
ran. Without that change, earlier: stream and non-stream success.
- The real Codex CLI 0.162.1 `codex exec` through openai_base_url ->
/backend-api/codex: the hook saw origin=local, agent=codex and the
query; the answer had the codename; onResponse success=true (before the
hang-up fix it never ran: the context was already cancelled).
- `magpie plugin list` shows only "async gateway hook onRequest" for the
hook package, no failed middleware.
Tests (base origin/main
|
||
|
|
78827954fb |
routing: with routing groups off, the Routing page says so and turns them on (bigbenniu on X)
bigbenniu on X: on a new install the Routing page had nothing past its
requests, no New group and no word of where it had gone. A new install's
Essentials preset leaves the "groups" built-in off, and everything marked
data-feature="groups" was hidden without a trace.
Now an element can be marked data-feature-off="<id>", the other way
round: featureStyle shows it only while that feature is off. Where the
routing groups were, the Routing page shows such a note: routing groups
are off in Plugins › Built-in, the groups magpie finds still route, your
own can't be made or changed here; and a "Turn on routing groups" button
that posts plugins/builtin {id:"groups",on:true}, applies the answer and
reloads the groups. It sits after the groups' own rows, so their order
(group-found-off's check) is as it was. Strings in zh, zh-TW, ja and de.
Run:
- internal/gui/tests/routing-groups-off.test.cjs (new), Chromium and
WebKit, en and zh, 900 and 420px: groups off shows the note and its
button, New group and the groups hidden, the note fits the window;
the click posts {id:"groups",on:true}, the note goes, the groups and
New group come back, the status says so; groups on shows no note;
every new string in zh, zh-TW, ja and de. 18/18 with group-found-off.
Red by hand two ways: without the note's data-feature-off (6 of 7
red in Chromium), and without featureStyle's data-feature-off rule
(6 of 7 red). Screenshots looked at, zh 900 and 420.
- 119 GUI files (routing*, group*, panel-routing*, builtins, *-off*):
all pass but routing-bodies (10) and routing-keys-fold (5), which
fail the same 15 on a fresh origin/main
|
||
|
|
ea3dee96a8 |
gateway: a URL magpie didn't choose is downloaded from public addresses only, wherever the request came from
|
||
|
|
7170b5d8bd |
usage: the plan credits a reply says it cost are summed by model, agent and session (#2512)
wwcraft_ on Discord asked for the WorkBuddy credits spent on the Usage page, by model, agent and session. WorkBuddy's chat stream ends with usage.credit, the per-request figure its own app shows as "Credits Consumed". The built-in and the moved plugin both hand that chunk to the gateway's chat decoder (the plugin's renamed()/kept() pass usage on as it came), so cUsage reads `credit` into Usage.Credits and the three record sites keep it on the row. A reply that says nothing has no credits, not 0. - usage: Record.Credits; Totals/Via sum Credits and count Credited; the packed row keeps it under its own flag bit (4096, in TestRowFlagsApart); the ledger CSV gains a trailing "credits" column. - GUI: the Usage ranking's line says "0.7 credits" (积分, 積分, クレジット, Credits) beside the cost, its title how many requests said it; the Sessions page's Routed line says it per route. TUI usage page and `magpie usage` tables say it muted on the same line. No new layout. Real replies on workbuddy-ai, 10-16: gemini-3.5-flash "credit":0.01; deepseek-v4.1-flash, minimax-m3, kimi-k2.6 "credit":0; glm-5.3-flash refused (14003). The tests use those bytes. Run (at b07b518e7 on origin/main |
||
|
|
1bc61b66d7 |
provider: DeepSeek's balance says its granted and topped-up parts under the total (#2511)
wwcraft_ on Discord asked for DeepSeek's 赠金 apart from what was topped
up. /user/balance gives each currency's granted_balance and
topped_up_balance beside total_balance; the card's main figure stays the
total, and the two parts are told under it as secondary detail, the way a
balance's other parts already show (no new layout). The GUI's card and
menu bar panel, the TUI's quota page and `magpie quota` say them, labels
in every language (en, zh, zh-TW, ja, de). A reply without the parts, or one
with nothing granted, reads as before.
Real reply, read once from the owner's DeepSeek key on 10-16:
{"currency":"CNY","total_balance":"134.13","granted_balance":"34.14",
"topped_up_balance":"99.98"}. Fed through readDeepSeek/readDeepSeekSplit:
"¥134.13", Granted ¥34.14, Topped up ¥99.98.
Run (at b07b518e7, this commit plus #2512's on origin/main
|
||
|
|
d9b943555d |
agent: a key of the gateway's own in place of magpie's still reaches magpie (#2510, PaulT on Discord)
PaulT made a key under Gateway keys and put it in Hermes's config.yaml
(providers.magpie.api_key) in place of `magpie`. Requests went through
magpie, but the picker said Hermes's api_key was changed and that
magpie's gateway won't take its requests.
The class: wiringOff, and the key checks of Codex
([model_providers.magpie] experimental_bearer_token), Qwen Code
(env.MAGPIE_API_KEY) and Reasonix (its env file), accepted only the exact
key magpie wrote. A sync also wrote `magpie` back over the user's key,
in mergeKept (every yamlKept/jsonKept agent) and in Reasonix's install.
keyHolds(v, want) is the one check now. Where want is a key magpie gives
for its gateway (gateway.Token, the LAN key, or a TokenFor), it takes any
v that access.Authenticate takes, the same test dsh has used since #1332.
It never stands in for a URL or another value. A key the gateway doesn't
take, or one turned off, is still drift and is still written over.
Run, at
|
||
|
|
9e5fd84bf6 |
gui: the tray panel's Hide accounts covers its model picker too (#2509, PaulT on Discord)
With Hide accounts on, the panel's agent model picker (Hermes Agent's, CODEX group: "GPT-6-Astra via magpie <address>") showed the Codex account's address. In the panel the mask covered #view-agents only, and the picker (#pop), menus and dialogs sit outside it, at the body. The panel now masks the whole body, as its comment already said. The window masks Routing and Usage as before. Its picker names no account, so it needs no change. Every picker shares this one #pop and #list, so this covers every agent's picker in the panel. The TUI has no Hide accounts setting. Run, at |
||
|
|
f54e76dbdd |
gateway: a request builds the providers once, and plugin-auth.json and the discovery setting are parsed once a version (#2502)
XcodeFish (#2502): with several agents at once the gateway sat at 100-350% CPU. Counting provider.AllBuilt around one streamed chat request gave 3 full catalogue builds per request, and each build re-read and re-parsed plugin-auth.json and settings.json (AccountDiscoveryOff called Load() on every provider list). - holdCatalog wraps the gateway's handler in provider.Hold() and filememo.Hold(), so one request builds the providers once and stats each file at most once a second. Hold already drops the cache on provider.Changed and on magpie's own writes; another program's write is seen within the second. - plugin-auth.json is read through filememo (mtime, size, and the raw bytes while the file is under 2s old), so it is parsed once per version. A file that doesn't parse falls back to the last good .bak through lastgood, as settings does. Auths still hands each caller its own decoded map. The host looks at the file again before it reports a sign-in it just saved. - AccountDiscoveryOff reads the setting through filememo with the same parse settings.Load uses (now settings.parse), under fileMu. What was run: - TestRequestBuildsProvidersOnce: two streamed requests, one build each (3 each before). Red with holdCatalog taken out. - TestAuthParsedOncePerVersion: 100 rounds of Auths, SignedIn and the listing proxies parse plugin-auth.json zero more times; a caller's edit doesn't leak; a same-size rewrite is read; a zeroed file reads the .bak and stays signed in. Red with authRaw reading past filememo. - TestAccountDiscoveryOffParsedOnce: 100 calls, no parse; a Save is read. Red with AccountDiscoveryOff back on Load(). - gofmt -l clean; go vet -tags nogui on darwin, linux and windows ok. - Full suite, set -o pipefail; go test -p 4 -timeout 45m ./... at this pair rebased on |
||
|
|
75245b73c1 |
gui: a plugin's page in the desktop window names wails:// in its policy, so its bridge loads (#2501)
XYenon (#2501): on macOS the Plugins page stops answering after 10s. A plugin page is served in a frame with sandbox="allow-scripts", and its CSP named its own folder as a scheme-less source (localhost/p/<tok>/). Under wails://, WebKit doesn't match a scheme-less host source, so the page's bridge.js was refused and the page never said it was ready. ownWindow now records the scheme of the native handler's base URL (wails on macOS and Linux, http on Windows, as Wails v3 beta.24's assetserver_<os>.go sets them) in the request's context, and pagePolicy writes that scheme in front of the page's own source. Web requests have no scheme in the context, so the browser GUI keeps its relative source and still works over HTTP, HTTPS and reverse proxies. The patch and its test are the reporter's. The test now uses Wails' real hosts (wails://localhost, or http://wails.localhost on Windows), not a made-up one. What was run: - A WKWebView harness (Swift, a WKURLSchemeHandler for wails://) loading a page in a sandbox="allow-scripts" frame with the old and new CSP: with localhost/p/T/ the handler is never asked for bridge.js; with wails://localhost/p/T/ it is. At top level, with no frame, both load. - TestPluginPageWindowPolicy fails on the old pagePolicy (bridge.js refused for the desktop case) and passes now. - gofmt -l clean; go vet -tags nogui on darwin, linux and windows ok. - Full suite, set -o pipefail; go test -p 4 -timeout 45m ./... at this pair rebased on |
||
|
|
fa5295d011 |
panel: a Manual routing group's model is switched from the tray panel (#2489)
Jerell.OvO asked on Discord (#general) to change a Manual group's model
from the tray's dropdown. Until now that worked only on the group's card
on the Routing page or with `magpie group pick <id> <model>`.
- provider.PickGroup(id, pick) sets a Manual group's Pick and nothing
else. It refuses a group that doesn't route by hand, a model not in
the group, and an unknown or hidden group.
- POST /api/groups/pick {id, pick} calls it and answers with the groups'
state. The panel doesn't send the whole group back the way the card's
save does, so a stale panel copy can't overwrite an edit made on the
Routing page in the meantime.
- Tray panel, Routing tab: under today's totals, one row per Manual group
of two or more members that is on. The row has the group's name and its
picked member as a sess-pick button. The button opens the app's menu
(openProtoMenu, no native select), headed "Model every request goes
to". It lists the members with the card's notes ("fast", the provider,
and "no provider serves it now" for one not ready), and the picked
member is ticked. Picking the ticked one posts nothing. No new layout,
no left border.
- The tab reads the groups again when it is shown, and loadGroups redraws
the panel. A pick made on the Routing page or from the CLI shows here.
- New string in zh, zh-TW, ja, de.
Tests:
- TestPickGroup (provider): switches and routes to the new member, keeps
the rest of the group, refuses the three cases and changes nothing
then. Red with the `g.Pick = pick` line removed.
- TestGroupsPick (gui): /api/groups/pick answers with picked = the new
member and refuses a non-member.
- panel-routing-pick.test.cjs: a 440px panel in Chromium and WebKit, in
en, zh, zh-TW, ja and de. 10/10 pass. Red with the row left out of
renderPanel. Screenshots were checked in de (web) and zh-TW and en
(app).
- gofmt -l clean; go vet -tags nogui for darwin, linux and windows: clean.
- GUI subset (panel-*, routing-*, i18n-*, header-relang,
agent-notice-lang; 1199 cases) on 63be47717+this: 1175 pass. Each red
was rerun file by file on this head and on a clean
|
||
|
|
ba132d68b6 |
plugin: the GitHub plugin list reads every page of the search, not the top 50 (@HoGee_xxl on X)
@HoGee_xxl on X: the Plugins page's GitHub list showed 50 repositories
while the opencode-plugin topic held 59. askTagged asked GitHub's search
for one page of 50 and stopped, so every repository past the 50th by
stars never showed. It now reads pages of 100 until a short page or
total_count, up to the 1000 GitHub's search answers, and a repository
that moves between two pages (starred in between) is listed once.
Run:
- TestTaggedReposEveryPage (new): a fake search of 7 repositories served
2 a page; all 7 listed, in order, once. Red with the page loop broken by
hand (stop after page 1): only the first 2 listed.
- Full suite at
|
||
|
|
53009f81a4 |
provider: every mover's min is the plugin that closes its gap with the built-in
Moved users are kept on these versions by keepMovedCurrent, each on npm
(npm view --prefer-online):
- devin 0.1.20: JSON output when asked; tool result images on the tool message
- commandcode 0.1.13: Credits reset at the subscription's end (#2454)
- cursor 0.2.18: a failed tool result read as isError; keychain backoff
- zed 0.1.8: "No plan" for a free account
- zcode 0.1.19: personal and team resets; Start Plan hint
- kiro 0.1.12: JSON output (output_config.format)
Run at
|
||
|
|
5b6fe16975 |
provider: a plugin sign-in whose page can't post back takes a pasted key (#2468)
Command Code's plugin sign-in opens Studio, which posts its key to
127.0.0.1; in Docker or on another machine nothing comes back. The sign-in
now asks for the key in place (PasteKey with the keys page), and a pasted
key is saved as the plugin's own api account (plugin.APIKey). An address
or a key with spaces is refused and the sign-in keeps waiting. The GUI
offers no second "Use an API key instead" beside it.
TestPluginSignInTakesAPastedKey and signin-paste-plugin.test.cjs
(chromium, webkit; en, zh: 8 pass) go red without it; the four sign-in
GUI files together pass 22.
Run at
|
||
|
|
ee1df7e7a5 |
provider: a Factory API key moves to the plugin as its own key account
A Factory account added by its fk- key moved as an oauth sign-in with no
refresh token, which the plugin would try to renew and then lapse. It now
moves as the plugin's "Factory API key" sign-in saves one (type api, key,
whoami's metadata), and comes back as a key. A moved Factory's Import of
API keys sends them to its plugin (factoryKeyToPlugin), so the GUI no longer
hides Import for a moved Factory.
TestFactoryKeyMover, factory_key_test.go and plugin-moved-signin.test.cjs
(chromium, webkit; en, zh) go red without it.
Run at
|
||
|
|
7ba1b49846 |
plugin: a plugin's usage resets carry the team's and each window's
ZCode's built-in showed the personal plan's and the team's resets with each
reset's end; a plugin's usage could carry only one. host.js now passes a
plugin's resets.team and resets.each through, and movedCards shows them as
the built-in did. zcode 0.1.19 sends them.
TestPluginUsage's team and each check (plugin_usage_test.go) goes red without it.
Run at
|