72facf72e2ff87c481a6728de5a35dfccd59ffdf
2292
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
72facf72e2 |
memory: a search or save can name its project, and every answer says whose and where (Norethcy on X, #6392)
The memory tools had no target-project argument and no way to see the caller context they resolved, so a scoped migration run from one project couldn't keep memories for another or check where they went. - memory_search and memory_save take `project`: a folder on this computer (absolute, or relative to the caller's own folder), or the key of a project memory knows (github.com/owner/repo, with or without project:, or a project's one name). A project named goes with scope project (a save's default then) or a search's all; global or agent with a project is refused, and an unknown project says which ones memory knows. - Answers name what was used: a memory reads "this project (<key>)" and "only for you (<agent>)", and a search ends "(looked in: everywhere, project <key>, agent <id>)". - New read-only memory_context: the agent the server takes the caller for and how it was found (router _meta, magpie mcp memory's initialize, key/User-Agent, the session's initialize), the project with its folder and source, the scopes a search looks in and the server version, as text and structuredContent. Given `project`, it shows that one. - HTTP and stdio are the same server (magpie mcp memory relays), and OwnMCPTools lists memory_context with the others. Run (mote, -tags nogui unless noted): - TestMemoryMCPProjectArgumentAndContext (new): folder, key and relative folder; the caller's own project untouched; refusals; memory_context's text and structuredContent; tools/list. Red with the project argument ignored by hand. - TestMemoryBridgeContextAndProject (new): the real gateway behind magpie mcp memory over stdio, initialized as codex as in the report. - go test ./internal/browsermcp ./internal/cli ./internal/library: ok; go test -run 'Memory|OwnMCP|Hub|RootDirs|Tool' ./internal/gateway: ok. - Windows (xiaomi-gpu, win-run): the new gateway, browsermcp and cli tests ok (a test's own unquoted Windows path was fixed on the way). - go vet darwin, linux nogui, windows for the four packages; gofmt. Not tried: Codex desktop itself over /mcp/run/magpie-memory; the full suite runs after the tag. |
||
|
|
c2fd48782b |
Put back what 1f05c311d took out of main by mistake
|
||
|
|
1f05c311d9 |
library: an open memory holds still while the Memory tab polls (Nietzsche_Li on X)
"资源库-记忆中,被展开的记忆的表单会定时抖动". While search by meaning
still has memories to read (read < of, which can last up to a minute
between memembed.Keep's reads) or a learn-from-conversations run goes,
the Memory tab reads its row again every 2s, and each read drew the
whole page anew. The open editor was a new .lib-detail each time and
played its content-in entrance (opacity .5, 2px slide) every 2s.
- semWatch/distWatch draw nothing when the read changed nothing, and
redraw only their own row (redrawRow) when it did; the whole tab only
when the memories changed.
- render() marks a .lib-detail open before it (same data-detail) as kept,
so it doesn't replay its entrance. This covers every render of an
open editor in the Library: memories, instruction sets and agents'
files (the siblings; no other Library tab polls into render()).
- A new memory's text no longer takes the focus back on every render.
Run (mote): library-memory-steady.test.cjs, all 5 languages, 980/420,
chromium + webkit: green 4 of 4 whole-file runs after the last change
(webkit alone 2 of 2 before it). Broken by hand: the same test against
origin/main's client.js and library.css: 22 of 22 red ("the editor
played its entrance again"). One webkit de 420 red was the test's own
first row click intercepted by the header at 420px while the page
settled; the test now opens rows with a DOM click.
Also run, both engines, every language, 980/420: library-memory, library-memory-select, library-memory-suggest, memory-icon, library-instr-busy, library-instr-sets, library-linked-set, library-follow-server: all green. No Go code changed, so no go test or vet.
Not tried: the real app on a real memory store mid-read.
|
||
|
|
70f4593e62 |
provider: a key's typed balance can refill each day (Kelen_Yc on X)
A key's balance typed by hand refilled each month or each week. A relay
key with a daily allowance had no way to say so. Now it can refill each
day, at local midnight, like the others:
- provider: Refill{Every: "day", Day: 0} (RefillDay). Last is today's
midnight in now's location, Next tomorrow's. check takes it with day 0
only; ParseRefill reads daily/day/d (daily:1 refused); String is
"daily". A magpie before this drops such a refill on read, as one
written by hand that isn't one, and counts from when it was typed.
- CLI: `magpie provider key-balance <id> <key> --refill daily`; usage
lines updated.
- GUI: the pill's menu has "Refills each day" after "Refills each
week…", posting {every: day, day: 0} at once (no day to pick, so no
ellipsis), with its toast; en, zh, zh-TW, ja, de.
- docs/subsystems/providers-accounts.md names it.
Tests: TestRefillDays gains daily rows (midday, exactly midnight, a
month's and a year's end, Asia/Shanghai). New
TestTypedBalanceRefillsDaily holds the clock in Pacific/Kiritimati
(UTC+14), Pacific/Pago_Pago (UTC-11) and UTC: a minute before local
midnight the spend counts from when it was typed, a minute after it
counts from local midnight and the next refill is the following one.
TestOwnBalanceParsedInYuanAndRefill and TestTypedBalanceRefills cover
parsing, the bad {day, 1}, and read-back; TestKeyBalanceCmd sets
--refill daily. key-own-balance.test.cjs picks Refills each day in
every language, both engines, 900 and 400px, checks the post and that
the menu then shows it picked.
Run on mica at
|
||
|
|
4431e31f7c |
library: a project gets subagents of its own, per agent (jinpwng on X)
The Subagents tab now lists the projects as Skills and MCP do. Opening
a project shows each library subagent with chips for the agents that
read a project's own subagent folder: Claude Code (.claude/agents),
Codex (.codex/agents, TOML), OpenCode, Gemini CLI, Qwen Code, Droid
(.factory/droids), Cursor and Copilot (.github/agents/*.agent.md). A
tick writes the subagent into that project only, in the agent's own
format; the agent's global folder and other projects are untouched.
Each file is recorded by its hash and rewritten or removed only while
it is exactly as magpie wrote it, so a same-name file of the user's is
left alone. A rename in the library follows into each project. The
files are kept out of git by the project's info/exclude block, and
follow the repository's other worktrees (syncTrees now copies
Subagents, and clears it for a worktree let go).
POST /api/library/projects/subagents {dir, name|names, agents}. No CLI
yet, like project servers. Hooks, instructions and Claude plugins have
no project scope yet (filed separately).
Run (mica / mote via mica-run, mote-run):
- go test -count=1 ./internal/library ./internal/gui: ok
- node --test, chromium + webkit: project-subagents, project-scope,
project-servers, project-skills-pick, project-skills-groups,
project-remove-keep, library-subagents, library-all, library-items,
i18n-keys, i18n-en-no-cjk, claude-subagents-pick,
codex-subagents-lead, subagent-effort: 150/150 pass
- gofmt -l clean; go vet darwin, linux -tags nogui, windows on
internal/library and internal/gui: ok
Broken by hand: dropping Subagents from syncTrees' copy made
TestProjectSubagentsFollowWorktrees red ("the worktree hasn't the
project's subagent"); the earlier session broke the fix by hand and
saw the new library tests go red.
Not tried: a real Claude Code/Codex session picking up the project
subagent; the full go suite (started after the tag); Windows/Linux
runs of the GUI.
|
||
|
|
610ae1f541 |
library: handing skills over turns off the all-in-~/.agents/skills setting and takes magpie's links out (ConatusMoon2222 on X)
Put skills in "~/.agents/skills" (SharedSkills) gives every agent that reads
that folder every skill, so it cannot go with choosing agents per skill,
which is what "Manage in magpie" (HandOverSkills) is for. With the setting
on, a handed-over skill's entry was taken away and the next sync linked it
back there, so the link stayed (reproduced in a sandbox HOME). Handing over
now turns the setting off in the same write; the sync then removes magpie's
own links there (sweepShared: only ours, never the user's entries). The
confirm sheet says so, only while the setting is on. The Put skills in note
says the skill router lists nothing while every skill is in
~/.agents/skills (the "none" the reporter met), only when both are on.
Strings in zh, zh-TW, ja, de.
Run (on mote, at this tree):
- TestHandOverWithSharedSetting: red with the l.SharedSkills = false line
commented out ("a link is left in ~/.agents/skills"), green with it.
- go test ./internal/library ok; go vet darwin, GOOS=windows, linux nogui
on internal/library ok; gofmt -l clean.
- GUI: skill-handover, shared-skills, i18n-keys, i18n-en-no-cjk in chromium
and webkit, 23/23 each.
Not run: the full GUI suite and go test ./... before the tag; a real
account's Library; WebKitGTK.
|
||
|
|
52830b077b |
site: the build attestations are kept on R2 beside the release files (ArcticLampyrid on X)
The SLSA attestations live behind GitHub's API only, so with GitHub down they could not be fetched while the mirrored files could. The five-minute cron now also asks api.github.com/.../attestations/sha256:<digest> for every file of a release from v0.1.3891 on and, once every file has one, writes <tag>/attestations.jsonl to R2 (a Sigstore bundle per line, deduped), served at usemagpie.ai/files/<tag>/attestations.jsonl. It is written only whole, so a file with no attestation yet is asked again next run, and it is pruned with its tag. `gh attestation verify <file> -R yetone/magpie-releases --bundle attestations.jsonl` checks a download with it. It is not a release asset: the GitHub release keeps its 17 assets and release CI is unchanged. start (en, zh, ja), llms-full.txt and reference.md say where it is and how to verify. The updater does not read it yet. Run (mote): node --test site/*.test.mjs 118/118; gofmt n/a. New tests: bundles land once and only whole; pre-0.1.3891 release not asked. Broken by hand: ATTESTED set to 9.9.9 turns the bundles test red. Not tried yet: the real cron run and the file on R2 (after deploy), the updater reading it from R2, gh --bundle on a real downloaded file. |
||
|
|
861a0442c1 |
agent: Codex in a running WSL distro is connected once Codex on Windows is (@not_4O4 on X)
The Codex app's work mode on a project whose run environment is WSL starts
its app-server inside the distro, on the distro's ~/.codex (the app resolves
CODEX_HOME there with `bash -lc 'printf %s "${CODEX_HOME:-$HOME/.codex}"'`).
magpie wired Codex on Windows and, as a separate Agents row, the distro's
twin (codex@wsl:<distro>) only when the user connected that too, so the
picker listed OpenAI's models alone there.
ConnectCodexTwins, run at the start of each SyncCatalog, connects the twin
of each running distro once while Windows' Codex is connected. It leaves a
twin alone that is connected or disconnected already, whose config names a
provider or base URL of the user's own, or whose distro is stopped (asking
one starts it). A stash mark (<id>.autoconnected) keeps it to once, so a
later Disconnect stands. docs/subsystems/agent-wiring.md says so.
Run: TestConnectCodexTwins and TestConnectCodexTwinsKeepsOwnProvider; go
test ./internal/agent on mote (ok, 305s); TestWSL* and the new tests on the
Windows box (ok); gofmt; go vet darwin, linux and windows (nogui).
Broken by hand: Windows-connected check removed (red), own-provider check
removed (red). The Disconnected check is covered by the mark alone.
Not tried: the Codex app itself with a WSL project (read its bundle for the
CODEX_HOME resolution only); the reporter's distro and networking.
|
||
|
|
cba704d5f0 |
library: with the skill router on, the page says when no skill is listed for an agent and when its own skills stay in its prompt (ConatusMoon2222 on X)
ConatusMoon2222 turned the Skill router on and reported it "does not take
effect". Reproduced in a sandbox HOME: the router lists only the library's
skills ticked for an agent. An agent with nothing ticked, or each skill kept
direct, got no magpie-skills, yet its row said "on"; and skills in an
agent's own folder that the library lacks stay in its prompt with no word
on the page.
AgentView.SkillRouter is now "none" for an agent whose folder takes the
router but has nothing listed (Applied.Router false), and the Skills tab
names those agents, and the agents that have skills of their own the
library lacks, under the switch (.lib-hub-why data-why none / found). Four
languages (zh, zh-TW, ja, de). docs/subsystems/skill-router.md updated.
Run on mote: go test -tags nogui ./internal/library (ok, 260s);
skill-router.test.cjs in chromium and webkit, all four languages, narrow
and wide (22 pass, with the new found line asserted); go test ./internal/gui
Asset/Budget/Script ok; gofmt clean; go vet nogui darwin/linux/windows clean.
Broken by hand: sync.go back to the parent, TestSkillRouterLastSkillUnticked
goes red ("nothing listed, the view says on").
GUI i18n-*, library-*, skill-* files: all green except skill-fold-all and
skill-manual, red on origin/main from the window's /api/update/using POST
(#5982, not this change).
Not tried: a real agent on Windows; the reporter gave no agent, OS or
version, so the cause for their machine is inferred, not confirmed.
|
||
|
|
648cd3fdbb |
gateway: the management API leaves other keys that manage magpie alone
|
||
|
|
5f1a642b42 |
docs: a commit's tree is origin/main plus its own change, in the code standards
Seen a third day: |
||
|
|
926b1e7dfb |
provider, gui: put back what 8c7328f3a took out of main by mistake (35aaaa4b9, 2fa79aef3, 797a23cad)
|
||
|
|
f1f512c1ec |
library: a repository's heading folds an agent's profiles into one chip, and a row's profiles chip lines up with the hand (Yanzhongixuy on X)
0.1.3926, several Hermes profiles: the Skills page's source headings (anthropics/skills ...) drew one icon per profile, a long strip, and the one chip |
||
|
|
8c7328f3a6 |
remote quotas: a Remote set to Select none still tells its cards (@LOYSoLuI4PG4WlN on X)
On 0.1.3929 a Remote magpie added for the Usage page's quotas showed none of the remote's subscriptions any more. |
||
|
|
35aaaa4b94 |
codex: a setting for which client the requests to ChatGPT say they come from, CLI or Codex Desktop (ouhthuo on X)
ouhthuo wants the originator "Codex Desktop", with which, they say, a high-effort gpt-6.1-sol request is routed to a newer model. magpie sent codex_cli_rs on every request, and codexSign even overwrote a real Desktop's own originator. Settings > Codex > "Codex client" (CLI, the default, or Codex Desktop; the settings key codexClient is "" or "desktop", POST /api/settings/codex-client, no free text). codexClientHeaders is the one place that sets originator and User-Agent, so the model requests, the /wham usage and reset calls, the token refresh, the device and code sign-in exchanges and "test as" all follow it. Desktop sends originator "Codex Desktop" and the UA shape codex-rs builds for it: Codex Desktop/<codex version> (<os>; <arch>) unknown (Codex Desktop; <app build>). Source: codex-rs login/src/auth/default_client.rs and a captured Desktop UA. The default is unchanged; base_instructions and the identity prompt are untouched. The OAuth authorize URL keeps codex_cli_rs. The row sits in the Codex agent preferences, 5 languages. The two Codex menu buttons share one helper (codexMenuPick) so app.js stays inside its budget without raising it. Run (mote): TestCodexClientSetting (red with codexClientHeaders ignoring the setting), settings, settingsapi, gui and provider Codex tests ok; gofmt clean; go vet darwin, windows and linux nogui clean; GUI codex-client, codex-service-tier, codex-open-button, i18n-keys, i18n-en-no-cjk, settings-general, click-scroll in chromium and webkit ok. Real Codex account in a sandbox HOME: gpt-6.1-sol and gpt-6-sol at high effort answer under both identities with identical usage; the reply's model field only echoes the requested name, so whether the served model differs can't be told from here. Red and not mine, already filed: settings-search (#6133, #5982) and agent-prefs "Settings line" (#6139) fail on origin/main, TestMoveToPlugin #5524. Not tried: the real Desktop app (not installed here); the app build number in the UA is the newest seen in local logs and can go stale. |
||
|
|
8097860ab1 |
gui: put back what 76ceff87c took out of main by mistake
|
||
|
|
76ceff87c9 |
usage: a number of hours the reader sets, beside the calendar (eachg0 on X)
The range menu behind Custom has a top row, "[N] hours back". Enter asks the Usage page for the rolling window last:Nh (1 to 720), which the backend already answers for every view (totals, chart, models, accounts, Requests); the chip reads "Last 30 hours". The pick and N are kept on this device (magpie.usagePeriod, magpie.usageHours). 24 stays the preset's chip, and an empty page, the credit days and the menu-bar way in know the new period. zh, zh-TW, ja, de strings added. Run (mote, at the rebased head): usage-hours, usage-24h, i18n-keys in chromium and webkit, en and zh. Broken by hand: keptPeriod limited to the presets turned usage-hours red (expected last:30h, got today). Not tried: the whole GUI suite (queued on mote's suite.lock behind other sessions, still running), narrow widths by hand, the tray panel (it has no 24h chip and is unchanged). |
||
|
|
7c37424fcf |
gui: the Linux app draws without backdrop blur, which WebKitGTK repaints on the CPU each frame (Lsheng2012 on X)
Lsheng2012 (CachyOS, KDE, i7-12700H, RTX 3070 Ti Laptop) found the UI laggy. webkit_linux.go turns accelerated compositing off under Wayland and without a GPU, and there every backdrop-filter is software-painted for its whole box each frame. body.linux now drops it on .modal, .pop, the panel's profile chips, Settings' sticky head and the confirm ::backdrop. Layout unchanged. Measured (WebKitGTK 2.52.6, Xvfb on magpie-desktop, 240 rAF scroll frames of 600 rows, 1100x760): no blur 16.2ms, sticky head blur 16.2ms, full-window modal blur(8px) 25.0ms with compositing off (16.4ms with it on). Run: linux-no-backdrop-blur.test.cjs in chromium and webkit on mote (green; red with the rule removed by hand), go test ./internal/gui asset tests. Not tried: NVIDIA, Wayland/KDE, the omarchy VM, a full suite. The sticky head cost nothing in the probe, so the modal is the measured gain; if the reporter is still laggy the cause is elsewhere (CPU painting at HiDPI), and we ask for their session type, driver and version. |
||
|
|
bbce1fc1ab |
update: the updater checks a download's GitHub build attestation too (ArcticLampyrid on X)
Release CI attests every file (SLSA provenance through Sigstore, v0.1.3891 on). The updater now fetches the bundle for a file's signed SHA-256 from api.github.com/repos/yetone/magpie-releases/attestations/sha256:<digest> before it downloads the file, and verifies it with sigstore-go against the Sigstore trusted root embedded in the binary (attest_root.json, public good instance): certificate chain, certificate timestamp, Rekor entry, issuer token.actions.githubusercontent.com, subject release.yml of yetone/magpie-releases on main or a v* tag, source repository yetone/magpie-releases, and the digest among the statement's subjects. It is in addition to the ed25519 check over SHA256SUMS, which still runs first and still works offline and from the R2 mirror; the attestation is asked about the digest that signed list gives, so both speak of the same bytes. When the attestation can't be had (a failed read means "unknown", but an outage of GitHub must not take updates away): - a bundle that is there and fails (signature, identity, digest, a chain outside the trusted root), GitHub answering 404, or an empty list: the file is refused. GitHub was asked and says these bytes weren't built by that workflow. - GitHub unreachable, rate limited (60/hour anonymously), 5xx, a body that isn't JSON, or Settings' update source set to the site alone (which never goes to GitHub): the update goes on, since the ed25519 check has held, and the log says the file went unattested and why. Someone who can only drop the API call downgrades an update to the ed25519 check, never below it. - releases before 0.1.3891 and a MAGPIE_UPDATE_FEED of your own are not asked. The bundle checks itself, so the API call goes through source.Do and may use a mirror. Cost: go.mod gains sigstore-go v1.1.4 and its tree (go.sum +350 lines). The embedded root has to be renewed (gh attestation trusted-root, first line) when Sigstore rotates its keys; docs/reference.md says so. Until then a chain under a new key fails as "not attested" and is refused: a known cost, in the doc. Run (mote, sandbox HOME via testenv): go test ./internal/update (ok), site node tests (112 of 114; docker-tags and the sponsors README test fail because mote-run -C site cannot see ../README.md, unrelated), gofmt -l empty, go vet darwin, GOOS=linux -tags nogui and GOOS=windows on internal/update, go build ./... on all three. Fixture: the real answer api.github.com gave for v0.1.3925's SHA256SUMS (testdata/attest), verified offline; the whole run reaches no network. New tests: TestAttestationOfARealBundleHolds, ...OfAnotherDigestRefused, ...TamperedRefused, ...EditedPayloadRefused, ...WrongIdentityRefused (repo, workflow, ref, source repo, issuer each), ...NoneListedRefused, ...UnknownGoesOnAndSaysSo (403, 429, 502, HTML, nothing listening), ...OnlyWhereItIsOwed, TestVerifyMarksAttestedReleases, TestDownloadRefusedWithoutAttestation. Broken by hand: identity check swapped for WithoutIdentitiesUnsafe turns WrongIdentityRefused red on all five cases; the attestedFile call removed from download turns DownloadRefusedWithoutAttestation red (the file was fetched). The first full run of the package, before TestMain pointed the attestation API at a closed port, had TestSourceSiteAndAutomaticUseTheSite reach the real GitHub with a made-up digest and be refused: now closed. Not tried: a real update end to end (needs a release newer than the running binary; the unit path covers download), Windows box, the GUI, full suite (starts after the tag). Docs: docs/reference.md, start.html (en, zh, ja) and llms-full.txt say what the app checks now. |
||
|
|
6edf7a69e5 |
usage: hide and show single quota rows of an Overview card (wangshaowei39 on X)
Antigravity's card lists Claude & GPT, Gemini and more. A row group can now be
hidden from Usage > Overview the way a card can: right-click or long-press a
row, or use the card's "..." menu, and choose "Hide <group> from Overview". The
"Hidden" line under the cards lists hidden cards and rows with an Unhide button
and Show all. The last group of a card cannot be hidden (use the card's own
hide). Persisted as settings usageWindowsHidden ("<card>|<group>"), changed
through /api/usage/arrange { windowsHidden } and kept by the Settings save.
Table view and tray panel are untouched.
Run (on mote):
- go test: TestUsageArrange*, TestUsageArrangeWindowsHidden (new), TestSettingsSave*,
settings_keep guard, TestCoreScriptBudget, ./internal/settings, ./internal/settingsapi;
gofmt clean; go vet darwin, linux nogui, windows.
- GUI, chromium and webkit: usage-rows-hide (new, 5 languages x 1200/560/390;
32/32), usage-card-more 32/32, usage-arrange, usage-all-accounts 24/24,
i18n-keys 4/4.
- usage-cards-hide and usage-hidden-way-back: "de 560" red (no sideways scroll
635 vs 560); the same red on a clean origin/main
|
||
|
|
e18aca1038 |
agents: an agent's own context window, and a routing group's own Compact at (ul3140773077392, NovaStudiosss on X)
ul3140773077392 on X: dsh compacts earlier than other harnesses at the same
window, so one global size per model fits none. An agent's sheet (Agents,
the agent's Settings line) now holds "Context window": a size for every
model, or model=size pairs (provider/model, group/<id>, provider/*, a bare
model id, *). Empty follows each model's own window. It is applied in
provider.CatalogFor, the choke point every agent's model list goes through,
so dsh's contextWindow, Codex's catalog and Claude Code's window all read
it, and a window set this way makes Codex/Claude compact at that window
(Entry.WindowSet). Stored in settings.AgentContexts, kept by a general
save (settingsapi); POST /api/settings/agent-contexts and
`magpie model window <agent> [model=size...|off]`.
NovaStudiosss on X: Routing, a group's Edit, Advanced already had "Context"
(the window agents are told). It now has "Compact at" beside it
(Group.Compact; compactSet reads it before the members' smallest), also
`magpie group ... compact=`.
GUI: agentwindow.js, loaded on demand through agentcompact.js so app.js
stays inside its budget (TestCoreScriptBudget passes; the "Context window
in {agent}" label reuses the existing "Context window" key). Every agent
with fields now has a sheet; agent-prefs' Pi expectation says so.
Run at the pushed head, on mote: go vet (darwin; linux -tags nogui;
windows) on provider, agent, cli, gui, settings, settingsapi; gofmt clean;
go test provider, cli, settings, settingsapi, gui (TestCoreScriptBudget
and cli's route table fixed here), agent -run Dsh; node --test agent-window
and group-compact (chromium and webkit, en zh zh-TW ja de, 900 and 420px),
agent-compact, agent-prefs, compact-at. Reds seen identically on a
detached origin/main
|
||
|
|
477bbb7a15 |
usage: GET /v1/magpie/usage/requests?cursor= reads requests as changes, with stable ids (rdsaltbo on X, #6060)
A program keeping a ledger of its own (a WakaToken plugin) can now read the requests incrementally: cursor=start or cursor=now, then each next_cursor. Rows carry a stable content-derived id (same after a restart), origin, and original_ids (request_id, response_id, client_response_id, message_id, session_id, native_session_id), each only when the source gave it. A call read late, a corrected row (same id, higher seq) and a native row replaced by the gateway's (deleted, with seq) all come through a persisted journal (usage-feed.jsonl, appended and synced before answering). Cursors magpie cannot resume from are refused: 400 cursor_invalid / cursor_filter_changed, 410 cursor_expired / cursor_reset. A held key sees only its own rows and tombstones. Without cursor, offset/limit mode is unchanged. Also: Record.MessageID (not persisted) from the agent file's message id, and usageapi's row decoration moved into a namer shared by both modes. Docs: reference.md, integrating.md, gateway-routing.md, gateway-sessions.md, site remote.html (en/zh/ja), llms-full.txt. Run (mote, this tree): go vet darwin, GOOS=windows, GOOS=linux -tags nogui on usage, usageapi, gateway (gui on darwin); go test -count=1 for internal/usage, usageapi, gui, gateway: all ok. New tests: resume gets exactly the new rows, ids and cursors survive a restart, correction keeps the id, gateway takeover retires the native row, refused cursors, expiry, now cursor, identical records, and the feed over the gateway (held key, 401 without key, offset mode). Broken by hand: an unconditional memo made the new-rows test red (fixed to memo only the next page). Not tried: real Claude Code/Codex session files, a huge (700k+) history, Windows run of the tests, GUI browser suites (no GUI file touched). |
||
|
|
59c9887f65 |
search: web_search takes sites, recency and images; the ChatGPT backend gets them as its own fields (LBM_OASIG on X)
The web-search MCP tool gains optional allowed_domains, blocked_domains, recency_days, images and search_context_size. Codex search (/alpha/search, codex-rs codex-api search.rs) gets them as the fields web.run has: a query's domains and recency, image_query for images, settings.filters, search_context_size, image_settings. Every other searcher is asked the sites as site:/-site: operators and ignores the rest. Image results read as pages whose text starts "Image: <url>". Arguments travel in ctx, never in a request body. Schema text names neither magpie nor a vendor. Run: real Plus account, curl to /alpha/search with image_query and with domains+recency+filters: both accepted, image reply shape recorded in TestImageResultsReadAsPages. New tests (search_scope_test.go) use the fake backend; go test ./internal/gateway full on mote: only the count schema tests red (a boolean default), fixed, then -run Search|Codex| ChatGPT|ImageResults ok; vet linux/windows clean. Not tried: through a running sandbox magpie end to end; GUI untouched. |
||
|
|
c96f33d659 |
agent: Hermes is one entry in the Agents list and the model pickers; its profiles are not rows (geekbb on X)
|
||
|
|
3bbd8ceaaa |
routing: Least used first counts a small check-in reward about to lapse (kudi3699 on X)
kudi3699 again: v0.1.3877's Lapsing faded the lost share across the week and needed 0.5 points. A WorkBuddy check-in reward is a few dozen credits (20 of a 5100 pool is 0.39 points, less the fade), so it stayed under the threshold until its last hours and the half-used account was still never picked. The plugin side is fine: mover min is 0.2.29, past 0.2.27 that reports check-in rewards' runsOutAt/runsOut, so no plugin change. Allowance.Lapsing is now the whole loss in points when RunsOut is within 7 days, none past it (no fade); routes.lapsingMin is 0.1 points. A seat at 90%+ is still not helped. Run (mote): go test internal/routes, internal/provider -run "Lapsing|LeastUsed|Allowance", internal/gateway -run "WorkBuddy|LeastUsed|Smart|Pace|Routing"; go vet -tags nogui for linux, windows, darwin on the three packages; gofmt clean. Broken by hand: lapsingMin back to 0.5 turns TestLeastUsedSpendsSmallCheckInRewardSixDaysOut red (20 credits, 6 days out, old 50% vs new 20%). Not run: the full suite (after the tag), real WorkBuddy accounts. |
||
|
|
10a27651f0 |
usage: a window's whole is kept across its reset until the new one tells its own (Musikrv77852 on X)
After Kimi Code's 7-day window reset with nothing used, the card lost its "Whole ≈ N tokens" until the new week passed 5% used. The reckoning is every provider's (usage.WithWindowHolds), so the fix is too: carryHolds keeps the last whole told for each account's window (window-holds.json, temp-and-rename) and, where the new window is under the floor or has none routed yet, shows it with holds.prevAt set. The tooltip reuses the past cycle's "Estimated from the window that began X, read Y" line; no new label. The new window's own figure replaces it as soon as it can be told. Run (mote): TestWholeKeptAcrossReset (reset with 0% and 2% used, restart from disk, same-window under floor, other account, new window with data), go test ./internal/usage ./internal/provider ./internal/gui (only TestCoreScriptBudget red until its +10 here), quota-holds and quota-curve GUI files in chromium and webkit (all 5 languages x 360/1000px for the new case), gofmt, go vet darwin/linux/windows for usage and provider. Broken by hand: carryHolds returning early reds the Go test and the GUI case; dropping the prevAt branch in app.js reds the GUI case. Not tried: a real Kimi account across a real weekly reset; a full ./... suite before the tag. |
||
|
|
d0a4e0be6f |
lessons: a size budget is met, not raised, moves into the code standards
coreScriptBudget rose four times on 11-12 ( |
||
|
|
a2feeb11a0 |
update: pick the update source by hand, Automatic, usemagpie.ai only or GitHub only (RootSir, Sakugar_ on X)
usemagpie.ai's download is slow for some users (Cloudflare R2) and GitHub
is the one that works for others. Settings > Network has an "Update source"
menu button under App updates' proxy (the app's menu, no native select):
Automatic (default, as before: the site, then GitHub when the feed can't be
reached), usemagpie.ai only, GitHub only. Settings.UpdateSource ""/site/
github, this computer's own (KeepOwn), in settingsapi.Keys and Choices so
`magpie settings set updateSource github` works; any other value is refused
on save. The menu loads from assets/updatesource.js, so app.js (at its
budget) grows by one line.
GitHub only: latestAt reads yetone/magpie-releases without asking the feed,
and download starts at the file's github.com address (mirror and GitHub's
API route as before), never the site. usemagpie.ai only: no fallback to
GitHub for the release (fallsBack) nor for a file (toGitHub, toAPI off).
Stable and a MAGPIE_UPDATE_FEED of your own keep reading the site's feed
whatever the source says (Stable's release list is only the site's; its
files still come from GitHub on GitHub only). Every source goes through
Release.verify: ed25519 signature against the embedded key, the version in
the signed text, each hash from the signed list; a release read from GitHub
must be signed whatever its version. The update private key is untouched.
Run (mote, tree before the commit): gofmt clean; go vet update/settings/gui,
GOOS=windows and linux vet of update; go test internal/update, settings,
settingsapi, backup, cli ok; internal/gui TestCoreScriptBudget, assets and
i18n tests ok. GUI: settings-update-source (chromium and webkit x en, zh,
zh-TW, ja, de x 1100 and 420px: three menu items, each pick saves updateSource
alone, tick, no overflow), settings-update-proxy, i18n-keys, i18n-en-no-cjk,
settings-*, gui-* ok except the 22 subtests (gui-de/ja "has every zh string",
settings-hints, settings-lines-wrap de 440, settings-search) that fail the
same on origin/main
|
||
|
|
fd9033cbfd |
library: a synced skill keeps its library group (ConatusMoon2222 on X)
Cause. A skill's group is traced (tracer.repoOf) from files that belong to
one computer: the skills CLI's lock, a git checkout, CC Switch's record,
and Skill.From noted by an install-again or Group again. The sync bundle
carried none of it (CarriedSkill had Source, not From), and Put built every
skill as a new Skill, so the other computer had nothing to trace and put
the skill under "this computer". Group again only fetches repositories some
skill is already traced to, so with no skill traced it had nothing to start
from; and where it did group, the next sync's Put wrote the skill new again
and took it back out.
Change. Collect carries the traced repository as CarriedSkill.From for a
skill with no source of its own (none, or a folder). Put writes it as
Skill.From. When the bundle has none (made by a magpie before this), Put
keeps the From this computer already found for the same skill, and keeps
Skill.Gone ("kept on this computer only") for one with the same source.
Old data. Skills synced before this stay in "this computer" until one of:
the computer that has the trace updates and syncs (its bundle then carries
From, and Put applies it here), or Group again here, which works as soon as
one skill of the pack still names the repository (a skill installed from
GitHub carries its source); the result now survives later syncs. A pack
with no skill traced anywhere on the receiving computer has nothing to start
from there until the first computer has synced with this version.
Tests (library/carry_from_test.go), each red on the old code:
TestSyncedSkillKeepsItsRepo (lock-traced skill A -> B -> C),
TestSyncKeepsRepoFoundHere (old bundle, From found here kept),
TestRegroupAfterOldSync (old sync, Group again, then the same bundle
again). Broke Put's From by hand: first two go red.
Run on mote: go test ./internal/library ./internal/davsync ./internal/backup
./internal/gui ok; Library GUI files in chromium and webkit (see below).
Not tried: two real machines through S3 (the fake-S3 davsync tests pass);
a copy Group again bound to its repository is still unbound by a sync from
a computer that has it unbound (filed).
|
||
|
|
05cadcafd4 |
sync: a provider can stay only on this device (treydtw on X)
Providers sync between computers (WebDAV, S3, GitHub), so a model served
from one machine's localhost reached the others, where it can't be
reached. A provider now has "Only on this device": sync neither sends it
out nor lets a copy from another computer replace or delete it.
Provider.ThisDevice is set from the provider row's right-click menu
(Only on this device, a check when on) or `magpie provider this-device
<id> yes|no`, over POST /api/provider/thisdevice. davsync's collect drops
those providers and their order entries (provider.SyncedOnly); Mirror
skips an incoming copy of one and keeps the local ones; Restore keeps a
local mark. A normal editor save keeps the mark. File backups still carry
the provider with its mark.
Default is off for every provider, localhost included. A 127.0.0.1
provider is also what another computer runs for its own copy of the same
local server, and default-on would remove those copies on their next
sync; a LAN address is reachable from the other computers. Turning it on
at one computer removes the synced copy at the others on their next sync.
docs/subsystems/sync-backup.md says so.
The menu item gives no toast: its check mark is the answer, which also
keeps the core script budget at +151 bytes (1,263,700 to
1,263,851).
Run, on mica: new davsync TestProviderOnThisDeviceStaysOnIt (two
computers over a fake DAV) and this-device.test.cjs (chromium and
webkit, en zh zh-TW ja de, widths 1100 and 420); provider-find updated
for the new menu entry; davsync, provider, backup, cli, gui Go packages
ok except TestCoreScriptBudget, then fixed; vet on darwin, windows and
linux nogui clean. Broken by hand: SyncedOnly made a no-op turns the
davsync test red ("a sends its own model out"), and the Mirror skip
removed turns it red ("b after a's model synced"). GUI files that fail
in a loaded run (claude-quota-onboarding, provider-find, skill-fold-all,
usage-agents-hide, usage-cards-hide, usage-hidden-way-back) were run
alone on origin/main
|
||
|
|
5e933e153a |
agent: ZCode gets a Restart when magpie's models change while it runs (Flandern1211 on X, #5662)
ZCode reads its providers at start. Its Agents row now offers Restart for a
model list magpie changed while the app runs, as Claude Desktop's, WorkBuddy's
and OpenMausBot's do: restartApps has ZCode.app (dev.zcode.app) and
ZCode.exe, appReads covers config.json and provider_config.json, and
zcodePart hashes only magpie's provider, provider rule and model rules,
without the key or another provider's rules.
Patch by Flandern1211 (fork branch fix/zcode-restart-5662, 7b663fea9), read
line by line: three files in internal/agent, no network, credential, dependency
or .github change. Kept as written; this commit only adds the Restart line to
docs/subsystems/agent-wiring.md.
Run (mote, at this tree on origin/main
|
||
|
|
45dfdd9985 |
gateway: a conversation stays with who answered it for 30 days, 4096 kept (npikng161274 on X)
stickKeep was 24h and sticksKept 512. A long task picked up again after a
weekend lost its binding, the request went to another provider, and that
one refused the reasoning the first had sealed (invalid_encrypted_content).
Every answer already renews a binding, so only a gap over the keep let it
go. stickKeep is now 30 days and sticksKept 4096. No setting: the larger
default fits every case. Docs line in gateway-routing.md updated.
Run: TestStickSurvivesDaysAway (a 4-day-old binding saved and read back)
is red on the old 24h value ("a 4-day-old binding was lost") and green
now. Stick/Affinity/Sticks-named tests in internal/gateway pass via
mote-run; gofmt -l clean.
Not run yet: the full internal/gateway run and darwin/linux/windows go vet
were still going when this was pushed; results follow in a later commit
or note. Not tried: a real multi-day session. No GUI files touched.
|
||
|
|
900d1673d3 |
claude-desktop: a model listed by its 1M id runs to 1M, not the 272K working window (henglu486729 on X)
With Only each model's largest window (DesktopLongest) a 1M model is listed by its "[1m]" id, but Full window off still gave it the working window as its autoCompactWindow, so Desktop's Code tab compacted and showed it at 272K. desktopPlan's work() now leaves such a model at its whole window. A threshold typed in magpie (CompactAt, per model or provider), the user's own autoCompactWindow and a typed window still win. Listing and inferenceModels already carried the 1M (supports1m/prefer1m, max_input_tokens). Run (mote): TestClaudeDesktop* in internal/agent and Desktop|Claude in internal/gateway ok; go vet darwin, GOOS=windows, linux nogui ok; gofmt clean. New TestClaudeDesktopLongestRunsTo1M red on the old claude.go (glm entry ""), green after. Not tried: the Windows Desktop 5.1231.2 app itself (only 2.7032's bundle read); full suite is run after the tag. |
||
|
|
67f61bd789 |
gateway: a Claude account's plain rate limit on one model rests that model, not the account (kaitokiku on X)
v0.1.3817 and the fixes after it scoped Fable's quota refusals ("hit your
limit", "reached your Fable limit") to Fable. A plain 429 rate_limit_error
is failRate, and restAfterMarked rested the whole account for it, with its
backoff ladder and sink: Fable rate limited showed "限流 · 42 分钟后恢复" on
the account's Opus row too.
claudeModelRate: a Claude account's failRate that names no window that
counts every model (5-hour, session, weekly, usage limit, organization,
overage, or a representative-claim header of five_hour/seven_day) rests
that model only, in restAfterMarked, rateRest and the sink. Anthropic counts
rate limits per model. Quota refusals and account windows rest the account
as before. Messages, Chat Completions, Responses, groups and the Routing
rows share restAfter.
No real Fable 429 was available: ~/.config/magpie/usage.jsonl, rests.json
and app.log hold none, and Claude Code's bridge keeps no response headers,
so the rule is not checked against real anthropic-ratelimit-unified-*
headers. The account-wide limit the logs do hold ("You've hit your weekly
limit · resets 2pm") is in the test and still rests the account.
Cost if the guess is wrong (Anthropic applies a plain 429 to the whole
account): the next Opus request to that account gets its own 429, rests
Opus there, and falls over to the next account in the same client request,
as any rested candidate does; the user sees no error. One extra refused
request per model per rest. The test checks Opus's own rest and that
Fable's stays and a second account is not resting.
Run at this tree (mote): TestClaudeModelRateRestsThatModelOnly red with
claudeModelRate returning false (account rests, Model empty), green with
it; TestFallback* ok; gofmt. Package internal/gateway and internal/provider
run, and vet on darwin, linux and windows, were still running at commit;
results follow. Not tried: a real Fable-limited account.
|
||
|
|
5241308212 |
settings: a day can start at 0 to 6 o'clock (ssharpcc on X)
Settings > Usage > "Day starts at" (dayStart, 0 to 6, default 0; also magpie settings set dayStart 4). With 4, a call at 01:30 counts toward the day before: the Usage page (summary, charts, heatmap, ledger day filter, hour labels of Today) and the daily and monthly key caps (access.Window, provider.SpendCap.Window). internal/dayzone makes a time.Location whose midnight is the real day's hour:00 (TZif built from the zone's own offsets, same DST instants), so every place that cuts days by a Zone's midnight follows without edits; usage.Zone returns it and the "now" reads use it too. Run (mote): go test usage, settings, settingsapi, access, provider, gui, dayzone, also with TZ=UTC and TZ=Pacific/Kiritimati; gofmt; go vet darwin, linux nogui and windows; day-start, currency, number-units and i18n-keys GUI files in chromium and webkit, en zh zh-TW ja de; TestCoreScriptBudget. Broken by hand: TestDayStartsAfterMidnight red with 9 failures when the hour is ignored. New tests: dayzone over 5 zones x hours 1/4/6 x two years of days, usage, limit window, spend-cap window, day-start GUI. Not tried: a real log history in a real window. Not shifted, filed as #6314: the Sessions page, TUI sessions filter, davsync shared per-day files, gateway_sessions day keys, credits_daily. Rows are never stored in the shifted zone. |
||
|
|
d964031412 |
provider: a model's test can be sent to one chosen account or key (tmr11235 on X)
A provider with two or more accounts or keys that are on now offers
"Test on account..." in a model chip's right-click, an app menu (never a
native select) of those accounts' or keys' names. The pick is posted as
`account` with provider/test and pins the test (provider.TestOn,
accountNamed / keyNamed; an unknown or switched-off one is an error row,
not a silent fallback). Every result now names the account or key it went
to (Result.Account, set in probe), and the status line ends " - <name>"
for such a provider, whether the test was pinned or routing picked.
Test models and the CLI still test with routing's pick.
Core script budget raised 1,263,333 -> 1,263,700 (+367): the model chip
menu is core code and there is no page to move it to; the PLAY icon
literal was folded into one constant and the status call tightened first.
Run: gofmt clean; mote-run go test ./internal/gui ./internal/provider ok
(new TestModelTestPinnedToAKey, TestTestPicksNeedSeveral,
TestModelTestPinnedToAnAccount); model-test-account.test.cjs 10 of 10
(chromium and webkit, en zh zh-TW ja de) on mica. Broken by hand: with
the menu entry disabled the GUI test is 0 of 10. GUI batch model-*,
provider-*, i18n-*, gui-*: reds are the same on origin/main
|
||
|
|
36eebea136 |
update: the header's Update pill waits until it is news (certhon520, jkd6688, Yuyuaneth, milianxinqi on X)
A release comes every few minutes, so a downloaded update was always
waiting and the pill (window and tray panel) never went out. /api/update
now says "quiet" while this version has been behind for less than 3 days
(update.Quiet, the Stable channel's soak; counted from the first newer
version seen, kept in update-behind.json for the version running), and the
pill stays away. An urgent release ("**Urgent release:**" in the latest's
notes or any release between, fetched once per check) lights it at once and
a dismissal does not hide it. The x dismissal now also starts the quiet over,
so the pill is not back with the next release. Settings > Version, the tray's
Restart to update, quit and Restart automatically are unchanged. Plugins'
dot is for plugins that do not update by themselves; left alone.
Run (mote): go test ./internal/update (ok), go test -run Update|Asset|Budget|Script ./internal/gui (ok),
gofmt, go vet darwin / linux nogui / windows clean, update-quiet.test.cjs 21/21 in chromium and
webkit across en, zh, zh-TW, ja, de, panel and window. Broken by hand: dropping
!u.quiet in app.js (11 red), forcing Quiet=false in jsonIn (TestUpdateQuietUntilBehindAWhile red).
Not tried: a real 3-day wait, and the urgent range lookup against the live site.
|
||
|
|
2a1111cbab |
library: an agent's profiles are one chip on a row, picked in the app menu (Yanzhongixuy on X)
With several Hermes profiles the Library listed each as its own icon on every skill/MCP row (~20 identical glyphs). Profiles of one agent family (hermes#, omp#, claude#, qwenpaw#, WSL variants too) now collapse into one chip with a count; a click opens the app menu (openProtoMenu, multi-tick, live) to pick profiles one by one. All still toggles every profile. Rows only; the By agent view is unchanged. Other multi-profile agents (omp, claude, qwenpaw) had the same problem and go through the same code. Run on mote at the branch head: library-profile-chip.test.cjs (new, 12 cases, chromium + webkit, en/zh/zh-TW/ja/de), red 12 of 12 with profileChip broken by hand; library-*, group-skill-chips, skill-*, mcp-*, i18n-*, hermes-*, omp-*, project-* GUI files: all green except library-loading (Claude plugins tab, already #6204) and one webkit billion-context card case that passed alone (load flake). Not tried: a real Hermes install with 20 profiles, Linux WebKitGTK. |
||
|
|
409581c053 |
routing: Least used first spends credits about to lapse first (kudi3699 on X)
kudi3699: a WorkBuddy account with a 5000-credit pack ending next March, half used, plus check-in credits ending soon, was ranked by the whole pool's used share in "Least used first", so it was never picked and the check-in credits were lost. Smart (Renewal, Lapse) and Use before expiry (Pace) already went by the plugin's runsOutAt/runsOut; Least used did not. Allowance.Lapsing is what a window loses at RunsOut (RunsOutLeft of Of, at most what is left) as points of the used share, fading to nothing a week out; an amount not told is 0. routes.Seat.Lapsing at >= 0.5 points puts a seat with room ahead of the rest, soonest Lapse first, then Used as before. A seat at 90%+ is not helped. It is the shared runsOutAt/runsOut field, so any plugin that sends it gets this. The WorkBuddy plugin already reports it (0.2.27, the soonest pack incl. check-in rewards), so no plugin change and no mover min change. Run (mote): go vet routes/provider/gateway; GOOS=linux -tags nogui and GOOS=windows vet; go test internal/routes, internal/provider (all), internal/gateway -run "WorkBuddy|LeastUsed|Smart|Pace|Routing". Broken by hand: urgent() forced false turns TestLeastUsedSpendsLapsingFirst and the gateway test red. Not run: the full suite (started after the tag), real WorkBuddy accounts, the plugin's bun tests (plugin untouched). |
||
|
|
727e236378 |
gateway: a management API for providers, accounts and gateway keys, for a key set to manage (ljayic on X)
ljayic asked for a complete, stable management API so nothing needs a hand-edited file. /v1/magpie/admin/ now serves the app's own /api handlers (providers and their keys and accounts, OAuth sign-in start/poll/cancel, gateway keys, account groups) to a gateway key set with `magpie gateway-key admin <id> local|any`. Routes and actions not in gui/admin.go's adminRoutes are 404, so a provider's saved key, a gateway key's secret, sign-in export and actions on this computer's apps are not served; "admin-key" is not served either, so the API can't raise its own caller. Sign-in returns the vendor's page and code, opens nothing, takes no password. Guard (gateway/admin.go), in order: any Origin or Sec-Fetch-Site/-Mode is 403 with or without a key (Origin null, foreign, listed, *.localhost, an app scheme); no key 401; a key without Key.Admin 403; from loopback the Host must be ownHost (a rebound page's GET has no Origin); from the network the key must be "any"; a proxied request counts as remote. Key.Admin is dropped (adminOf) for a read-only, Browser, issued, expiring or default key, and setting read-only clears it. The route is in readOnlyRefused and keySlotFree. Docs: docs/reference.md "Management API", gateway-routing.md, and the remote page in en, zh and ja. Routing Groups, sign-in export and a GUI switch for the level are left to #6307. Run (mica, the worktree before the rebase onto 9 newer commits): go vet of access, cli, gateway, gui (darwin), GOOS=windows vet of the same four, GOOS=linux -tags nogui vet of access, cli, gateway; gofmt -l empty; go test -count=1 -timeout 45m ./internal/access ./internal/cli ./internal/gateway ./internal/gui: all ok but TestKeySlotEveryRoute, which named the new route and is fixed here, then it and the read-only, admin and guard tests pass again. After the rebase the same tests ran again. Broken by hand, each red in TestAdminAPIGuards: browser check off (a browser case served), Admin check off (a key without it served), Host check off (a rebound name served), the "any" requirement off (a local-only key from the network served, and a proxied request). Tests: TestAdminAPIGuards (no key, unknown key, non-admin, read-only, local/any, x-api-key, 8 browser headers x 3 callers, rebound Host, proxy, no handler), TestAdminKey (access: levels, read-only, Browser, issued), TestGatewayKeyCLIAdmin, TestAdminAPIGatewayKeys / Providers (a canary key is never told) / SignIn, TestAdminRoutesEveryAPIRoute. Not tried: a real sign-in against a vendor through the API, a request from a second computer on the LAN, the GUI suite (no page or app.js changed), a Linux/Windows run of the new tests. |
||
|
|
4a5e58a04f |
gateway: one account held only by Codex credits being off is sent at once, not queued (tmr11235 on X)
tmr11235, after v0.1.3857: "没有设置上限或者并发,只有一个号,这个号额度用了95%,
但我不希望排队". v0.1.3852/3857 made a turn that waits for its account's one
turn near a usage cap say "queued". The wait itself is nearCap: an account
within 5 points of a cap holds one turn at a time. HoldCaps counts a Codex
account set not to spend its credits as capped at 100% of any window
(Credits), though the user set no usage limit, so such an account at 95%
was near its "cap" and its second turn waited for the first, with no other
account to send it to.
Now a try near its cap takes the account's turn only when the user set a
usage limit on it (a share or an amount: userCapped) or the turn has another
candidate to go to (it is sent there first, the account kept behind). A sole
account whose only hold is credits off is sent at once; the 100% hold itself
still applies at the try (capHeld). A cap the user set keeps its one turn at
a time, as dyzdyz010 asked for.
Run (mica): TestNearCap*, TestFarFromCap*, TestPiTwoTurns*,
TestNearCapOnlyCreditsOffOneAccountSendsAtOnce (a single account at 95%,
credits off, no cap: both turns out at the vendor at once, none waiting);
gofmt; go vet darwin, linux nogui, windows of internal/gateway.
Broken by hand: the userCapped condition removed, the new test red ("never:
both turns out at the vendor at once").
Not tried: a real Codex account; I could not tell from the report whether
tmr11235's account has credits off or a cap they forgot: with a cap set,
a sole account still queues, by design. Full suite after the tag.
|
||
|
|
4718943432 |
gateway: a small reply limit sent to Tencent's DeepSeek has room to think above it (WaiooT on X)
WaiooT (Tencent Cloud Token Plan, deepseek-v4.1-flash, an agent named nowledge-mem): requests often ended "an empty reply (the model answered nothing; try again) -- cut at its length, the whole output spent on reasoning". Output 4,096, reasoning tokens 4,096, finish length. The request named max_tokens 4096 (the memory tool's own setting; magpie adds no limit to it) and no reasoning. Tencent's DeepSeek runs thinking by default (docs 1823/132248: thinking "enabled", reasoning_effort "high", "max_tokens >= 2048 advised in thinking mode") and counts it in max_tokens, so the thinking spent the whole limit before an answer. A Chat or Responses request to a tencentmaas.com provider's DeepSeek model that names a reply limit of 16384 or less, names no reasoning of its own (reasoning_effort, thinking, enable_thinking, reasoning...) and has no Max output set by the user is sent that limit plus a high effort's room (replyRoom, as side calls are), within the model's own limit where known (withThinkingRoom, maxoutput.go). Scoped to that host and DeepSeek models. The failure itself, a cut void, was already failed at once and asked nowhere (#2972): its text now names the limit the request set and what to do ("raise max_tokens in the agent, or ask for less reasoning"), still holding cutVoidWords, so the group and patience matching is unchanged. Run (mica): TestTencentDeepSeekCapGetsThinkingRoom (4096 gets room; max_completion_tokens too; effort asked, thinking off, a large limit, no limit, and another vendor's DeepSeek go as they came), TestChatLength* (the error names the limit), TestShortDefault*, and gateway tests matching Void|Length|Empty|Cut|Tencent|Output|Thinking|Reasoning; gofmt; go vet darwin, linux nogui, windows of internal/gateway. Broken by hand: withThinkingRoom's call removed, the new test red ("4096 and no reasoning: max_tokens 4096, want 28096"). Not tried: a real Tencent Token Plan key (none here), so that the 4096 came from the agent and not a Tencent default is read from the docs and the reporter's numbers, not seen on the wire; an Anthropic-protocol client in front of Tencent's DeepSeek is not covered; full suite after the tag. |
||
|
|
cfd3367df8 |
usage: a request's details show its service tier (JackyFill on X)
The ledger has kept each call's service tier since #1784 (tier_asked, tier_sent, tier_served in the log, the CSV and the JSON), but the Requests page never showed it. A request's details now have a Service tier line: "asked X", then "sent Y" only when it differs, then "answered Z" only when the reply named a tier. A call with none shows no line. Row flag bits are untouched: the tiers are string slots, so no bit is taken. Run, on mica: new ledger-service-tier.test.cjs (3 rows: all three tiers, asked+sent without an answer, none) in chromium and webkit, en zh zh-TW ja de, 12 of 12 green; with the add("Service tier") line removed by hand it is 0 of 12; i18n-keys caught a duplicate "Service tier" key (the core table already has all four languages), which is removed; ledger-*, i18n-keys, i18n-en-no-cjk and gui-* files rerun green after (ledger-cache-hit chromium was red once in the first batch, green on rerun in the same batch's second run). Not tried: a real Codex priority call end to end (the gateway side is #1784's); the full suite runs after the tag. |
||
|
|
65e1422c4a |
update: fall back to the GitHub release when usemagpie.ai can't be reached (ssharpcc on X)
A company network that allows github.com and no other domain could not update magpie at all: the feed (usemagpie.ai/api/latest) failed and that was the end. When the default feed fails (20s limit, so dropped packets don't hold the check for 10 minutes), the newest release is now read from yetone/magpie-releases: the API, or the release page's redirect when the API is rate-limited, plus SHA256SUMS and SHA256SUMS.sig from github.com (or the API route when github.com's address is busy). The result goes through Release.verify like the feed's: ed25519 signature against the embedded key, the version inside the signed message, every hash from the signed list. Unlike the feed, a release read this way must be signed whatever its version. Files download from github.com (Asset.GitHub), checked by hash as before; feed files named on the site now also get a github.com address, so a download falls back too. Covers the app, `magpie update` and the Windows and Linux builds (all go through latestAt). Not on Stable (the site's choice) nor on MAGPIE_UPDATE_FEED. Run (mica, tree at this head): gofmt clean; go vet update/cli/gui, GOOS=windows and linux vet of update; go test internal/update, internal/cli, internal/gui all ok. New tests use a feed port nobody listens on and a fake GitHub (API and rate-limited redirect paths): update succeeds and stages the file by hash; wrong key, swapped sums, missing and junk signature, signature for another version, unsigned old version are refused with no download. Broken by hand: with verify() removed from the fallback, 4 of those tests go red. Not tried: the real github.com, a real allow-listed network, Windows run. Other usemagpie.ai-only on such a network: install.sh, plugin catalog (falls to raw.githubusercontent.com, ok), npm registry for plugin installs, models.dev catalog, partners/icons, telemetry. |
||
|
|
c1a91b5a52 |
agents: Mistral Vibe is an agent, and a Library target (alterxyz4 on X)
Vibe (mistralai/mistral-vibe, the `vibe` CLI) keeps its settings in config.toml in $VIBE_HOME, else ~/.vibe. magpie now connects it: a [[providers]] entry named magpie (the gateway's /v1, api_style openai, backend generic), one [[models]] entry per catalog model aliased magpie/<provider>/<model>, and active_model set to the alias, with the previous value stashed and put back on Disconnect. Vibe reads keys only from the environment, the keyring or ~/.vibe/.env, so the key naming Vibe goes in the provider's extra_headers as an Authorization header; nothing is put in the user's environment. Avibe's `vibe` command is turned away by binNot. Library (#5595): instructions are $VIBE_HOME/AGENTS.md and skills $VIBE_HOME/skills (vibe/core/system_prompt.py, vibe/core/config/harness_files/_paths.py, read at 3.1.2). VIBE_HOME is in appdir's usable list and agentenv. README (en, zh), docs/reference.md and docs/subsystems/agent-wiring.md list it; the restart notice is in zh, zh-TW, ja, de. Run (mica, sandbox HOME): - go test -count=1 ./internal/agent ./internal/library ./internal/appdir ./internal/agentenv ./internal/gateway ./internal/gui: ok. - gofmt -l clean; go vet darwin, linux -tags nogui, windows on the touched packages: clean. - Real vibe 3.1.2 (uv tool install mistral-vibe) with the file shape magpie writes, against a fake OpenAI upstream: the alias with slashes resolves as active_model, the request goes to /v1/chat/completions with model kimi/k2, Authorization: Bearer <key> from extra_headers and user-agent Mistral-Vibe/3.1.2. - GUI: agent-notice-lang, i18n-keys, i18n-en-no-cjk, gui-zh-tw pass. - Broken by hand: vibeMine returning false fails TestVibe, TestVibeOwnModelTakesMagpieOut and TestVibeSyncKeepsTheirs. Not tried: the file written by the built magpie binary itself (the unit tests write it through the same code), Windows runs of the new tests, a Vibe signed in to Mistral with its own models alongside. gui-de and gui-ja "every zh string" were red on the base for the "{agent} isn't installed here" string, not for this change. |
||
|
|
327da691ae |
gateway: the Codex app's list stands on Codex's cache while the backend can't be reached (not_4O4 on X)
Beside the ChatGPT sign-in the Codex app's picker reads magpie-desktop-models.json, written only once the ChatGPT backend's model list is known. not_4O4 (Windows, Codex App 26.1106.6628.0) had no such file: the backend's ask never succeeded from there, so the file was never written and the picker showed GPT alone while the account had room, magpie's models only (and no GPT) once it was used up and magpie became the provider. After an ask has failed with no list from before for that sign-in, CodexDesktopCatalog now hands Codex's own models_cache.json entries and magpie's models (the revoked sign-in's path), told once through CodexDesktopChanged; the backend's list replaces it when it answers. With no cache the file stays as it was, and a 502 after a revoked sign-in is still no answer. Run (mote): go vet gateway and agent (darwin), GOOS=windows and linux -tags nogui vet of gateway, go test ./internal/gateway ./internal/agent; TestCodexDesktopCatalogBackendUnreachable is new and TestCodexDesktop*, TestCodexDesktopCatalogRevokedSignIn still pass. On the Windows box (win-run) the agent's Codex desktop tests passed and a used-up probe wrote magpie-models.json with relative key as in the report. Broken by hand: the stand-in only for revoked, the new test went red. Not tried: the real Codex app on the reporter's network; the reporter's used-up half (GPT missing from the provider catalog) did not reproduce, the catalog carries codex/<slug> entries in the probe on macOS and Windows. |
||
|
|
c4f7ba9d3a |
update: only a release whose SHA256SUMS carries the release key's signature is installed (danny0dong on X)
The updater took a file and its SHA-256 from the same feed answer, so whoever could change /api/latest could swap both; only the Mac app also checked its signing team. Now release CI (yetone/magpie-releases) signs "magpie release <version>\n" + SHA256SUMS with an ed25519 key held as that repo's UPDATE_SIGNING_KEY secret and publishes SHA256SUMS.sig (release assets: 16 -> 17). The site worker carries the list and signature in the feed; internal/update/signed.go checks them against the public key built into the binary, takes each file's hash from the signed list and refuses a missing or bad signature or a feed hash that differs. Versions from 0.1.3862 require it; older ones and binaries older than the key update as before. MAGPIE_UPDATE_FEED lifts the requirement for local test servers. mirror-release waits for 17 assets; docs/reference.md and code-standards say 17 and describe the transition. Run: go test internal/update, internal/cli, internal/gui -run Update|WhatsNew (ok); node --test site/*.test.mjs (116 ok); gofmt; go vet darwin, linux nogui, windows on internal/update. Broken by hand: signature check skipped (tamper and other-key tests red), feed-hash comparison skipped (swapped hash and feed tests red), worker not attaching signed (worker test red). The embedded key is checked against a sample signed by the real key with openssl, as CI does. Signing script run against a throwaway key. Not tried: a real signed release before this tag; install.sh does not verify the signature. |
||
|
|
531b277836 |
claude: an idle run's session survives a restart, so the next turn resumes it (recih on X, #6292)
As the gateway ends (abortAll), keepShelf shelves every run idle between turns and writes the shelf to claude-shelf.json (temp and rename): per entry the conversation fingerprint (turnKey: account, model, settings, messages), Claude Code's session id, its project folders (config folder and work folder), the account, tools and cache marks. The next gateway's unshelve reads the file once when its shelf has nothing for the turn (loadShelf, which takes the file away) and starts Claude Code with --resume, told the turn alone, instead of the whole transcript (~100k cache-write tokens on a long conversation). A file that does not parse whole, another version, a missing session file, a folder that is not a Claude project folder, or an entry older than idleLongest is unknown and falls back to today's replay. Rewritten-turn matching (looseTurn) is not kept; runs in a turn or parked on tool results at the stop are not either; a crash writes nothing. Run (mote): gateway "Claude|Subscription" tests green (90s), gofmt, go vet darwin/linux/windows (nogui) and gui. TestClaudeIdleRunSurvivesARestart (two Servers on one HOME, fake claude) is red with keepShelf off (session removed as the gateway ended) and green with it; the unreadable-file cases fall back to replay. TestClaudeSessionFilesAreRemoved now expects the sessions to stay until the shelf discards them. Not tried: a real Claude Code (a sandbox HOME has no sign-in), the full ./... suite before the tag, Windows. |
||
|
|
4b283e4f2c |
gateway: a Claude refusal for one model's limit rests that model, not the account (YsiCing on X)
Claude Code's "You've reached your Fable limit. Run /usage-credits to continue or switch models with /model" read as a plain rate limit: the "reached your ... limit" wording was in none of the quota word lists (only "hit your ... limit"), so the whole account rested and Opus was refused with Fable though its quota was left. The four lists in routing.go and fallback.go's quotaWords take "reached" as they take "hit". modelNamed (so every rest path that asks modelLimited) reads a Claude account's "reached/hit your <family> limit" as that model's when the family is in the model's id (claudeFamilyLimit); "usage", "session", "weekly" and the like, and "You've hit your limit", stay the account's. Messages, Chat Completions, Responses, the group fallback and the Claude Code bridge all rest through restAfter. Run at this tree (mote): TestClaudeNamedModelLimitRestsThatModelOnly red without claudeFamilyLimit (rests the account, Why rate), green with it; internal/gateway and internal/provider, gofmt, vet on darwin, linux and windows (results below). Not tried: a real Fable-limited account; the family word is Claude Code's wording as the screenshot shows it. |
||
|
|
4028687b8c |
memory: dates in memory_search and the dream's notes are the user's local time, with the hour and offset (Norethcy on X)
memory_search printed a memory's Updated as a bare UTC date, so a memory
saved at 04:30 on the 11th in Shanghai read as the 10th, and the stored
times were written in UTC. Now:
- every memory time is written in the local zone (now() instead of
now().UTC()): created, updated, edited, used, sync tombstones, digest
publish time;
- memory_search shows 2026-11-11T04:30+08:00 (memoryStamp);
- the dream's notes list the creation day in local time, as "Today" there
already was.
Old data: the file already held full timestamps, only in UTC ("...Z").
They parse as the same instants and are shown in local time, so no
migration; they are rewritten with a local offset when next changed.
There is no date filter in memory_search, and the Memory tab shows no
dates, so nothing else read the UTC day.
Tests: TestMemorySearchDatesInLocalTime (gateway) with time.Local at +08:00
reads an old "Z" memory and checks a new save is stored with +08:00. Red on
the old code both halves, broken by hand: the DateOnly line printed
2026-11-10, and now().UTC() in memory.go failed the saved-zone check.
Run with TZ=UTC and TZ=Asia/Shanghai on mote: internal/memory,
internal/memdistill, internal/gui (memory tests) ok; gofmt clean;
go vet ./..., linux nogui, windows ok. Not run: full ./... suite before
the tag (started after it), GUI browser tests (no assets changed).
|