Commit Graph
2311 Commits
Author SHA1 Message Date
yetone 18b46f5c25 sessions: the Kimi desktop app's Work calls reach Usage
CNSA0422 on X: magpie didn't count local usage from the Kimi desktop
app. Its Work agent is Daimon, which runs the Kimi Code runtime it
vendors with its own home under the app's share folder, so its calls
are written as Kimi Code's usage.record lines in a folder magpie never
looked in.

Read from Kimi 3.2.27's own bundle (com.moonshot.kimichat, Daimon
1.0.10, Kimi Code runtime 0.5.1): the app passes KIMI_SHARE_DIR, which
is <userData>/daimon-share or the absolute shareDir in
<userData>/daimon-storage.json; Daimon alone falls back to ~/.kimi.
The sessions are <share>/daimon/runtime/kimi-code/home/sessions/<slug>/
<id>/agents/<agent>/wire.jsonl. userData is kimi-desktop under
~/Library/Application Support, %APPDATA% or ~/.config.

- kimi_work.go finds the shares and adds their wire files to Kimi
  Code's ("kimi"), as MiniMax Code Desktop's count as MiniMax Code's.
  Found() lists kimi when only Work sessions exist.
- A record's model is Daimon's alias (daimon-kimi-code). It is read
  as the alias's model in the runtime's config.toml (k2p6-agent).
- magpie's kimi-desktop plugin points the alias's provider at a bridge
  on 127.0.0.1 that forwards to the gateway, which logs those calls.
  A call whose alias's base_url is a loopback address is skipped, so
  it is not counted twice. config.toml is the current setting only,
  so history read for the first time is judged by it.
- docs/subsystems/gateway-sessions.md says so.

Run (mote): go test ./internal/sessions -count=1, ok;
go vet ./internal/sessions for darwin, windows, linux -tags nogui, ok.
Windows (xiaomi-gpu, win-run): go test ./internal/sessions
-run 'KimiWork|Loopback|KimiCode', ok. gofmt clean.

Broken by hand: kimiCallFiles without the Work files made
TestKimiWorkCalls red (no calls), and so did dropping the loopback skip
(the bridged call counted). Restored, green.

Not tried: a real Kimi Work session. This computer has no Kimi desktop
data, so the fixture's records are the Kimi Code format the bundle's
UsageRecord writes and its config.toml is what modelToToml builds. The
Windows installer was not unpacked: the Windows path is Electron's
userData as the bundle's code reads it. k2p6-agent has no price in the
catalog, so these calls show tokens and no cost.
2026-11-13 15:12:46 +08:00
yetone 51c3ecc573 vertex: Gemini 4 Carbon and Hydrogen in the preset, and Gemini 4 at us and eu (#6452)
Google Vertex AI's model list lacked gemini-4-carbon (released 2026-11-10)
and gemini-4-hydrogen (2026-11-12); SunsetBirdW and T_t__biu on X, #6452.
Google's model-versions page lists both ids, and each model's page lists
PayGo at global, us and eu, as Argon's now does too, so the us/eu list
gains all three Gemini 4 models.

Their window, output, prices and thinking levels come from models.dev's
google-vertex entry as for every Vertex model, which matches Google's own
pages today: Hydrogen 1,048,576 in / 65,536 out, $1.50 / $0.075 cached /
$7.50 at global, levels low to xhigh; Carbon 1M / 65,536, $2 / $0.10 / $10,
levels low to high. The provider test asks both at thinkingLevel low.

Run (mote): go test -tags nogui ./internal/provider ./internal/gateway
./internal/catalog -run 'Vertex|GeminiEffort|Preset|Effort'; go vet ./...,
GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...; gofmt -l.
Broken by hand: presets.go reverted, TestVertexProviderListed red (no
gemini-4-carbon/hydrogen at global); vertex.go's us/eu list reverted, red
at us and eu.
Not tried: a real Vertex project (no Google credentials here). Carbon and
Argon go to $4 / $0.20 / $20 on 2026-12-01 (Google's pricing page); the
price comes from models.dev and follows it when it changes. The bundled
offline catalog (2026-11-10) has neither model until it is refreshed.

Rerun after rebasing onto origin/main 96558cfde: go test of provider,
gateway and catalog -run Vertex|GeminiEffort|Preset|Effort, ok on mote.
2026-11-13 15:06:26 +08:00
yetone 96558cfde6 agent: Codex thread tables are written only for ids magpie can own
JsonParser (X) found [model_providers.openai_token_sharing] in
~/.codex/config.toml, written by magpie, and Codex refusing to start:
"provider auth cannot be combined with experimental_bearer_token". The
id is T3 Code's: T3 starts Codex with -c model_providers.
openai_token_sharing={..., auth={command=...}}, its threads name that
id, and putThreadTables (#1372) wrote a magpie table (name, base_url,
wire_api, experimental_bearer_token) for every provider a thread named
that config.toml lacked. Codex merges T3's -c over it, and the merged
table has both auth and a bearer token.

putThreadTables now writes a table only for a CC Switch id
(ccSwitchProvider) or an id config.toml itself once held, recorded per
Codex home in the stash (codex.filed_tables) whenever magpie reads the
file. A table an older magpie wrote for any other id, recognised by its
exact shape (four keys, name == id, wire_api responses, magpie's own
gateway key), is taken out at Sync, at Disconnect (uninstall and quit
restore) and in TakeLeftovers, unless a profile or model_provider names
it or it has sub-tables. The user's own tables, other apps' tables and
tables with any other key are left alone.

Known tradeoff: a magpie-written table for a card-named CC Switch id
that config.toml lost before this release, and magpie never recorded,
is removed once and not written again. CC Switch's own ids still are.

Run (mote): go test ./internal/agent -count=1 -timeout 45m ok (421s);
gofmt -l clean; go vet ./internal/agent for darwin, linux and windows
ok. Real codex 0.165.0 in a sandbox CODEX_HOME: magpie's stray table
plus T3's -c override reproduces the exact error; without the table
Codex loads.

Tests: TestCodexLeavesOtherAppsProviders (threads name
openai_token_sharing, custom and a relay config.toml once held: no table
for T3's id, the other two written back), TestCodexDropsStrayThreadTables
(wired and unwired; another app's table, a profile-named one and the
user's own key stay), TestCodexSyncDropsStrayThreadTable.

Broken by hand: without the threadTableFor guard and the tidy calls,
TestCodexLeavesOtherAppsProviders and TestCodexDropsStrayThreadTables
went red; without only the Disconnect tidy, TestCodexDropsStrayThreadTables
went red; without only the Sync tidy, TestCodexSyncDropsStrayThreadTable
went red.

Not tried: the TakeLeftovers tidy was not broken by hand on its own;
T3 Code itself was not run, only codex with its -c override.
2026-11-13 15:01:55 +08:00
yetone 4af0f05cff gateway: a tool_reference an Anthropic-compatible endpoint refuses goes as text (emilochen on X)
Claude Code through magpie to DeepSeek V4.1 on an Anthropic-compatible URL
got 400 "DeepSeek V4.1 supports text and image content only; got
'tool_reference'": ToolSearch's answer is a tool_result holding
tool_reference blocks, which magpie relayed as written to every Messages
upstream (only a references-only result got a text block beside them,
#2124; DeepSeek's own API and Kimi lose only the top-level deferred blocks).

A 400/422 that refuses tool_reference in words (refsRefused: a refusal word
in the same clause, no brace between, so an echoed request doesn't count,
and DeepSeek's "expected `tool_reference`" doesn't either) while the request
as sent holds one in a tool_result marks shapeRefs. That request is asked
again at once, and every later one to that provider goes, with each
reference as "Tool <name> is loaded and can be called now." (the words
stringOrText already gives Chat, Responses and Gemini upstreams) and the
named tools without defer_loading; other deferred tools stay deferred, and
the tool_use/tool_result pairing stays (withRefsAsText). It sits in forward's
shape loop, so /v1/messages, count_tokens and group members all get it.
deferredOutUpFront names forwardOnce's existing up-front strip (Kimi,
DeepSeek's own API, OpenCode DeepSeek) so refuseShapes judges the body as
sent. Translated routes already carried the references as text
(TestToolSearchReferenceIsTold), so only the Messages passthrough changed.

Run (mote, -tags nogui, at origin/main 11ab58c58 + this): gofmt -l clean;
go vet gateway+catalog for darwin, linux, windows; go test catalog; go test
gateway -run ToolReference|RefsAsText|RefsOnly|RefsSaid|Deferred|DeepSeek|
ToolResultDefinition|NestedToolResult|ToolSearch|LoadedTools|Kimi|Shape|
Display|TurnEffort|Safeguards: ok.
Broken by hand: with mark(shapeRefs) taken out, TestToolReferenceRefusedGoesAsText
is red.
Not tried: the reporter's real endpoint (the refusal body is built from the
words in the tweet; its JSON shape is a guess, the match is on the words).
2026-11-13 14:55:15 +08:00
yetone c49c04241d docs: providers-accounts: connect addresses (Resolve)
Docs only: how Provider.Resolve reaches the dial, where it is taken and
where not (a proxy, a plugin), and the tests that hold it.
2026-11-13 14:30:19 +08:00
yetone a96d88effa claude-desktop: a model picked for two tiers no longer shows twice in the menu (yanghonghang on X)
v0.1.3997 showed "Gemini 4 Hydrogen · haiku" beside "Gemini 4 Hydrogen"
in Claude Desktop's model menu. dbaeaec12 (#5534) listed a model picked
for two Desktop tiers once more in magpie's inferenceModels, under an
alias id for the later tier, so Claude Code's ANTHROPIC_DEFAULT_<TIER>_MODEL
had a model. But that list is Desktop's model menu (gXn in 4.23118), so the
alias showed as a model of its own.

The later tier's alias is now a row of Desktop's /v1/models only
(DesktopTierRows: a copy of the model's row with the alias id, tagged
anthropic_family_tier and is_family_default). Desktop's gateway provider
pins a tier the list leaves out from a tagged discovered row
(shortnameIdentityOverrides, 4.23118). The list's own pins (IPn) go on top.
With an admin list, Desktop reads /v1/models only when the profile sets
modelDiscoveryEnabled, so magpie's profile carries modelDiscoveryEnabled:
true while a tier is shared (DesktopDiscovers, desktopSyncDiscovery). It
takes the value back once the picks are apart, or when the list is the
user's own. A value the user set is never written over or removed
(desktopDiscoveryMark in the stash). The gateway still reads the alias back
to the pick, so the tier is served as before.

Trade-off: Desktop takes behavesAs only from the list, so the later tier's
alias has none. A non-Claude model shared by two tiers runs on Claude
Code's generic prompt in the later tier, as an id Claude Code doesn't know.
Its window is the session's top (no modelSettings entry is needed when it
matches).

Run (mote, at this head):
- gofmt -l: clean
- go vet: darwin, GOOS=linux -tags nogui, GOOS=windows on internal/gateway
  and internal/agent
- go test -count=1 ./internal/gateway ./internal/agent: ok (1079s, 259s;
  mote at load ~38)

Red on the old code: the new TestDesktopTierSharedPick (all 4 subtests,
"3 entries in Desktop's model menu for 2 models ... labelOverride:
claude-sonnet-5-5 · Fake · haiku") and TestClaudeDesktopModelsSharedTier
were run against 406ad72f1's desktop_list.go with only the two new
functions added.

Broken by hand, each red:
- no DesktopTierRows in listModels: TestDesktopTierSharedPick, "haiku has
  no row".
- discovery never written: TestClaudeDesktopModelsSharedTier.
- the user's own modelDiscoveryEnabled taken away (`!on && has`):
  TestClaudeDesktopModelsSharedTier, "the user's true".

Checked against Desktop 4.23118's app.asar (on mote):
- shortnameIdentityOverrides skips only rows that are restricted (JT) or
  need an update (MMn).
- FPn/IPn pin only the tiers the list tags.
- adminListObviatesDiscovery is skipped once modelDiscoveryEnabled is set.

Not tried: a real Claude Desktop run with the reporter's picks. A [1m]
pick's later tier is pinned without [1m] (the row says supports_1m).
2026-11-13 14:16:12 +08:00
yetone a65dade2e3 gui: an accent colour of your own and a picture behind the pages (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS asked for colours beyond the three themes and for a
local picture. Settings › General gains two rows under Appearance:

- Accent color: magpie's own, six quiet presets (Blue, Teal, Green,
  Orange, Pink, Graphite) and a swatch that opens the system's colour
  picker. Saved as settings.accent (#rrggbb only, checked in saveOwn;
  `magpie settings set accent "#0d9488"` works through settingsapi.Keys).
  The server draws it (appearance.go accentVars): darkened on the light
  theme and lightened on the dark one until it reads as text at 4.5:1
  on the background and cards, with white or near-black text on it,
  whichever reads better. Never under Omarchy, whose theme is the look.
- Background image: Choose… takes a PNG, JPEG, GIF or WebP of 16 MB at
  most, sent as base64 JSON to POST /api/appearance/wallpaper, saved as
  `wallpaper` in magpie's folder (edit.WriteAtomic); settings.Wallpaper
  is its stamp. A thumbnail, Change and Remove show; Remove deletes the
  file. It is drawn behind the window's pages (never the tray panel)
  under a veil of the theme's background at 84%, so text reads as on
  the plain page; the cards stay opaque, and body's colour stays the
  theme's, which Windows' title bar tint reads.

boot.js puts the look's stylesheet in before the first paint and says
which look it drew (bootPrefs.look); applyPrefs asks /api/appearance/css
only when the settings' look differs. The rows, with the Colorblind,
Reduce motion and Loading bird rows, are drawn by appearance.js,
imported when Settings draws, so the core scripts stay under their
budgets with no raise (app.js 2,393 under, the core 503 under).
A save of Settings that doesn't send accent keeps it (Merge guard),
and the wallpaper stamp is kept by every Settings save.

fonts.test.cjs: the two new rows push the font row to the foot of its
560×620 window, where Playwright's click scrolled it in by a pixel and
the test read that as the page moving; the reader now scrolls it in
first with the wheel. settings_keep_test sets Wallpaper; the three
/api/appearance routes are named in the CLI parity test's notYet.

Run (mote, at this change on origin/main 406ad72f1; after the rebase
on fa3ee5a7e, which touched only the Library plugin and the site here,
the core budget, TestEveryRoute*, TestSettings*, TestAccent*,
TestWallpaper*, appearance-look and i18n-keys again, the same result):
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
  internal/gui, settings, settingsapi: clean.
- go test -count=1 ./internal/gui/... ./internal/settings/...
  ./internal/settingsapi/... ./internal/cli/...: ok.
  (go vet ./internal/cli too.)
- GUI, chromium and webkit: appearance-look (picking a preset, the
  reader's own and back; boot.js's look not fetched again; choosing
  and removing a picture; the rows keep their height while
  appearance.js loads; en, zh, zh-TW, ja, de at 420 and 1000px: rows
  fit, words translated), fonts, settings-general, settings-sections,
  settings-groups, reduce-motion, skeleton-bird, i18n-en-no-cjk: green.
  Red the same at origin/main 7693cf263 without this change, all
  filed: api-key-theme (#6444, filed now), i18n-keys "No folder"
  (#6422), settings-search and settings-lines-wrap de 440px (#6353).

Broken by hand, each red, then restored:
- Merge guard removed: TestAccentSetting red ("a save without the
  accent changed it").
- accentInk = 1.0: TestAccentReadable red.
- applyPrefs' lookPaint call removed: appearance-look's accent and
  picture tests red in chromium.
- the thumbnail made 66px tall: the row-height test red.

Not tried: the real app on Windows, Linux or Omarchy (title bar tint
with a picture, WebKitGTK drawing the layers), the system's real colour
picker dialog (the test sets the input's value), a 16 MB picture in the
real web views, and the whole GUI suite (queued on mote's suite lock
after the tag).
2026-11-13 13:52:41 +08:00
yetone 741d502d2a library: a synced MCP server can run its own command on this computer (jinpwng on X, #6426)
jinpwng runs one MCP server on a Mac and in WSL. Each needs its own
program path, and the only ways around it were two servers with two
names or keeping the server to one computer, which loses the sync of its
agents and note (#3836).

A command server now has an optional `shared` start. When it is set,
command, args and env are this computer's, and every reader (the agents'
files, projects, the router, the check) runs them with no change of its
own. Collect carries the shared start in their place and never the field,
so the other computers get exactly what they had. Put keeps this
computer's start, and what comes in for the server becomes the shared
start, so a note, agents or the other computer's own command change still
comes in. A server that comes in as a URL, one kept to this computer,
and the editor sending no shared start each end it.

- GUI: a saved synced command server's editor has "Use another command
  on this computer" under Command. With it on, the hint names what the
  other computers run, and "Use the synced command" goes back. Nothing
  else on the page moves; a new server and a local one have no button.
- CLI: `magpie library mcp here <name> <command args…>` and
  `… here <name> off`; the listing names a server that has one.
- TUI: an edit keeps the shared start.
- Docs: docs/subsystems/library.md, site docs (en, zh, ja).

Run (mote, at the tree pushed but before the rebase):
- go test ./internal/library/... ./internal/cli/... ./internal/tui/...
  ./internal/backup/... ./internal/gui/: ok
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: clean
- GUI, chromium and webkit: mcp-server-here (new: en, zh, zh-TW, ja, de at
  1100 and 390, the payload, no button on a local server, no sideways
  scroll), library-mcp-json, library-mcp-spaced-path, library-mcp-win-line,
  market-address, mcp-home-health, mcp-startup-timeout, market-have,
  mcp-editor-cancel, mcp-local-server, i18n-en-no-cjk, i18n-keys and the
  other library MCP files: 235 of 238. The reds:
  - i18n-keys "a plugin's words are its own": the same at origin/main
    3f6b1b0c9 (#6422, #6423, memory's "No folder").
  - market-have chromium "a server added by hand is marked added": a flake,
    red 1 of 3 at origin/main 3f6b1b0c9 and 1 of 3 here (#4620).

At the rebased head (on 04776ec6c, which touched library/client.js):
go test ./internal/gui/ ./internal/cli/ ok; GUI mcp-server-here,
mcp-local-server, library-group-steady, i18n-keys: 69 of 70, the red is
i18n-keys' #6422 above.

Broken by hand:
- keepStart doing nothing: TestServerHereThroughSync red (a sync took
  this computer's own command away).
- Collect carrying the server as is: red (carried /opt and "shared").

Not tried: the CLI's here command by hand (vet only; it calls the
tested ServerHere); the real app on a Mac with a real WSL computer syncing over
WebDAV; the test does the Mac-to-WSL round trip through Collect and Put.
A backup restored into an empty library gets the synced command only,
since a backup carries what sync carries.
2026-11-13 13:42:48 +08:00
yetone 04776ec6cb providers: a plugin subscription imports accounts from a file through its own auth.import, WorkBuddy's from 0.2.32 (marchen_cc on X)
marchen_cc on X: 「从文件导入账号」 took no WorkBuddy sign-in file. The cause
was not WorkBuddy's: magpie's import reached only built-ins (Codex,
Claude, Antigravity, Factory), and a plugin had no way to say it could
read a file. This adds that for every plugin subscription:

- A plugin's auth may have import(texts, {signal}), returning sign-in
  results, with importFrom (and importFroms by language) saying which
  file to choose. The host's importFiles op keeps each one as a sign-in
  is kept (keptAs, saved under signInKey, settled), so an account
  already there comes back "updated"; it is cancellable (signInSteps)
  and takes at most 100.
- /api/signin/import and `magpie accounts import <plugin> <files>` go
  to provider.ImportPluginFiles when PluginImportable(id); the editor's
  「从文件导入账号…」 row and the import sheet show for such a plugin, in
  its own words (importSay), moved subscriptions included (subOf).
- docs/subsystems/provider-plugins.md: "Accounts from a file".
- WorkBuddy's mover min goes to 0.2.32, which reads the desktop app's
  .info sign-in or a JSON credential, and sends a cloud-hosted
  enterprise account (*.sso.copilot.tencent.com, *.copilot.qq.com,
  *.sso.codebuddy.cn, iOA apart) to its enterprise's address (emilochen
  on X), published and checked with npm view --prefer-online.
- TestCoreScriptBudget +468 for the import branch, packed to one
  statement. importSay is read as the Providers rows draw, so it has
  no lazy page; nothing else was moved out (#2710). The budget's
  arithmetic was checked over this tree: 1,267,762, at the new cap.

Run on mote (mica's disk is full; mote over its cores) at this change
on 3f6b1b0c9; ac1702c33 (the library plugin and its GUI test, no core
script) landed after, and the core budget's arithmetic was redone at
this head:
gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
internal/{gui,plugin,provider,cli}; go test -count=1 of those four:
all ok. GUI (chromium + webkit, en and zh): plugin-import,
login-import, factory-key, plugin-moved-signin, i18n-keys: 23 pass, 1 fail: i18n-keys "a plugin's words are its own",
memory_mcp.go's "No folder", red on main since 72facf72e (#6422).
Plugins repo: workbuddy import.test.mjs 6 of 6, bun scripts/check.mjs
ok, root bun test 8534 pass / 1 fail (agy-cli smoke under load, green on a rerun: 8535 pass, 0 fail;
unrelated, plugins #1070).

Broken by hand: without the host's importFiles handler,
TestPluginImportFiles goes red; without importable in pluginSubs,
plugin-import.test.cjs goes red ("WorkBuddy lists no import").

Not tried: a real WorkBuddy desktop .info file or a real enterprise
account on a cloud-hosted domain; the fixtures follow WorkBuddy's own
client source. Not tried on Windows or Linux beyond vet.
2026-11-13 13:32:32 +08:00
yetone ac1702c330 library: the first part of a skill group opens below its heading, not over it (jinpwng on X)
jinpwng on X (macOS, Chinese UI): in Library > Skills, opening the first
group made the page jump, and what was clicked went off the screen; the
others opened downwards. The group was the first part of a big group (a
repository split by folder, drawn in the group's windowed list). A click
on a part's heading draws it anew, and the first part's only neighbour
above it is the list's zero-height pad, which the click's hold passes
over. So the page held the next part's heading, the rows opened pushed it
down, and the view scrolled by the whole part: the clicked heading went
from 152 to -920. A part's heading is now data-unrolls, so the hold keeps
its list, whose top doesn't move. Top-level groups, projects and the
Instructions agents already held still; the new test guards them too.

library-group-steady.test.cjs opens and folds, at the top and scrolled:
the Skills groups and the big group's parts (first and second, and the
first with the second open), the projects in Skills, MCP and Subagents
(first and third), and two Instructions agents. Each heading must stay
within 1.5px of where it was clicked. Clicks and scrolls go through
page.mouse, since Playwright's own scroll before a click reads as the
reader's.

Run (mica, mica-run), at base 436d507f0 unless said:
- library-group-steady in chromium and webkit, en zh zh-TW ja de, at 980
  and 420: 22 of 22 pass.
- Broken by hand (data-unrolls line removed): 20 of 20 cases red in both
  engines, "the first part opened: the heading moved from 152 to -920"
  (420: 242 to -830).
- With click-scroll, every-skill, found-fold, library-groups,
  library-instr-busy, library-instr-sets, nav-sub-unroll,
  project-skills-groups, project-skills-pick, skill-fold-all,
  skill-group-shared, skill-groups, skill-parts and i18n-keys, in both
  engines: 90 pass, 12 fail. The 12 are i18n-keys' "a plugin's words are
  its own" (#6422/#6423) and skill-fold-all's strict POST list seeing
  /api/update/using (#5982), red the same on origin/main 4545790de.
- Rebased on origin/main 4545790de (no Library or hold change between):
  library-group-steady again in both engines, 5 languages, 980 and 420:
  22 of 22 pass.
- mote: node --check client.js, gofmt -l, go vet ./internal/gui for
  darwin, linux nogui and windows: ok.

Not tried: the real app on macOS (the GUI files only), and a filter
showing a part (it takes the same partHead).
2026-11-13 13:23:41 +08:00
yetone 3f6b1b0c94 agent: omp's advisor turns on with its model, and its review, wait and call-back are set in magpie (#6408, Awad_Yoo on X)
Awad_Yoo wants omp's advisor gated: one model executes, another reviews
only at key points. omp's advisor (src/advisor, advisor/settings.ts) runs
only while advisor.enabled is true, and omp leaves it off, so a model
picked for the advisor role in magpie reviewed nothing.

- A model picked for the advisor role writes advisor.enabled: true when
  the user hasn't set it. The role's reset takes back only what that pick
  wrote (a stash mark); the user's own on or off stays.
- Three Quiet fields write the rest of config.yml's advisor block, as omp
  reads it (omp_advisor.go):
  - advisor_review: off, turn, agent-end (enabled + reviewMode; off keeps
    the mode);
  - advisor_wait: syncBacklog off, "1", "3", "5", strict, written as
    strings, since omp's enum settings take only strings;
  - advisor_wake: continueSeverity nit, concern, blocker.
- GUI: omp's opened row and its panel sheet get three rows (Advisor; Waits
  for its review; Calls a finished agent back on). The last two show only
  while it reviews, and the rows redraw in place. They live in
  ompadvisor.js, imported the first time. The roles square's advisor line
  says " · off" when the advisor is off. Strings in zh, zh-TW, ja and de.
- Core script budget: +717 for what is left in app.js, after the rows
  moved out.
- docs/subsystems/agent-wiring.md has an "omp's advisor" row.

Not magpie's: taking over from the executor after repeated failures of
the same kind. omp has no such setting; "escalate" in its source is only a
note's severity. An omp extension can do it (pi.on("tool_result") with
pi.setModel), and that keeps the session's trace and completed tool
results. Said on the issue.

Run:
- mica-run go test -count=1 ./internal/agent/: ok.
- go vet ./internal/agent/ ./internal/gui/ for darwin, linux (nogui) and
  windows: clean. gofmt -l: nothing.
- internal/gui Go tests: on mote (below).
- GUI, on mote and mica: omp-advisor.test.cjs (new: chromium + webkit;
  1100 and 390px; en, zh, zh-TW, ja, de; panel sheet at 360) passes, as do
  agent-prefs, old-webkit's own check, i18n-en-no-cjk,
  omp-profile-connect and agent-row-disclose.
- Reds that fail the same on a clean worktree at origin/main 743001128
  (45 of 45, the same tests):
  - agent-details-ready: #6373;
  - i18n-keys "a plugin's words are its own": #6422;
  - old-webkit headerpresets.js: #6030;
  - old-webkit :has(): #5919;
  - omp-roles in Chromium, "no roles square": filed as #6432.
- The real omp 18.9.1, in a sandbox HOME (omp config get), reads
  enabled=true, reviewMode=agent-end and syncBacklog=1 as written.

Broken by hand:
- No auto-enable on the pick: TestOmpAdvisorPickTurnsItOn went red.
- No in-place redraw: the panel sheet cases went red, 3 of 3.

Not tried:
- A real omp session with the advisor reviewing.
- continueSeverity needs omp 18.12.1 or later; 18.9.1 doesn't know it.
- A WATCHDOG.yml roster's per-advisor settings aren't shown; omp uses them
  over these.
2026-11-13 13:18:35 +08:00
yetone 7693cf2634 agent: a folder holding only magpie's sign-in file is no agent (jiangshangmuyun on X)
Codex, never installed, was listed on the Agents page as "not connected"
once a ChatGPT account was added in Providers. With Codex signed in to
nothing, addLogin hands it that account and saveCodexLogin writes
~/.codex/auth.json, which makes ~/.codex; Detected took any non-empty
Dir for the agent. Claude Code is the sibling off the Mac: putClaudeLogin
writes ~/.claude/.credentials.json when Claude Code has none.

Agent.signIn names that file (auth.json for both Codex agents,
.credentials.json for Claude Code), and agentDir passes over it. A folder
with anything else of the agent's beside it (config.toml, sessions/,
settings.json, projects/, history.jsonl), its binary, or its app still
lists it.

Run:
- gofmt -l; go vet on darwin, linux (-tags nogui) and windows, on mote.
- go test -count=1 ./internal/agent ./internal/gui on mote: ok.
- win-run on xiaomi-gpu: TestSignInFileAloneIsNoAgent,
  TestClaude*Windows*, TestDetected*: ok.

Broken by hand: agentDir not passing over the sign-in file:
TestSignInFileAloneIsNoAgent red for codex and claude
(../tray-jump-scratch/break.log).

Not tried: a real ChatGPT sign-in in a sandbox HOME with no Codex. A
Codex app installed but never opened, with only magpie's auth.json in
~/.codex, is not listed until it is opened (it then writes its own
files there).
2026-11-13 13:04:03 +08:00
yetone 870a9e0fe1 gui: the Windows tray panel stays where it opened, no jump left (jiangshangmuyun on X)
On Windows the panel opened flush against the right edge and, a moment
later, moved a fair way left. The tray placed it as it opened
(ToggleWindow -> PositionWindow), and every refit after that placed it by
the icon again: fitPanel, each glidePanel step (stepGlide in
glide_other.go) and zoomWindows all called tray.PositionWindow. Wails
centres the panel on the icon only when Shell_NotifyIconGetRect's rect is
inside the taskbar, and flush right otherwise. An icon clicked in
Windows 11's overflow flyout isn't in the taskbar as the panel opens, so
it went flush right; the page's first fit, once the flyout had closed,
read the flyout's arrow and centred the panel over that.

Now every refit of the open panel goes through sizeOpenPanel. On Windows
it keeps the place the tray gave it as it opened: the centre and the
edge by the taskbar held, kept inside the work area (panelRefit, one
SetBounds). The Mac and Linux keep SetSize then PositionWindow, as
before, in the same order.

Run:
- gofmt -l; go vet ./internal/gui ./internal/agent on darwin, linux
  (-tags nogui) and windows, on mote.
- go test -count=1 ./internal/gui ./internal/agent on mote: ok
  (145s, 250s).
- win-run on xiaomi-gpu: TestPanel*, TestOpenPanel*: ok.

Broken by hand (win-run, ../tray-jump-scratch/break.log):
- panelRefit holding the top edge in place of the taskbar's:
  TestPanelRefitKeepsItsPlace red in 4 cases.
- sizeOpenPanel taking the old path on Windows too, and app.go at its
  base (PositionWindow in fitPanel and zoomWindows):
  TestOpenPanelRefitsInPlaceOnWindows red each time.

Not tried: the real tray click on xiaomi-gpu. Nobody is signed in there
(query user: no users, LogonUI up, no explorer), so no tray exists to
click and the panel's moves couldn't be watched; the cause above is read
from Wails beta.24's systemtray_windows.go positionWindow. No GUI
(Playwright) file reaches this: the change is in Go, not the page.
2026-11-13 13:04:03 +08:00
yetone cbc9dd7f00 gateway: Mistral's num_cached_tokens counts as the cache it read (daoche_wuzui on X)
Mistral documents its cache hits in usage.prompt_tokens_details.cached_tokens
(docs.mistral.ai prompt-caching), which was already read. Its API also sends
an older top-level num_cached_tokens: a Mistral engineer's client-python
PR #452 reads it as "the legacy top-level cached token count" with a
streaming fixture carrying it, and counts it inside prompt_tokens, as
OpenAI's is. Its current SDKs (TS 3.5.0, Python 3.7.0) name neither in
UsageInfo. A usage telling the cache only there was read as no hit:
magpie's cost and cache-hit rate showed 0% for Mistral.

cUsage now reads num_cached_tokens after prompt_tokens_details,
DeepSeek's and Moonshot's names, as a fallback. otherCacheFields
names it, so openAIUsage tells it again in prompt_tokens_details for
clients that read only that, streamed (chatTidy) and whole. The
translations to Messages and Responses are built from cUsage's Usage,
so they follow. Every chat usage decoder (chatDecoder, the whole reply,
continuation, sniff) goes through cUsage.

Tests: chat-mistral (num_cached_tokens alone) and
chat-mistral-zero-details (beside a 0 in prompt_tokens_details) in
TestUsageRecordsCacheTokensOnEveryRoute and
TestAgentReadsCacheTokensOnEveryRoute, every agent route, whole and
streamed; TestMayMendUsageOnlyOtherNames and
TestOpenAIUsageLeavesOpenAIsAlone (num_cached_tokens 0 stays byte for
byte). The other vendors' cases (OpenAI, DeepSeek, Moonshot,
Anthropic names, Responses, Gemini) are unchanged and pass.

Run (mica-run, mote over its cores): gofmt -l clean; go vet,
GOOS=linux go vet -tags nogui, GOOS=windows go vet of internal/gateway;
go test -count=1 ./internal/gateway ok (900s).
Broken by hand: without NumCachedTokens in cUsage's fallback, 30
mistral subtests fail and no other; without num_cached_tokens in
otherCacheFields, the passthrough chat and chat-stream Mistral cases
and TestMayMendUsageOnlyOtherNames fail.
Not tried: a real Mistral API reply (no Mistral key on this machine).
2026-11-13 13:02:39 +08:00
yetone b942a872ba caps: a lone capped Codex account says its turns go to the fallbacks (not_4O4 on X)
not_4O4 asked for a way to switch to non-official models once a set share
of the ChatGPT quota is used. magpie already does this: a usage cap on the
Codex account (or a cap on the 5-hour / weekly window alone) plus the
provider's Fallback. When Codex is connected to magpie beside its ChatGPT
sign-in, or fails over through it, codexAccounts sends a capped lone
account's own-model turn through serve, so the fallbacks answer it.

The GUI said otherwise. The account row of a lone Codex account said
"Codex still uses it" past the cap even when Codex was connected, and the
cap note said requests are refused when the provider has fallbacks. Now:
- the direct-use note shows for Codex only when it isn't connected or
  failing over (an agent row with wired or failover);
- the held note says the requests go to this provider's fallbacks when it
  has some and Stop at the caps is off, in en, zh, zh-TW, ja, de.
- TestCoreScriptBudget: +236 bytes for this, packed to its shortest form
  with no page to move it to (the account rows are core).
The 11-04 grey Send default and the takeover are untouched: a cap never
takes Codex off ChatGPT.

New tests:
- internal/gateway TestCappedLoneCodexAccountGoesToItsFallback: a lone
  account capped at 80% with usage at 85 is not tried and the fallback
  answers (stream and not); at 50 the account is tried.
- account-cap.test.cjs: Codex connected, the lone capped row's note ends
  with the fallback line and has no direct note; not connected, the
  direct note stays. Chromium and WebKit, every language.

Run (mica, mote was over its load), at the rebased head
(origin/main c2a1d80fc):
- GUI before the rebase: account-cap, i18n-keys, i18n-en-no-cjk,
  window-cap, window-cap-pool, key-usage-cap, account-row-line,
  codex-app-menu-cap, routing-steps-cap: 235 of 236 ok. At the rebased
  head: account-cap, i18n-keys, i18n-en-no-cjk, window-cap,
  account-row-line again: 165 of 166 ok, the same #6422 red; go test -run Budget ./internal/gui ok. The red is i18n-keys "a plugin's
  words are its own" ("No folder" in memory_mcp.go, from 72facf72e),
  filed as #6422; this change touches neither file.
- go test -run 'Cap|Codex.*Fallback|Fallback' ./internal/gateway: ok.
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows for
  internal/gateway and internal/gui: clean.

Broken by hand:
- `if false &&` before the HoldCaps check in codexAccounts: the Go test
  went red (acct-1 tried, fallback 0).
- the old `direct` and the fallback flag forced false: the 10 connected GUI
  cases went red in both engines; the not-connected ones stayed green.

Not tried: a real ChatGPT account reaching its cap with the real Codex
CLI or app; the full suite runs after the tag.
2026-11-13 13:02:05 +08:00
yetone f1ac93aa54 codex: Ultra on every other vendor's model that reasons (pingqipai3 on X)
pingqipai3 asked for Codex's Ultra effort on every model, so Codex uses
subagents more. Codex offers a level only where the model's catalog entry
lists it, and magpie listed Ultra only on OpenAI's own models.

What Codex does with it (openai/codex 553c764): Ultra is never sent.
ModelInfo::resolve_reasoning_effort sends the entry's
multi_agent_reasoning_effort, else max, else its highest other level; and
under MultiAgent V2, Ultra is what makes subagents proactive
(effective_multi_agent_mode). So Ultra on another vendor's model asks it
its own top level, which is honest, and turns on V2's proactive subagents.

codexcat.entriesAt now ends the levels of a model that lists some, from a
vendor other than OpenAI, with "ultra" and says multi_agent_version v2
(ultraHere). Left alone: GPT, o-series and Codex models (their Ultra is
provider.OffersUltra's), a model with no levels, Fast and Seals entries
(V1 stays theirs), a vendor's own Codex entry (listedEntry). The default
level is never Ultra. catalogFormat goes to v3, so Codex fetches the list
again. Only Codex's catalog changes; other agents' level lists don't.
docs/subsystems/agent-wiring.md has a row for it.

Run: at origin/main 54b6d4d39 + these three commits (c63a6d674, mica):
gofmt -l clean; go vet ./internal/{codexcat,gui,agent,gateway,provider,
catalog,usage} on darwin, GOOS=linux -tags nogui and GOOS=windows ok;
go test -count=1 of those seven packages: all ok.
Rebased onto origin/main 21ed46106 after that run (main's gateway,
provider and i18n.js changes): provider, gui, codexcat and
gateway-model-info, i18n-keys, gui-zh-tw run again there (mica): Go all ok, GUI 8 of 9; i18n-keys is red on
"No folder" from 72facf72e on main (#6423), not this change.
The full suite runs after the tag.
The provider tests that read Codex's list (TestCPAVariantModelsBorrowLevels,
TestGroupQuietMemberKeepsCodexEffortControl,
TestCodexOffersLevelsForUnknownModels) now expect ultra at the end.
Broken by hand: ultraHere returning false turns TestUltraOnOtherVendorsModels
red (claude-opus-4-8, glm-5.3, deepseek-v4-pro, group/mixed: no ultra, no v2).
Not tried: a real Codex session picking Ultra on a non-GPT model and
watching it spawn subagents; magpie's own Codex effort control
(codexEfforts) still doesn't list Ultra for these models; a Codex app
[desktop] enabled-reasoning-efforts the user set without "ultra" is left
as they set it.
2026-11-13 12:53:04 +08:00
yetone 15e1d65bcd gateway: Cherry Studio's model list has magpie's image and video models (pingqipai3 on X)
pingqipai3 on X: with magpie as a provider in Cherry Studio, its image
generation models weren't read. /v1/models lists chat models alone unless
the caller asks ?kind=image,video, and Cherry can't ask, so its list had
no image model at all, and its Paintings page none of magpie's.

What Cherry reads (CherryHQ/cherry-studio v2.2.1, c74990c): a custom
OpenAI-type provider (the type magpie's Cherry link gives it) is fetched
by listOpenAICompatibleModels, which keeps only id, name and owned_by.
The renderer then resolves each id against Cherry's model registry
(provider-registry models.json, normalizeModelId: the id's last "/"
segment, lower-cased), which carries image-generation for gpt-image-2,
dall-e-3, Gemini's image models, Imagen, Seedream, grok-imagine-image and
~130 more, and video-generation for grok-imagine-video and Seedance. Those
go to Paintings (supportsImageGenerationEndpoint), not the chat picker
(isNonChatModel), so the chat-picker worry behind ?kind= doesn't hold for
Cherry. Its new-api fetcher (new-api, CherryIN, AIOnly presets) reads
supported_endpoint_types instead.

Fix: a request of Cherry Studio's, by the key magpie's link gives it or
by its User-Agent (Electron's default with "CherryStudio/<ver>" in it,
read from Cherry Studio 2.1.2's Electron Framework), gets the image and
video models in its plain list, as ?kind=all would; ?format=text stays
chat. Each image model says supported_endpoint_types ["image-generation"]
(plus "image-edit" when it takes images), each video model
["openai-video"], new-api's words, for every caller. Docs: Cherry
Studio's page (en, zh, ja) and the integration page (md, en, zh).

Run (mote, at 889758605):
- go test -run TestModelsListMedia ./internal/gateway: ok
- go vet darwin, GOOS=linux -tags nogui, GOOS=windows on internal/gateway;
  gofmt -l clean
Broken by hand: listKinds' media set false for Cherry:
TestModelsListMediaForCherryStudio red for the UA, Cherry 1.x's UA and
the link's key (image and video rows missing).
Not tried: a real Cherry Studio fetching the list (it would write the
user's live Cherry database); the registry lookup was read from Cherry's
source, not run. Full suite runs after the tag.
2026-11-13 12:53:04 +08:00
yetone d6a6865b1f update: a file from usemagpie.ai has its attestation from usemagpie.ai, GitHub's API after (ArcticLampyrid on X)
The site's cron keeps each release's SLSA bundles on R2 as
/files/<tag>/attestations.jsonl (728f3de40, 5e51e241c), but the updater
still asked api.github.com for every file, 60 an hour unsigned, and with
Update source set to the site alone it never checked an attestation at all.

attestation() now takes the asset. A file the feed names on the site
(Site/files/<tag>/<file>) has its release's bundles read from the same
site first; GitHub's API is asked as before when the site misses: a pruned
tag's 302 to GitHub's release (not followed; that asset doesn't exist),
any other status, a body with no bundle, or the site unreachable.

The trust model is unchanged. The site is only transport: its bundles go
through the same verifyBundle (embedded Sigstore root, release.yml of
yetone/magpie-releases, the digest from the ed25519-signed SHA256SUMS).
A site bundle that fails sends the updater to GitHub's API, where a valid
bundle holds; if that API can't be read it is a refusal, not unknown, so a
tampered mirror plus a blocked GitHub can't go through as "unattested".
Update source "site alone": the site's bundles are checked, GitHub never
asked; a miss is unknown as before. Update source "GitHub": the API alone.
docs/reference.md and the start page (en, zh, ja) say so; no
docs/subsystems page covers updates. llms-full.txt regenerated.

Run (mote):
- go test -count=1 ./internal/update/ ok; go vet darwin, GOOS=linux
  -tags nogui, GOOS=windows ok; gofmt -l clean.
- node --test site/*.test.mjs 120/120.
- New tests (attest_site_test.go, fixture = the site's real
  v0.1.3986/attestations.jsonl): the site serves it and GitHub isn't asked;
  site-alone source attested; another digest refused; misses (302, 404,
  502, html, empty, cut mid-line, site down) go to GitHub; site-alone miss
  stays unknown; a tampered site bundle refused with GitHub 403/503/404 and
  with site-alone, and passes on GitHub's valid bundle; wrong identity
  refused; GitHub source and github.com files never ask the site. No test
  reaches the network (TestMain points the site at 127.0.0.1:1).
- Broken by hand, each red: never asking the site (4 tests), taking a site
  bundle unchecked (3), following the redirect (1), a failing site bundle
  plus unreadable GitHub kept unknown (2).
- Live once (a throwaway test, not committed): usemagpie.ai's real
  v0.1.3986 bundles attested magpie-cli-android-arm64 with the API pointed
  at a dead address; pruned v0.1.3985 (302) fell back to api.github.com
  and attested.

Not tried: a full app update from the site end to end; Windows and Linux
runs of the package (the change is OS-independent).
2026-11-13 12:49:24 +08:00
yetone 436d507f0e usage: a ChatGPT card's image row tells the window its replies' headers say, not a 15-minute guess (#6412, Green14964 on X)
ChatGPT's images API answers every drawing, a 200 too, with the image
allowance it counted: x-codex-active-limit: imagegen_premium and the
window in x-codex-primary-* (window-minutes 1440, reset-at), as the
reporter captured on a Pro account; Codex 0.160.1 also reads it from a
family named for the limit (x-imagegen-premium-primary-*,
parse_all_rate_limits). magpie read none of it on the image path: the
row said "Unknown" until a refusal, and a refusal whose body names no
resets_at rested the image model for quotaRest's 15 minutes, so the
card said "2 minutes" of a 24-hour window.

- gateway/codex_image_limits.go: codexImageHeaderLimit reads the image
  window from the limit's own family or, when x-codex-active-limit names
  an image limit, from x-codex-*; heardCodexImage keeps it per account
  (in memory), handed to provider.ImageHeard.
- Both drawing routes hear it: magpie's own (sendWith in draw.go) and
  Codex's relayed /images/generations and /images/edits
  (codex_backend.go).
- codexHeaderLimits tells no chat window when the active limit is an
  image one, so the 1440-minute window never lands on the 5-hour or
  weekly row.
- restDrawer: a 429 with the heard window at 100% counts as the quota
  (ChatGPT's "image limit reached" read as a rate limit), and with no
  resets_at in the body it rests until the heard reset, capped at
  longestQuota.
- provider.WithImageLane: the row says Available (or Used up at 100%)
  with that reset; a rest still says Used up. "Available" translated
  (zh, zh-TW, ja, de).
- docs/subsystems/providers-accounts.md updated.

Run (mote): at base 610ae1f54, go test -count=1 -timeout 45m
./internal/gateway ./internal/provider: provider ok; gateway red only
in TestRefusalAfterShownThinkingGoesToTheNext/chat_content_filter_to_
responses (#5761, refusal handover, load 61). At the pushed head's
tree (rebased on 54b6d4d39): gofmt -l clean; go vet darwin,
GOOS=windows, GOOS=linux -tags nogui ok; -count=3 of that test, the
TestCodexImage*/TestCodexRelayed*/TestCodexLimits*/TestCodexDraw*/
TestWithImageLane tests ok. GUI, chromium and webkit: codex-image-row,
i18n-keys, i18n-en-no-cjk ok; 57 of the 118 quota-*/usage-* files run
before the run was stopped, 51 ok, reds all filed on main:
quota-refresh-order (#6180), usage-agents-hide (#3414, #6003),
usage-cards-hide (#6294), usage-computers (#5224), usage-focus-steady
(#3501), usage-fold (#3415, #6003). app.js is unchanged.

Broken by hand, each red: without the sendWith hook,
TestCodexImageRowFromA200sHeaders and TestCodexImageRefusalRests-
UntilItsWindow; without the relay hook, TestCodexRelayedImageWindowHeard;
without the active-limit guard in codexHeaderLimits, TestCodexImage-
Headers; without the heard-reset branch, the refusal test rests 15
minutes (the reporter's symptom); without the 429 gating, it doesn't
rest at all.

Not tried: a real ChatGPT account's drawing (the fixtures are the
reporter's captured headers); Plus and other plans' limit names beyond
imagegen*/image_gen; the heard window doesn't survive a restart (the
row is Unknown until the next drawing); no share or count is shown.
2026-11-13 12:38:22 +08:00
yetone 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.
2026-11-13 12:29:04 +08:00
yetone c2fd48782b Put back what 1f05c311d took out of main by mistake
1f05c311d was committed with its worktree's older tree on top of a
fresh origin/main (git reset --soft), so beside the memory fix it
undid every file 610ae1f54..c1312ac15 changed (45 files: key balance,
import links, project subagents, uninstall, site, LESSONS.md and
more). This commit restores each of them to c1312ac15 byte for byte;
the tree is now c1312ac15 plus the memory fix alone
(git diff --stat c1312ac15 HEAD: the 4 files of the fix).
2026-11-13 12:18:23 +08:00
yetone 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.
2026-11-13 12:17:43 +08:00
yetone 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 889758605 + this: go test -count=1
./internal/provider ./internal/cli ./internal/gui ok; go vet darwin,
GOOS=linux -tags nogui, GOOS=windows ok; gofmt clean; GUI
key-own-balance, i18n-keys, i18n-en-no-cjk, key-balance-expiring in
chromium and webkit ok (48/48). Rebased on c5adcbaab (library, site;
nothing of this change's files), then at the pushed head: go test
./internal/gui, ./internal/provider -run Refill|TypedBalance|OwnBalance|
KeyOwnBalance|Budget ok, i18n-keys and i18n-en-no-cjk ok. key-balance-card is red in de at 560px
(view-usage 635>560) in both engines on the clean base 889758605 too:
#6414.

Broken by hand: daily Last taken from UTC's midnight instead of local:
TestRefillDays and TestTypedBalanceRefillsDaily (Kiritimati) red.

Not tried: the real app with a real relay key; the full suite (started
after the tag).
2026-11-13 11:59:54 +08:00
yetone 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.
2026-11-13 11:51:50 +08:00
yetone 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.
2026-11-13 11:28:51 +08:00
yetone 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.
2026-11-13 11:23:30 +08:00
yetone 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.
2026-11-13 11:01:27 +08:00
yetone 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.
2026-11-13 10:53:40 +08:00
yetone 648cd3fdbb gateway: the management API leaves other keys that manage magpie alone
727e23637 added /v1/magpie/admin/ and left admin-key out of it so that "a
key can't give another more than it was given". But rotate-key was served
on any key: a key allowed to manage magpie from this computer only
(Admin local) could rotate a key allowed from anywhere (Admin any) and was
handed its new secret, or set one of its own choosing ("secret" in the
body). It then held a key that manages magpie from the network. It could
also turn off or remove that key, locking its owner out.

- internal/gui/admin.go adminMayChangeKey: a POST /gateway-keys/{action}
  naming another key that has Admin is 403. The caller's own key, keys
  without Admin and add-key go on as before. A gateway-keys file that
  can't be read is refused (unknown), not let through.
- docs/subsystems/gateway-routing.md says so.

Run (mote, at 2bcbae35e + this change):
- go test -count=1 -timeout 45m ./internal/gui/: ok 138.6s
- go vet ./internal/gui/ darwin, GOOS=linux -tags nogui, GOOS=windows: clean
- gofmt -l clean
Broken by hand: with the check skipped, TestAdminAPILeavesOtherManagingKeys
is red. A local key rotated the any key and got its secret
(sk-magpie-key-…), set "chosen-by-the-caller-1234" as its secret, turned it
off and removed it.
Not tried: a real gateway run over HTTP. The test drives serveAdmin with
the caller's identity in the context, as the gateway's admin() passes it on.
2026-11-13 03:49:41 +08:00
yetone 5f1a642b42 docs: a commit's tree is origin/main plus its own change, in the code standards
Seen a third day: 8c7328f3a (11-13, remote quotas) was committed from a
stale tree and wrote 21 files back to their state before 35aaaa4b9,
taking out three commits (put back in 926b1e7df), after 85e6ec540
(11-11) and 76ceff87c (11-12). The rule moves from LESSONS.md into
docs/code-standards.md's Commits section, and LESSONS.md lists it under
Moved to the code standards. Docs only; nothing run.
2026-11-13 02:01:18 +08:00
yetone 926b1e7dfb provider, gui: put back what 8c7328f3a took out of main by mistake (35aaaa4b9, 2fa79aef3, 797a23cad)
8c7328f3a (remote quotas: a Remote set to Select none still tells its
cards) was committed from a stale tree. Beside its own three files
(docs/subsystems/providers-accounts.md, remote_quotas_scope.go,
remote_quotas_test.go) it wrote 21 files back to their state before
35aaaa4b9, which took out:

- 35aaaa4b9, the Codex client setting (codex_request.go, codex_tier.go,
  settings.go, settingsapi.go, api.go, app.js, i18n.js, index.html,
  codex-client.test.cjs and the rest);
- 2fa79aef3, a save of the bytes a file already holds changes nothing
  (#6289: logins.go, logins_unchanged_test.go);
- 797a23cad, the tray's words (traywords.go, traytip_words_test.go).

The 21 files are checked out from 8c7328f3a^. After this commit
`git diff 8c7328f3a^ --stat` names only the three remote-quota files,
so main is the three lost commits plus 8c7328f3a's own change.

Run (mica, at this tree): gofmt -l clean; go test -count=1 -tags nogui
./internal/provider ./internal/settings ./internal/settingsapi ok.
./internal/cli and . are red on main already, not from this: the
codex-client and codex-open routes have no notYet entry, and
catalog.go's mmddSnapshot is compiled at launch (1ca2c62c4). Both are
fixed in the next two commits.
2026-11-13 02:00:40 +08:00
yetone 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 2a1111cba made on a row sat out of line. That commit said "Rows only":
groupChips never set change.rows, so headings kept every profile. The row's
chip had data-members, not data-agent, so the fan/stack translate rules in
library.css never reached it.

groupChips now sets change.rows, and its profiles chip is half lit when a
profile has some of the skills. library.css applies the fan rules to
[data-members] chips too. docs/subsystems/library.md says so.

Files: plugins/library/client.js, plugins/library/library.css,
tests/library-profile-group.test.cjs (new), docs/subsystems/library.md.

Run on mote: library-profile-group.test.cjs (new; chromium + webkit, en/zh/
zh-TW/ja/de, 420 and 980px, 22 cases): 22 of 22 green; broken by hand (old
client.js and library.css) 22 of 22 red (13 Hermes chips, not 1); old
library.css alone 22 of 22 red (chips out of line). The Library GUI files,
group-skill-chips and i18n-keys ran in both engines: the only reds are
library-loading's chromium and webkit cases, red on origin/main
8c7328f3a6 too (run there alone, 2 of 6
red), filed as #6204.
Not run: the full Go suite and the 113-file GUI run's final tally (still
running when pushed), Linux WebKitGTK, a real Hermes install with many
profiles.
2026-11-13 01:42:52 +08:00
yetone 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. cfd49e36a made a Remote's cards
follow its enabled models, and remoteCardWanted answered no card at all for
a provider that serves no model (Select none). Select none is documented to
serve no model while its balance and usage are still read and shown
(Provider.NoModels), and a Remote kept only to read quotas is set that way.
Now every card is wanted then; picks still narrow cards by their whole
provider path (93b855d90), and a list not read leaves all shown.

Run (mote): TestRemoteSelectNoneStillShowsItsCards is red on origin/main
797a23cad's scope file put back by hand ("map[]") and green with the fix;
-run 'Remote|Quota|Card' in internal/provider and internal/gateway ok;
go vet darwin/linux/windows of both packages ok; gofmt clean. GUI: remote-*,
usage-*, routing-remote-windows, panel-usage*, name-suffix-remote and
statusline-remote files in chromium and webkit: 74 red, all in usage-agents-hide,
usage-cards-hide, usage-fold, usage-hidden-way-back, usage-ledger,
usage-range-times, usage-speed-all-models, usage-compact-counts and
remote-magpie's address test; the same files are red the same on origin/main
797a23cad (75 red), already filed (#6003, #5475, #3414). The change is Go only.
Not tried: a real second magpie in sandbox HOMEs (a fake peer in the test),
the full Go suite (started after the tag).
2026-11-13 01:25:57 +08:00
yetone 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.
2026-11-13 01:17:30 +08:00
yetone 8097860ab1 gui: put back what 76ceff87c took out of main by mistake
76ceff87c was built on an older base and its tree dropped the Linux
backdrop-blur rule (7c37424fc) and Codex seats change (d6b5f24db) with
their tests, docs and history.go edits. This restores those files from
d6b5f24db; the diff against d6b5f24db is now only the hours feature.
Run: git diff d6b5f24db --stat lists the usage files alone.
2026-11-13 01:01:43 +08:00
yetone 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).
2026-11-13 01:00:14 +08:00
yetone 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.
2026-11-13 00:47:41 +08:00
yetone 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.
2026-11-13 00:01:01 +08:00
yetone 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 a5e5f539a, filed as #6294.
Broken by hand: withoutHiddenRows returning its input turns usage-rows-hide
16/16 red in chromium.
Not tried: a real Antigravity account (fixtures only); full suite starts after
the tag.
2026-11-12 23:45:43 +08:00
yetone 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 4e0026661: agent-prefs webkit "in the panel a
Settings line..." (#6139) and old-webkit "compat.js is the first" / "styles
hold up in Safari 15.0" (#5919, #3403).

Broken by hand, each red then restored: withAgentWindows out of CatalogFor
(TestAgentOwnContextWindow, TestDshOwnContextWindow); the group branch in
compactSet (TestGroupOwnCompactAt); the settingsapi keep line
(TestSettingsSaveKeepsWhatItDoesNotSend); the window row in the sheet
(agent-window tests); compact dropped from the group save
(group-compact tests).

Not tried: a real dsh with a real account (its compaction is dsh's own;
the test reads the window magpie hands it), the full GUI suite (queued
behind another run on mote), Windows and Linux runs of the new tests.
2026-11-12 23:01:29 +08:00
yetone 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).
2026-11-12 22:40:15 +08:00
yetone 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.
2026-11-12 22:26:45 +08:00
yetone c96f33d659 agent: Hermes is one entry in the Agents list and the model pickers; its profiles are not rows (geekbb on X)
7050da0a4 (Norethcy on X) made each other Hermes profile an agent
hermes#<name> so the Library could give it its own skills and MCP servers,
and that also put one row per bot, each with its own model pick, in the
Agents list. geekbb: Hermes should have one entry; the bots Hermes made are
Hermes's to manage.

The profile agents stay, as the Library's targets (Norethcy's request keeps
working), but are now marked Agent.Nested: DetectedIn (the Agents list, the
tray panel and every picker built from it) and ClientsIn leave them out.
All and Find still reach hermes#<name> by id.

Existing settings: a model a user set on a profile lives in that profile's
config.yaml and is not touched, so it keeps applying; a profile on magpie
still follows the connected config's model unless it was picked, and a
picked one stays picked (hermes:<path>:picked). Nothing is dropped or
rewritten; what goes is only the extra row and its picker.

Run on mote: go test ./internal/agent ./internal/library; new
TestHermesProfilesAreNotListedAsAgents, red with Nested off and green with it;
GUI hermes-profile-row (rewritten: one Hermes row, no "Hermes ·" text),
hermes-profiles, i18n-keys in chromium and webkit, five languages; gofmt;
go vet darwin, linux, windows for agent and library.
Not tried: a real Hermes with several bots; the full suite before the tag.
2026-11-12 22:23:54 +08:00
yetone 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.
2026-11-12 22:14:40 +08:00
yetone 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.
2026-11-12 21:48:04 +08:00
yetone d0a4e0be6f lessons: a size budget is met, not raised, moves into the code standards
coreScriptBudget rose four times on 11-12 (d96403141, 05cadcafd,
4519eea71, 09e2eef0d), 1,089 bytes with nothing moved out, the third day
the budget lesson was seen (10-17, 11-10). Per LESSONS' rule it moves into
docs/code-standards.md as a row of "What a change contains". Docs only.
2026-11-12 20:11:44 +08:00
yetone 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 5a3d73039 (#6234, #6073, #6156, #6133 are open for them).
New Go tests use a fake GitHub and a live fake site feed that count their
hits: GitHub only never asks the feed and downloads from GitHub, the site and
Automatic never ask GitHub, the site only never falls back (release or file),
GitHub only refuses wrong key, swapped sums, no/junk signature and an
unsigned old version, a custom feed is never overridden. Broken by hand:
without the githubOnly branch and the two download switches, 3 of them go red.
Not tried: the real github.com or R2, a Windows run, Stable with GitHub only.
2026-11-12 19:35:57 +08:00
yetone 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).
2026-11-12 19:33:39 +08:00
yetone 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 5e933e153: usage-hidden-way-back (#6295) and
usage-agents-hide (#3414) are red there too, the rest pass; this branch
gives the same result. gui-de and gui-ja "has every zh string" are red on
5e933e153 as well.

Not tried: a real WebDAV/S3/GitHub server between two real computers;
the CLI command has no test of its own.
2026-11-12 19:31:11 +08:00
Flandern1211 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 5a3d73039):
- TestZCodeRestartOnWindows red with the zcode restartApps entry renamed away
  by hand ("behind: <nil>"), green with it.
- go vet darwin, darwin nogui, linux nogui, windows on internal/agent: ok.
- GUI agent-app-restart, restart-app, agent-notice-lang, agents-last-known in
  chromium and webkit: 100 of 100 pass.
- internal/agent package: started, result follows in the tag's suite record.
- gofmt -l: clean.

Not tried: a real ZCode on macOS. dev.zcode.app is the patch's bundle id and
could not be checked here (no ZCode.app on the Macs); a wrong id leaves the
Mac row without a Restart, as before, and does not close anything. Real
Windows ZCode.exe was reproduced by the author on 3.17.2, not by me.

Co-authored-by: Flandern1211 <163982805+Flandern1211@users.noreply.github.com>
2026-11-12 18:59:53 +08:00