Commit Graph
7638 Commits
Author SHA1 Message Date
yetone c433147923 site: an OpenChamber docs page in en, zh and ja
/docs/openchamber says how magpie runs OpenChamber, the desktop, web and
VS Code front end for OpenCode, on magpie's models: its profile in
$OPENCHAMBER_DATA_DIR (~/.config/openchamber), preferences.json and the
settings.json copy older builds read; the order a new session's model is
picked in (project defaultModel, profile defaultModel, the agent's,
OpenCode's model), so magpie sets the profile's; a project's own default
named; defaultVariant cleared on a new model; the small model
(smallModelUseDefault false + smallModelOverride, else OpenCode's
small_model); magpie's provider in the OpenCode config, a user's own
gateway provider reused, OpenCode 2's words, the provider taken out once
unused; new sessions taking the change; switching back. Each claim is
from internal/agent/openchamber.go (its header, Notice, the model and
small fields, tidy) and openCodeRef in agents.go. Linked from each
language's OpenCode page; in the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: OpenChamber itself on magpie for this page; it names only
what magpie's source says.
2026-11-11 23:44:20 +08:00
yetone 60559ee73a lessons: 85e6ec540 pushed a stale index over six commits 2026-11-11 23:17:44 +08:00
yetone 7d8b3f7f1f site: a Craft Agents docs page in en, zh and ja
/docs/craft-agents says how magpie runs Craft Agents
(lukilabs/craft-agents-oss) on magpie's models: the pi_compat magpie
connection in config.json ($CRAFT_CONFIG_DIR, else ~/.craft-agent) on
/agent/craft-agents/v1, its models and defaultModel; Craft opened once
first, since it won't load a config.json without workspaces; no key
(authType none, credentials.enc never opened, the placeholder key from
this computer); new sessions taking the change, a workspace's default
going over it, open sessions staying; the user's default stashed and put
back, their connections kept; switching back. Each claim is from
internal/agent/craftagents.go (its header, noticeCraft, Check, Sync and
the model field). Linked from each language's T3 Code page; in the
sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Craft Agents itself on magpie for this page; it names only
what magpie's source says.
2026-11-11 23:10:26 +08:00
yetone b52c711142 Restore what 85e6ec540 reverted: it was committed on a stale index and took out b587eb306's and earlier work (webview2, library skills, opencode endpoints, quotas); this puts the tree at b587eb306 plus the Paseo agent only 2026-11-11 23:09:15 +08:00
yetone 85e6ec5406 agent: Paseo's Claude model picker lists magpie's models (@TheMist016 on X)
Paseo (getpaseo/paseo) starts the same Claude Code, but builds its own model
list: first-party models plus settings.json's `model` and a few
ANTHROPIC_*_MODEL variables (providers/claude/models.ts). It never reads
Claude Code's modelPicker, where magpie writes every model, so the rest were
not selectable in Paseo. Paseo's own ~/.paseo/config.json takes
agents.providers.claude.additionalModels ([{id,label,description}], checked
against protocol/src/provider-config.ts) and passes each id to Claude Code as
written.

New agent "Paseo" (detected by ~/.paseo or PASEO_HOME): its switch writes the
models Claude Code's /model lists (same ids, [1m] marks, names; only the ones
picked for it) there, marked "via magpie" in the description; the user's own
entries and keys stay, off takes out only magpie's, a sync refreshes when on.
Claude Code must be connected to magpie as well.

Run (mote-run, sandbox HOME in tests): TestPaseoAdditionalModels,
TestStateListsPaseo, internal/agentenv, internal/gui full package ok;
internal/agent full run red only on TestPiGroupEntryKeepsItsMembers, which is
red the same on origin/main 12cd456f2 (passes alone; filed). gofmt clean,
vet darwin, windows and linux nogui on internal/agent. Broken by hand: Set
writing no models goes red.
Not tried: a real Paseo daemon reading the file (checked against its schema
source only); GUI browser suites.
2026-11-11 23:08:39 +08:00
yetone b587eb3069 claude: a summary request branches before its call's line is read (#6128, recih on X)
park() marks a streamed call with the conversation it answered while its
callLine.uuid is still empty. branch()'s no-call path only took lines with a
uuid, so it skipped the call and logged "no run waits on a reply to this
conversation". Claude Code can write the call's transcript line late, after
the tool has run, so waiting for the uuid never helps.

branch() now also takes pending lines with no uuid whose conversation
matches, records their tool-call ids in savedSession.cutCalls, and
cutSessionBeforeCalls cuts the session before the first assistant line
holding one of them. It asks again until cutWait; if the line never appears
the session as it stands on disk is already the conversation before the call.
A line whose uuid is known still wins. The match is still on the conversation
before the reply and on the run's own account.

Run (through mote-run): go vet for darwin, windows and linux; gofmt -l clean;
go test -count=1 -timeout 45m ./internal/gateway: one red,
TestKeyLimitReservationsStayInTheirWindow total/tokens and total/cost, which
is red at base 7a606eecd without this change and is #6165.
TestClaudeBranchForSummaryBeforeTheCallLineIsRead covers a parked call with
no uuid, a call line written 60ms into the cut, and a line that never comes.
Broke it by hand (len(unread) ignored): red with recih's message.

Not tried: a real TUI run. Other code that needs a uuid (noteLines, cutSessionAt)
was read: they guard lines noted from Claude Code's output and are not
reached by this path.
2026-11-11 23:02:04 +08:00
yetone 12cd456f2c library: Skills > New skill makes a skill of the user's own (josephBenchap on X)
josephBenchap asked to create a skill in the Library; it could only
install or bring one in. Skills now has a New skill button beside Find
skills. A dialog takes a name, a description and the agents (the app's
chips, no select); Create writes skills/<name>/SKILL.md in the library's
folder with name and description front matter (YAML-marshalled, one line,
at most 1024 characters), lists it with no source, gives it to the agents
picked like any imported skill, and opens it in the reader, whose path
link opens the file in the user's editor. The name is checkName's, and
refused when the library or an agent already has one by that name
(compared without case) or a folder is in the way. The follow-the-server
note already sits above the Skills tab, so it covers this too. en, zh,
zh-TW, ja, de. docs/subsystems/library.md says so.

Run on mote at this head:
- gofmt -l clean; go vet ./internal/library ./internal/gui on darwin,
  GOOS=linux -tags nogui and GOOS=windows: ok.
- go test ./internal/library ./internal/gui: ok. TestCreateSkill is new.
- GUI node --test in chromium and webkit: library-new-skill (new; en and
  zh, 1100 and 420px: refusal stays in the dialog, agent untick posted,
  reader opens, no select, no sideways scroll), library-items,
  library-follow-server, library-all, library-discover-jump,
  library-groups, library-intro-width, library-linked-set,
  library-pick-remove, library-row-open-scroll, library-ime-scroll,
  library-desktop-skills, library-gone-agents, library-bar-more,
  library-chip-fan, i18n-keys, i18n-en-no-cjk, gui-de, gui-ja, gui-zh-tw:
  all pass.
- library-loading is red (2 of 6) on this tree and on origin/main
  e6fe481b3 alike: the tab list gained Claude plugins. Already #5997.

Broken by hand: the agents' own-skill name check removed:
TestCreateSkill red ("theirs" was taken).

Not tried: the real app; Windows run of the tests (vet only); the full
suite starts after the tag.
2026-11-11 23:01:12 +08:00
yetone fb6b4de0a9 gui: a WebView2 that doesn't come up waits for the old profile lock, then starts again (@ljlwlcz on X)
0.1.3688 on Windows 11: after a restart by a script, "timed out after 1m0s
waiting for the WebView2 controller" and the window never came back. Wails
waits 60s in Embed for a controller, then exits the process (ErrorHandler
runs, then os.Exit). The cause is a start that meets the previous magpie's
msedgewebview2 still holding the profile folder (EBWebView\lockfile, opened
without sharing).

- Before the first window, the start waits (30s at most) until the profile
  folder's lockfile can be opened, i.e. the old WebView2 has let go. The
  folder is the one passed to Wails, else Wails' %AppData%\<exe name>.
- ErrorHandler now logs the error with the WebView2 runtime version, the
  folder and whether another process holds it.
- On a WebView2 failure the process starts itself again (update.Respawn,
  MAGPIE_REPLACES set so the new one waits for this one to exit), backing
  off 2s, 4s; after 3 starts a box says what failed and what to do.

Run: gofmt; go vet darwin, GOOS=windows, GOOS=linux with and without
nogui; go test of the WebView2 tests on mote; the same on xiaomi-gpu via
win-run, where TestWebView2FreeSeesTheHeldLockfile holds a real
non-shared file and goes red when webView2Free is forced true (broken by
hand). Full gui/update/proc packages on mote.
Not tried: a real WebView2 timeout and the restart (the controller
timeout can't be forced here without the live app); Wails still exits
the process after the handler, so the tray does not stay up through a
failed start, it is started again instead.
2026-11-11 22:58:27 +08:00
yetone 5a475f90c3 opencode go: each API goes to the endpoint Go's docs name, Gemini at /inference/go/google/v1beta (@jd04063221 on X)
Go's docs (opencode.ai/docs/console/go, Endpoints) give one URL per API
under /inference/go: /openai/v1, /anthropic, /google/v1beta. The preset
and the filled-in defaults still used /zen/go and Gemini's
/inference/go/v1.

The preset now gives the three; a preset provider saved with the older
URLs is moved on load; openCodeRoot reads the per-API forms; a Go URL in
the per-API form gets its siblings in that form. A URL the user gave stays.

Run (mote): go test -run 'OpenCode|Preset|PlanQuota|Balance|Go|Gemini'
./internal/provider ./internal/gateway ok; vet darwin/linux/windows ok.
Broken by hand: old opencode_endpoints.go/presets.go with the new
TestOpenCodeEndpointsFilledIn goes red on 6 cases.
Not tried: a real Go key (none here); old /zen/go routes still answer
(400 MissingSessionID unauthenticated), so URLs the user set keep working.
Full suite and GUI files not run before the tag.
2026-11-11 22:55:43 +08:00
yetone 93b855d90e remote quotas: a card is wanted by its whole provider path, not its first part (748975219 on X)
With only relay/strata/model enabled on a Remote, the cards of relay/kiro and
relay/codex still passed, since remoteCardWanted compared the first part of
the card's id alone. A card is now wanted when its id is the provider path of
an enabled model (its id less the last part) or a parent of it, whole parts
only (relay/kir never matches relay/kiro). A model listed with no provider
still leaves it unknown, so all shown. cardWantedFor holds the rule.

Run (mote): TestRemoteCardWantedByWholePath (two levels, three levels,
non-boundary prefixes, several models, one level, no provider) is red with
the first-part rule put back by hand, green with the fix; -run Remote in
internal/provider ok; go vet darwin/linux/windows ok; gofmt clean. Full
internal/provider: TestQuotaSpanCarriesEveryWindowField and
TestKeptQuotaReportAsksNobody are red, and red the same on origin/main
bbfa8501f without this change (open issues 4457/4190 and 3487).
Siblings: remoteOf and ThroughSelf take one leading part on purpose (a
remote's own id), unchanged. Not tried: a real multi-level chain of magpies.
2026-11-11 22:53:50 +08:00
yetone 628f8fd840 gui: a plugin page's script hash is of the bytes served, not of the body (zhangly1 on X)
inlinePage wrote each script as "<script>" + body + "\n</script>" but hashed
body alone. A CSP hash covers the exact text between the tags, newline
included, so the browser blocked every inlined script (the bridge too) and a
plugin page opened in magpie web was blank. The hash is now taken from the
text that is written, in the one place that writes it. The siblings: no other
code hashes an inline script (grep sha256- in internal; the stylesheets go
under style-src 'unsafe-inline').

Run (mote): TestPluginPageWebComesAsOneDocument now hashes every served
<script> body and looks each up in the policy; red on the old pageinline.go
(all three scripts, the bridge included), green on the fix. internal/gui
package, vet on darwin, windows and linux nogui. New GUI file
plugin-page-csp-hash.test.cjs (chromium and webkit: hash of served bytes runs
with no securitypolicyviolation; hash of the body alone is blocked), with
plugin-page, plugin-page-cookie-proxy: green.
Not tried: the full suite before the tag (started after it); a real browser
against the live Go server behind a proxy.
2026-11-11 22:51:50 +08:00
yetone bbfa8501fb lessons: 16ed1a952 shipped a feature under another commit's message (#6162) 2026-11-11 22:43:50 +08:00
yetone 1c95c87c25 cli: POST /api/plugin-pages/arrange is named as the window's own (#6162)
16ed1a952 added the route (the sidebar's drag order of plugin pages,
saved to settings.PluginPageOrder) without naming it in the route map, so
TestEveryRouteHasACommandOrIsNamed was red on main from then on. Its
siblings (agents, usage, providers arrange) are W already.

Run on mote at this tree: go test -tags nogui -count=1 ./internal/cli ok
(42s). Without the line: TestEveryRouteHasACommandOrIsNamed red,
"POST /api/plugin-pages/arrange has no command".
2026-11-11 22:43:10 +08:00
yetone e6fe481b3d site: a T3 Code docs page in en, zh and ja
/docs/t3-code says how magpie runs T3 Code (pingdotgg/t3code) on
magpie's models: the two provider instances written into
~/.t3/userdata/settings.json ($T3CODE_HOME/userdata), which T3's server
watches and reloads; magpie, a claudeAgent instance running Claude Code
with ANTHROPIC_BASE_URL and the gateway token, every magpie model a
custom model, 1M ones marked [1m], T3's own Claude binary and home
carried over; magpie · Codex, a codex instance whose launchArgs are
Codex -c overrides with magpie-codex-models.json as catalog,
~/.codex/config.toml not written, not brought back by a sync once
removed; the Reasoning pick (medium first, else the lowest) and the
Thinking switch (alwaysThinkingEnabled); the user's names, enabled
state, autoCompactWindow, accentColor and env kept; ~/.claude/settings.json
env and CLAUDE_CODE_USE_BEDROCK; switching back. Each claim is from
internal/agent/t3code.go (its header, t3Capabilities, the Codex
instance). Linked from each language's CodeBuddy page; in the sitemap,
llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: T3 Code itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 22:36:28 +08:00
yetone 9fcf6f1fa1 gui tests: the Sessions files take the speed note, the in-use ping and the agent menu (#5947)
Four Sessions GUI files were red on origin/main da169135a, run alone on
mica (Playwright 1.62.0, both engines, every language they cover):

- sessions-gateway-delete (10 of 10) and sessions-manage (4 of 4) read
  every .sm-note. e6f151507's speed note (sm-speed-note) is a second
  one when no row has a speed, so the exact-notes and textContent
  checks met two. They now read the notes other than the speed note.
- sessions-folder-delete (4 of 4) counted every POST as a delete call.
  10c4dc109's in-use ping, POST /api/update/using on a click or key,
  landed in "Cancel deletes nothing". It is left out of the count.
- sessions-export (4 of 8, en not-web, #5947): at 560px the head's tabs
  give way to the agent menu, so the OpenCode tab is hidden. The test
  now chooses OpenCode through whichever control is shown.

Test-only; no app code changes. Run: those four files on mica, 26 of 26
ok; at da169135a, 22 red.
2026-11-11 22:26:07 +08:00
yetone efdca11be3 agent: Pi's group entry keeps whether a member speaks Messages across polls
Pi's Drift is asked on every /api/drift poll, about every 12s on
every page. Each poll wrote the entry of the model the agent is set
to. For a routing group, piModelJSON found all of the group's members
again (GroupFinder, membersFound, resolveIn) only to see whether one
speaks Anthropic's Messages API, for #5037's short promptCache. With
the real-account copy on mote, an alloc_space diff of 55s with the
Sessions page open showed 21.7MB allocated, 17.1MB of it under Drift
(5 polls, ~3.4MB each), 16.1MB of that in this look-up.

provider.GroupHasNative answers it through keptOf: kept across
requests while the files' stamp stays the same, a minute at most, as
the catalog's other kept builds are. Outside a request it is found
afresh, as before. The entry is the same.

Test: TestPiGroupEntryKeepsItsMembers. Over successive requests, a
group's entry allocates under half of one provider.FindGroup: 3,600
bytes against 71,040 for a 40-member group. With the old agents.go it
is red: 72,672 against 71,040. TestPiGroupPromptCache and
TestPiGroupThinkingIsWhatPiRuns pass.
2026-11-11 22:26:07 +08:00
yetone 7cd8bfc56f sessions: a page with no session's speed asks /api/speeds every 5s, not every second
The Sessions page asked /api/speeds once a second while open, whether
or not the gateway had heard any session. On a resting page the list
is empty, and each ask woke magpie through the whole web middleware
chain. On mote with the real-account copy, a 60s CPU profile with the
Sessions page open measured 0.50-0.56s, against 0.22-0.29s on Home. An
alloc_space diff over 55s showed /api/speeds allocating next to
nothing (21.7MB in all, 79% of it /api/drift). So the cost was the
62 wake-ups a minute, not their garbage. Old main de13afbf6 measures
the same 0.50/0.56s, so this is no regression; the page always
cost it.

While the last answer was empty, the page now skips four ticks before
asking again. A session that starts is kept by the gateway (its curve
is the last 120s), so its speed shows within 5s with its whole curve.
Once any session has a speed, the page asks every second again.
Opening the page asks at once.

Test: sessions-speed-rest.test.cjs (every language, Chromium and
WebKit). A resting page reads at most once in 3.5s, a session heard
shows within the rest, and then the page reads once a second. On the
old client.js it is red, 5 of 5 in Chromium ("read 3 times in 3.5s
with nothing heard").
2026-11-11 22:26:07 +08:00
yetone 7a606eecdc site: an Obsidian docs page in en, zh and ja
/docs/obsidian says how magpie runs Obsidian's AI on magpie's models
through Copilot for Obsidian (logancyang/obsidian-copilot): the vaults
from obsidian.json in each system's config folder (Flatpak and Snap
too); the magpie provider, its configured models and their places in
each backend written into <vault>/.obsidian/plugins/copilot/data.json,
everything else kept; turned-off models staying off, new ones on in
chat, the default model taken over and put back; no key, since keys
live in Obsidian's keychain (requiresApiKey false, a keyless call from
this computer, CORS, the /agent/obsidian route); reloading Copilot
before changing its settings; Copilot 3 left alone; switching back, a
hand-added provider named magpie kept; Smart Connections not wired and
why. Each claim is from internal/agent/obsidian.go (its header, the
obsidian agent, obsCopilotWire, obsCopilotUnwire, the notice).
Linked from each language's Raycast and CodeBuddy pages; in the
sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Obsidian itself on magpie for this page; it names only
what magpie's source says.
2026-11-11 22:02:18 +08:00
yetone 0706d7a35a usage: a ChatGPT card has an image row: used up until the refusal's reset, else unknown (#6160, hqqqqqqqh on X)
ChatGPT's image generation has a quota apart from the 5-hour and weekly
windows. Neither /wham/usage (additional_rate_limits is null) nor the reply
headers (x-codex-primary-*, x-codex-secondary-*) tell it, so no remaining
count exists to show. Each Codex account's card (Usage page, magpie quota
--json, /v1/magpie/quotas, /v1/magpie/quotas/cards) now has an "Image
generation" row (provider.WithImageLane, Lane "images", Text and Aside so
routing, holds, history, tray and statusline never see it): "Used up" with
the reset time while the image model rests on that account after a refusal
(the #2244 drawing-lane rest, whose time is the refusal's resets_at), and
"Unknown" otherwise. Never a share or a count. Shown in en, zh, zh-TW, ja, de.

app.js: a Text row's display now goes through t(), a same-length change, as
the core script budget has 1 byte of room.

Run (on mote): go test -count=1 -run 'TestWithImageLane|TestCodexImageRow'
./internal/provider ./internal/gateway ok; codex-image-row.test.cjs in
chromium and webkit at 900 and 390px in all five languages ok;
TestCoreScriptBudget ok; go vet darwin, windows, linux nogui on provider and
gateway ok; gofmt clean; 158 GUI files matching i18n/quota/usage/balance
names in both engines (result in the follow-up).
Broken by hand: the GUI test is red with app.js's display line put back to
the old form; the Go row tests are red with imageRestOf returning false.
Not tried: a real ChatGPT account hitting its image quota (the row is
driven by a faked refusal's rest); the generated-image count the issue also
asks for is not built.
2026-11-11 21:59:36 +08:00
yetone da169135a0 usage: an empty page says session files aren't read yet, and allows them (simonzyzy on X)
Claude Code's and Codex's sessions, and each call's tokens and time, need no provider: with the consent given, a sandbox HOME with no providers lists both agents' sessions and /api/usage/requests returns their calls (source log, ms, tokens). The only gate is sessions/reads asked=false, which the Sessions page asks but the Usage Overview and Requests pages did not mention; they said to point an agent at a catalog model. Now they say the files aren't read yet and offer one button that allows the agents found. The Sessions page says live output speed is measured only on gateway requests and where the files' own figures are.
2026-11-11 21:49:11 +08:00
yetone f5124ea179 library: a computer that follows the server says its changes are replaced (JiuLiaowkvn on X)
With Settings > Sync > This computer set to Follows the server, a skill
or MCP server added in the Library is replaced by the next sync, and the
reporter read that as the update deleting their skills. The Library now
says it in one line above Instructions, MCP, Skills, Hooks, Subagents and
Plugins (Memory too while memory is synced), with a link that opens the
This computer row. Nothing is said when sync is off, the part isn't
synced, or the computer syncs both ways. en, zh, zh-TW, ja, de.

Run on mote: library-follow-server.test.cjs (new, 48 cases x en/zh, 1100
and 420px) in chromium and webkit; broken by hand (note not appended) it
goes 29 red. Also green in both engines: i18n-keys, i18n-en-no-cjk,
sync-follow-server, library-items, library-intro-width, library-hooks,
library-all (chromium).
Not tried: the full suite, the real app, a real sync server.
2026-11-11 21:46:26 +08:00
yetone 0983bccc90 LESSONS: 11-11, a red on main fed with comment cuts instead of owned (#5918) 2026-11-11 21:34:59 +08:00
yetone 6cc182339a gui: the core's budget counts code, not comments (#5918)
TestCoreScriptBudget counted every byte of the core scripts, so a change
that reached the cap was paid for by cutting comments that said why the
code is as it is (five times on 11-10 alone, and 40-odd "comments cut"
in the budget's own history). Main was red on it again from 16ed1a952:
1,534,484 at 8016205e3 against a cap of 1,533,802.

The test now counts code only: blank lines, lines that are only a //
comment and /* */ blocks that start a line aren't counted (codeBytes).
The caps are set once to that measure at 8016205e3: app.js 1,086,267
(1,080,614 plus the 5,653 of room it had), the core 1,263,333 with no
room. That takes in the 682 bytes the old measure was over; the step
over was features measured with their comments. From now on cutting a
comment pays for nothing; moving a page out still does. The ~20KB of
history in the constants' comments is replaced by a pointer to
`git log -L` of the file.

Run on mote (Go 1.26.8), at this tree on origin/main 8016205e3:
- go test -tags nogui -count=1 -run TestCoreScriptBudget ./internal/gui: ok
- broken by hand: 20KB of // and a 5KB /* */ block appended to app.js
  stay ok; one 20-byte line of code on top fails "over their budget";
  restored.
- go test -tags nogui -count=1 ./internal/gui (the whole package): ok, 83s.
- gofmt -l internal/gui: clean.

Not tried: the GUI suite (no script changed).
2026-11-11 21:33:54 +08:00
yetone 7a1414f0cf site: a CodeBuddy docs page in en, zh and ja
/docs/codebuddy says how magpie runs Tencent's CodeBuddy on magpie's
models: CodeBuddy Code (@tencent-ai/codebuddy-code, codebuddy and cbc)
for codebuddy.ai and codebuddy.cn, and the CodeBuddy IDE (CodeBuddy.app,
CodeBuddy CN.app); the custom models in ~/.codebuddy/models.json
($CODEBUDDY_CONFIG_DIR) asking the gateway under a Bearer key with no
CodeBuddy sign-in; maxInputTokens, maxOutputTokens, reasoning levels and
contextWindow; settings.json's model read when a session starts
(restart or /clear); the IDE watching the file, reading the home
folder's .codebuddy and not settings.json's model; the user's own
models, turned-off models, default efforts and availableModels kept;
WSL; switching back and magpie codebuddy default. Each claim is from
internal/agent/codebuddy.go (its header, codebuddyIn, the notice),
workbuddy.go (buddyWriteAt, buddyModel), desktopapp.go and the
codebuddy row in wsl.go.
Linked from each language's Tencent Cloud and JetBrains Air pages; in
the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: CodeBuddy itself on magpie for this page; it names only
what magpie's source says.
2026-11-11 21:28:56 +08:00
yetone 8016205e3f provider: trust a self-signed server's certificate by fingerprint, for Remote magpie and any https address of your own (Zhangzhangi on X)
Zhangzhangi on X couldn't add a Remote magpie at a domain with a
self-signed certificate ("x509: "api.magpie.local" certificate is not
standards compliant") and asked for a skip-verification option. A
follow-up asked for the same on other self-signed hosts.

This adds a pin (trust on first use), not a blind skip. It is off by
default and kept per provider:
- Advanced → Server certificate → "Trust its certificate…" fetches the
  certificate the server shows (provider/peekcert) and lists its SHA-256,
  subject, issuer and expiry. "Trust this certificate" keeps the
  fingerprint as the provider's serverPin.
- From then on only that certificate is accepted (netproxy pinTLS:
  InsecureSkipVerify plus VerifyConnection comparing the leaf's DER
  SHA-256). Another one fails with PinMismatchError, saying the server
  showed a certificate other than the one trusted.
- The editor shows a red "Certificate not verified: only this one is
  accepted" with the fingerprint, and "Verify it again" drops the pin.
- The pin is set only on the provider's own hosts (provider.PinHosts):
  - every address of Remote magpie and of a provider added by URL;
  - for a preset (Ollama, LM Studio, OpenAI at your own box), only https
    addresses whose host is not one of the preset's or its regions' own
    hosts. A vendor's host never takes a pin.
  - Never for an account, Vertex or a subscription. Save refuses one
    elsewhere.
- The client certificate and Server CA still go only to the providers
  that took them before (TakesClientCert). A preset gets the pin alone.
- The editor's certificate rows (Client certificate and the new Server
  certificate) are drawn by a lazily imported tlscerts.js. The Client
  certificate row moved out of app.js with it, so the core scripts stay
  under TestCoreScriptBudget without a raise.

Run (Go 1.26.8):
- WSL magpie-desktop, before the rebase:
  - go test -tags nogui -count=1 ./internal/netproxy ./internal/provider
    ./internal/gui all ok;
  - GOOS=darwin -tags nogui vet of gui fails on traywindows_darwin_test.go's
    undefined trayImagePNG, the same at the base (a cgo-only helper).
- mote and mica, after the rebase on ab5824aee:
  - gofmt -l clean; node --check app.js;
  - go vet darwin (cgo), GOOS=linux -tags nogui, GOOS=windows: ok;
  - go test ./internal/netproxy ./internal/provider: ok.
- mote, at the final tree: node --check app.js and tlscerts.js; go test
  ./internal/gui -run 'Budget|ServerPin|InsecureTLS|ClientCert|OnDemand|Lazy'
  ok (TestCoreScriptBudget under 1,533,802) at the base ab5824aee.
  Rebased on fe5a0cf6d, TestCoreScriptBudget is red, as it is on that
  main alone: main's core is 1,534,708 (16ed1a952 took it to 1,535,318);
  this change takes it to 1,534,484, 224 bytes less (#5918, commented).
  The rest of the run above passes at the pushed head.
- mica, GUI files at the final tree, both engines inside each file:
  - green: provider-server-pin (54), mtls-settings (16),
    provider-insecure-tls (60), provider-socket (60), provider-http1 (60),
    i18n-keys, i18n-en-no-cjk, editor-advanced-align, provider-advanced-fold
    (50);
  - old-webkit: headerpresets.js not loaded (#6030) and Safari 15's :has()
    (#5919), both on main too;
  - menu-scroll: 24 of 24 red on /api/update/using, the same alone at
    origin/main fe5a0cf6d (#5982, commented).
  - Earlier flakes of provider-http1 beside another session's suite:
    #6159.
- Broken by hand, each red:
  - presets never take a pin: TestServerPinSaveChecks,
    TestServerPinPresetAtOwnServer, TestServerPinNoVendorHost;
  - vendor hosts pinned (the own-host check dropped):
    TestServerPinNoVendorHost;
  - client cert and CA sent to presets: TestServerPinPresetAtOwnServer;
  - the pin never compared: TestPinOnlyThatCertificate,
    TestServerPinRemoteMagpie.
  Restored: both packages ok.

Not tried:
- a real self-signed domain from the macOS app (httptest servers with
  their own certificates only);
- the Responses WebSocket dial (read only: it takes the same netproxy
  transport);
- go test ./internal/cli and the whole GUI suite before the tag (the
  full Go suite runs after it, under suite.lock).
2026-11-11 21:13:43 +08:00
yetone fe5a0cf6d3 gui: the nav's groups and masking tabs fly with the rest as the layouts trade places (#5434, invzhi on X, patch by ggbdpq)
The morph gives each nav tab a view-transition-name of its own (app.css
.nav-morph), but the list stopped at the eight tabs that existed when it
landed; Routing groups and Masking came later and only faded with the whole
sidebar. Both are in the list now, in the nav's order (ggbdpq's analysis and
patch on #5434, which sat without a PR since 11-08).

side-toggle.test.cjs now holds the masking tab's group to animating and every
tab drawn in the nav to a name of its own, all different, so the next tab
can't be left out. Run on mote: red on the old CSS in chromium and webkit
(no nav-masking group), 26 of 26 green after. Durations and curve are the
morph's existing .32s strong ease-in-out, unchanged.
Not tried: the live app; Routing groups is display:none in the header
layout, so its group is a fade there, as before.
2026-11-11 21:03:00 +08:00
yetone 466cd4809f gui: a plugin page's Copy picture works where navigator.clipboard is missing (nivekxft on X)
The day card's copy button showed "Cannot read properties of undefined
(reading 'write')" in magpie web opened over plain http (a LAN address) or in
a webview with no async Clipboard API: pageshare.js called
navigator.clipboard.write unguarded. It now tries the API when it exists,
else copies the picture as a selected <img> with the copy command, else
throws a message that says to save it instead (translated in zh, zh-TW, ja,
de). The desktop window was not affected: it already hands the PNG to
/api/plugin-pages/image. app.js's text copy already falls back (/api/copy,
writeText, execCommand), so no sibling is left on the raw API.

Run on mote: page-image-no-clipboard.test.cjs (new, chromium and webkit, en
and zh, navigator.clipboard removed), 4 of 4 red on the old pageshare.js and
green after; plugin-page.test.cjs and i18n-keys.test.cjs green.
go test ./internal/gui: only TestCoreScriptBudget red, on main already
(#5918); pageshare.js and i18n.js are not counted in it.
Not tried: a real http LAN page pasting the image into another app; the
execCommand path was observed selecting the PNG, not read back from the OS
clipboard.
2026-11-11 21:03:00 +08:00
yetone f3cdb03c8a agents: a Claude Code kept in another config folder is a row of its own (BieJian21872 on X)
Only the folder CLAUDE_CONFIG_DIR (else ~/.claude) names was found. Every
other ~/.claude… folder holding Claude Code's files (settings.json,
.credentials.json or projects/) is now claude#<name>, "Claude Code · <name>",
made by claudeIn at that folder (place.dir, as claude#launch is): connected,
model picked and checked in its own settings.json. With the variable
elsewhere, ~/.claude is claude#default. ~/.claude.json, another tool's
.claude-… folder and the launch file's folder are not rows. A folder
outside the home folder is not found (documented in agent-wiring.md).

Run at the pushed head's parent 16ed1a952 plus this change, on mote:
go test ./internal/agent (ok), ./internal/library (ok), ./internal/cli
(one red, TestEveryRouteHasACommandOrIsNamed on POST
/api/plugin-pages/arrange, not this change; #6162). gofmt clean; go vet
darwin, linux nogui and windows on internal/agent. Broken by hand:
dropping claudeDirAgents from onMachineAll turns
TestClaudeCodeInMoreThanOneFolder red.
Not tried: a real Claude Code against a second folder; GUI suite (no GUI
file changed); internal/gateway and internal/sessions were still running.
2026-11-11 21:02:21 +08:00
yetone 19782923c5 codex: the compaction magpie makes can go on a model of its own (0neB1aze on X)
Codex's memories had a model of their own, its compaction did not. Codex's row has a compaction model square (compact_model, settings.CodexCompactModel), read by the gateway on each compaction (codexCompactTo, before codexCompact). Only a compaction magpie makes is moved: it asks for a plain-text summary any model reads back. One a ChatGPT account seals, or a pick that compacts natively, is left, since only the writing account reads it (#1099); a disabled, unserved or key-barred pick is left with a log line. The text sent to the model is unchanged.

Run on mote: TestCodexCompactOnItsOwnModel (red with the move taken out) and TestCodexCompactToLeavesNative; go test for gui, settings, settingsapi, agent, provider, gateway; darwin, linux and windows vet; the GUI files in both engines. Not tried: a real Codex session compacting on the chosen model.
2026-11-11 20:57:11 +08:00
yetone a3f4aab12e routing: a Claude Code request's row says whether it ran in the TUI or as claude -p (Anotiaww on X)
startRun notes the entry on the request's context (noteEntry); serve copies it to Try.Entry and Try.EntryWhy (the claudePrint code). The Routing row shows a TUI or -p chip, with the reason in its title, in en/zh/zh-TW/ja/de. The bridge page also records the answer to Tossipe on X: a local Claude Code on a remote magpie sends its history each turn, and the remote resumes its session and types only the new turn, so the history isn't sent to Anthropic twice.

Run on mote: TestEntryNoted; routing-entry.test.cjs in both engines, five languages, 1000 and 480 wide; i18n-keys (a key repeating a Go string is reworded). Not tried: a real Claude Code run on each path.
2026-11-11 20:57:10 +08:00
yetone 98cff4b0d6 gui: Claude Code's mode is one row, and it switches in magpie web too (Anotiaww on X)
The provider editor's 'Claude Code runs as' row was disabled in magpie web as a gateway, so it read as a switch that doesn't switch, while a second Settings row for the same claudePrintMode was the one that worked there. The editor's row is enabled everywhere (savePrefs works in gateway mode) and the duplicate row and its CSS are gone.

Run on mote: claude-tui-setting.test.cjs rewritten for the one row, app and gateway, en/zh/ja/de, 1100 and 420 wide, chromium and webkit; the claude-*, routing-*, i18n-*, agent-*, codex-*, mobile-web, provider-*, settings-*, dsh-* GUI files in both engines against a base copy (the same reds on both; proxy-auth and Hide accounts differ run to run). Not tried: the real app's Windows and Linux webviews.
2026-11-11 20:57:10 +08:00
yetone 9786dd507c site: StepFun and LongCat docs pages in en, zh and ja
/docs/stepfun says how to use StepFun (阶跃星辰) in Claude Code, Codex,
Gemini CLI and OpenCode through magpie: the China (stepfun-cn,
api.stepfun.com) and international (stepfun, api.stepfun.ai) sites as
separate accounts; the Step Plan at /step_plan/v1 and /step_plan, its
key refused at pay as you go's; no Responses, so Codex's requests are
converted; the plan catalogs' models; the balance from /v1/accounts in
yuan or dollars, and the 5-hour and weekly windows told only to a
platform sign-in brought over by the bookmarklet and paste. From
internal/provider/presets.go (stepfun, stepfun-cn), stepfun_plan.go's
header, balance.go and the bundled catalog.

/docs/longcat says the same for Meituan's LongCat: one host,
api.longcat.chat, for longcat.chat's and longcat.ai's accounts; Chat
Completions and Responses under /openai/v1, Anthropic under
/anthropic; the key as a Bearer (x-api-key alone is missing_api_key),
which magpie's default of both headers covers; the list at
/openai/v1/models. From presets.go (longcat), longcat_test.go and
authheader.go.

Both linked from each language's "By provider" line after Xiaomi MiMo
(33 pages), in the sitemap, llms.txt and llms-full.txt.

Run: the six pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: a StepFun or LongCat key on magpie for these pages; they
name only what magpie's source says.
2026-11-11 20:53:11 +08:00
yetone c9b1a708db provider: a test that Kimi Code's month ranks keys whose 5h and 7d tie (0xBCD18E on X)
The report asked for Kimi Code's monthly window on the card and as the basis
for choosing among keys. Both already ship: readKimiCode reads the month
(limit_month_total/limit_month_code, limits[] by length) since v0.1.2022,
and routing weighs a key by every window it reads (Allowance.Renewal ranks
biggest first, Pace takes the tightest budget window). No behaviour change;
this pins it with the reporter's case: synced 5h/7d, differing months.

Run: go test -run TestKimiMonthRanks ./internal/provider via mote-run, ok.
Not tried: breaking it by hand (test-only, no code changed); a real key.
2026-11-11 20:52:43 +08:00
yetone 949d705048 lessons: 11-11, a -run of a package's own tests left its guards red
55dff77b4 ran `-run PluginPage ./internal/gui`; TestNoEagerPackageRegexps
and TestCoreScriptBudget went red on CI (817ccb56f, 24123d47a), fixed
in de10c6676 and f54920280. Docs only; nothing run.
2026-11-11 20:51:21 +08:00
yetone 16ed1a9524 gui: a setting's hint card starts at the pointer, not at the row's name (mmmg_btc on X)
Resting the pointer on Settings › About's 更新内容 row put the hint at the
far left of the row. 5710283da lined its text up with the row's name; the
pointer is what asked, so settingshints.js now keeps the pointer's x and a
card the pointer asked starts there (12px left of it, kept 16px inside the
window), with its grow-from origin at the pointer. A card a key asked
(focus) still lines up with the name. Every row hint comes through this one
module (Settings, a provider editor's fields, Routing groups), so they all
behave the same; native titles already show at the pointer.

Run on mote: provider-prefs-layout (card at the pointer; red on the old
code, 5 of 10), editor-hints, settings-hints (its pointer and key checks
changed), searcher-pick, settings-lines-wrap, sign-in-moves, and the gui-*
and i18n-* files, chromium and webkit; TestCoreScriptBudget; gofmt.
Reds: settings-hints "Settings' explanations show on hover and focus"
(chromium and webkit) fails the same way on base before reaching the
changed lines ("the card doesn't say the row's line"), and editor-hints in
webkit ("Tab didn't come back") fails on base too; both are filed.
Not tried: a live Mac window.
2026-11-11 04:45:46 -08:00
yetone ab5824aeea gateway keys: a limit in total never resets by the period, only by Reset usage (Cyrus_4433 on X)
The Limit window menu gains "in total" (period "total", CLI: gateway-key limit <id> total). It counts from when it is set or last reset and ends a century off (access.Limit.Window), so only Reset usage starts it again; its 429 says it stays refused until reset or raised, the row reads "$0.00 / $300 · 总额" with no reset time, and a remote key's window is "Tokens/Spend in total" with no reset. Old settings files read the same (new period only). i18n in zh, zh-TW, ja, de; reference.md and gateway-routing.md say it.

Run: TestLimitTotal and TestTotalLimitNeverResetsByThePeriod, red on the old code (Valid refuses "total"); gateway-key-total.test.cjs red without the keys.js change (5 of 5). Not tried: a real key through a live gateway; full suite follows after the tag.

Run (before this push):
- gofmt -l clean; go vet darwin, linux (nogui), windows clean.
- go test: internal/access, internal/budget, internal/cli, internal/provider ok.
- Go tests for the total period are red on the old code (Valid refuses "total"); the GUI test is 0 of 5 languages passing without the keys.js change.
- gateway-key-total.test.cjs and i18n-keys: 9 pass in chromium and in webkit (zh, zh-TW, ja, de, en; 500px width; no native select).
- Full GUI suite on mica, chromium: 46 reds in files this change does not touch (accounts, Pi/OpenCode Go, panel sheet, check-in, Aside provider, API key theme, allowed addresses); none is a key-limit test. Webkit pass still running; reds are to be compared with origin/main and filed after.
- TestCoreScriptBudget is red on origin/main 2d12e8274 by 7 bytes (1,533,809 > 1,533,802); this change touches no counted core script (#5918).
Not tried: a real key through a live gateway; the full Go suite (started after the tag).
2026-11-11 20:35:13 +08:00
yetone d1a2e92e89 gui: a setting's hint card starts at the pointer, not at the row's name (mmmg_btc on X)
Resting the pointer on Settings › About's 更新内容 row put the hint at the
far left of the row. 5710283da lined its text up with the row's name; the
pointer is what asked, so settingshints.js now keeps the pointer's x and a
card the pointer asked starts there (12px left of it, kept 16px inside the
window), with its grow-from origin at the pointer. A card a key asked
(focus) still lines up with the name. Every row hint comes through this one
module (Settings, a provider editor's fields, Routing groups), so they all
behave the same; native titles already show at the pointer.

Run on mote: provider-prefs-layout (card at the pointer; red on the old
code, 5 of 10), editor-hints, settings-hints (its pointer and key checks
changed), searcher-pick, settings-lines-wrap, sign-in-moves, and the gui-*
and i18n-* files, chromium and webkit; TestCoreScriptBudget; gofmt.
Reds: settings-hints "Settings' explanations show on hover and focus"
(chromium and webkit) fails the same way on base before reaching the
changed lines ("the card doesn't say the row's line"), and editor-hints in
webkit ("Tab didn't come back") fails on base too; both are filed.
Not tried: a live Mac window.
2026-11-11 04:31:37 -08:00
yetone f549202808 gui: resetClock's comment cut to one line, the core script budget back under at main
ca8ff054d (times follow the system's clock) ran TestCoreScriptBudget under
its budget at its own base; rebased onto main it was 7 bytes over, because
main had grown meanwhile. No raise: the comment above resetClock is shorter.

Run on mote: TestCoreScriptBudget ok at the rebased head.
2026-11-11 04:31:37 -08:00
yetone 52041e6bc5 gateway: a Team workspace's third-party refusal ("draw from extra usage", no "your") is redone as claude -p too (#5645, pidal20 on X)
Anthropic words the refusal "Third-party apps now draw from extra usage,
not plan limits. Ask your workspace admin to add more" on Team and
Enterprise. thirdPartyWords only matched the Pro/Max "your extra usage",
so an interactive turn was neither redone as -p nor recorded in
refusedTUI, and the raw 400 reached the caller every turn.

thirdPartyIn matches both wordings; its three uses (refusedTUI,
thirdPartySaid, which feeds redoable and thirdPartyRefused's message
selection) all go through it. Docs updated.

Run on mote: TestClaudeTUIThirdPartyTeamWording (reporter's literal text:
a TUI turn redone as print, and both thirdPartyRefused messages) red on
the old code (400 reached the caller), green now; go test -tags nogui
./internal/gateway ok; gofmt clean; go vet darwin, linux nogui, windows.
Not tried: a real Team account.
2026-11-11 20:23:13 +08:00
yetone 2d12e82740 site: Huawei Cloud MaaS and Xiaomi MiMo docs pages in en, zh and ja
/docs/huaweicloud says how to use Huawei Cloud ModelArts MaaS's Token
Plan (personal accounts, 西南-贵阳一) and pay as you go in Claude Code,
Codex, Gemini CLI and OpenCode through magpie: /plan/v2 and
/plan/anthropic, where alone the plan's quota is spent, beside
/openai/v1 and /anthropic; no Responses, so Codex's requests are
converted; the plan's models before the list is fetched (glm-5.3,
glm-5.1, kimi-k2.6, deepseek-v4.1-flash, deepseek-v4-flash), lowercase
as its OpenClaw page has them. From internal/provider/presets.go
(huaweicloud) and huaweicloud_test.go.

/docs/xiaomi-mimo says the same for Xiaomi MiMo's platform: a tp- key
spent only at its region's host (token-plan-cn, -sgp, -ams) and pay as
you go at api.xiaomimimo.com, each with Chat, Responses and Anthropic;
each region's catalog; the plans' $0 prices kept out of pricing
(membershipCatalogs, #1873); the MiMo app subscription served by
@magpie-community/opencode-mimo-auth, not this provider. From
presets.go (xiaomi), internal/provider/models.go and the bundled
catalog.

Both linked from each language's "By provider" line after ModelScope
(33 pages), in the sitemap, llms.txt and llms-full.txt.

Run: the six pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: a Huawei Cloud or MiMo key on magpie for these pages; they
name only what magpie's source says.
2026-11-11 20:18:12 +08:00
yetone 24123d47ad gateway: the Grok reasoning test says which requests it got (#6154)
On macOS race CI at de13afbf6 the test failed with "Grok was asked 3
times" and nothing more. It doesn't reproduce on mica: alone (30 of 30),
in CI's chunk c.0110 (8 of 8), or in 16 copies of that chunk at once
(32 of 32). The assertion stays: one ask sent twice costs the user a
vendor call. The failure now lists each request's method, path, size,
whether it carried a tool output, and when, so the next red names the
extra one.

Broken by hand (want 3): the message lists the two requests. go vet and
go test -race -count=5 ok on mica.
2026-11-11 20:16:49 +08:00
yetone fcf1a8c055 gateway: the listening test waits for the note, not just the socket
TestServingWritesDownWhereItListens read the note as soon as listening()
saw s.ln. ListenAndServe sets s.ln before recordListening writes the
note, so under load the read came first. It failed on macOS race CI at
de13afbf6 (run 43003416676): "while serving: {Addr: Pid:0 ...} false".
The test now polls ReadListening for up to 10s.

Run on mica:
- 300ms injected between `s.ln = ln` and recordListening: the old test
  red 3 of 3 (the CI message), the new one ok 3 of 3;
- injection removed: go vet ./internal/gateway, and go test -race
  -count=5 of the four listening tests plus
  TestGrokReasoningGoesBackThroughOtherAPIs, ok.
Not run: the full suite (test-only change in one file).
2026-11-11 20:16:49 +08:00
yetone 50ce30d56e gui: times follow the system's 12 or 24 hour clock (iXerol on X)
An en-US Mac set to 24-Hour Time showed Routing's request times in 12
hours: no webview hands the page the system's clock, and navigator.language
carries only the region. boot.js now says it as hourCycle ("h23" or "h12",
left out when the system names none, and for a browser tab, which keeps its
own): macOS from AppleICUForce24HourTime / AppleICUForce12HourTime, Windows
from Control Panel\International sTimeFormat, Linux from gsettings
clock-format. intlLang() adds -u-hc-<cycle> to its tag, so every formatter
that takes it follows, and the places that forced 24 hours (hour12: false,
hourCycle h23) spread hourClock() instead: 24 unless the system says 12.
Read once per 30s, so a change in System Settings shows at the next load.

Run on mote: new hc-clock.test.cjs (en-US on a 24h system, en-GB on a 12h
one, a silent system), chromium and webkit; Go tests for the three readers
and boot.js; gofmt; go vet darwin, windows and linux nogui; internal/gui
tests; GUI files of gui-*, i18n-*, panel-*, quota-*, reset-*, routing-*,
usage-* in chromium and webkit. TestCoreScriptBudget was over by 77 bytes
and passes with two app.js comments cut, no raise.
Broken by hand: hc-clock goes red (2 of 3) without the intlLang suffix.
Not tried: a real Windows or Linux session's setting (the readers are
unit-tested on their formats), a live Mac.
2026-11-11 04:13:38 -08:00
yetone 3f81fbf9a8 gui: plugin page inlining compiles its regexps on first use (#6145)
55dff77b4 compiled seven package-level regexps in pageinline.go with
regexp.MustCompile, so TestNoEagerPackageRegexps was red on main. They
now go through lazyre.New, like the rest of internal/gui.

Ran on mica at this tree (origin/main 817ccb56f + this change):
- go test -run TestNoEagerPackageRegexps . : ok (red in the full suite
  log at 6b4513082 before)
- go test -tags nogui ./internal/gui -run 'Inline|PluginPage|Page': ok
- GOOS=linux go vet -tags nogui ./internal/gui, GOOS=windows go vet
  ./internal/gui: ok; gofmt clean
Not run: the full suite or GUI suite (the change is a constructor swap).

Fixes #6145
2026-11-11 20:10:42 +08:00
yetone ac6db89339 gateway: a Grok "usage balance exhausted" 402 rests to the spent window's reset, not 30 minutes (@justacati on X)
Grok Build answers a spent allowance with 402 "usage balance exhausted".
"balance" matched creditWords, so the account rested as out of credit for
creditRest (30 minutes) and was asked again, refused again, though the
usage card knew the weekly window renews in 4 days. For a Grok plugin
account (plugin:grok, plugin:grok-plugin) that 402 is now failQuota, which
rests to the full window's reset (By "window"), and to the 15-minute quota
rest only when no window is known. Other vendors' 402s and Grok's other
402s (payment) are unchanged.

Run: TestGrokBalanceExhaustedRestsToReset red on the old code (credit, 30m),
green now; TestFactoryStandardOut*, TestResetsInWords and the Rest tests of
internal/gateway green; go vet darwin/windows/linux on internal/gateway.
Not run: full suite; a real exhausted Grok account.
2026-11-11 20:06:08 +08:00
yetone 7bcb161938 gateway: the MCP router gives Alma's Node fetch magpie-image: Sec-Fetch-Mode alone is not a web page (chang_lochuan on X)
Alma's MCP client is Node's fetch (undici in alma-server/lib/server.mjs). It
sends Sec-Fetch-Mode: cors on every request, with no Origin, no
Sec-Fetch-Site and no browser agent. hubVisitor used fromBrowser, which counts
Sec-Fetch-Mode, so Alma was an Away visitor and the HereOnly servers
(magpie-image) were neither listed nor run for it, while magpie-vision showed.

hubFromPage judges the hub's visitor by what a page's POST always carries and
its script can't remove: Origin (null under no-referrer too), Sec-Fetch-Site,
a Mozilla/ agent. The hub takes POST only, so the GET-without-Origin rebinding
case fromBrowser covers does not reach it; a rebound name is still refused
first by lanGuard's rebound (an Origin or Mozilla agent) and serveMCP refuses
any Origin that isn't listed in Settings. fromBrowser itself is unchanged for
heap, memory, join, restart and the rest. No per-agent token exists for a local
agent (the hub entry carries a key only from another machine), so the decision
rests on the marks, not on a credential.

Run (mote): TestHub* in internal/gateway; new
TestHubGivesAlmaItsHereOnlyServersNotAPage (Alma's headers are given
magpie-image; Origin null, evil, localhost, evil.localhost, tauri.localhost,
app://obsidian.md, chrome-extension://, Sec-Fetch-Site only, Mozilla/ agent
only, and three rebound-Host shapes get none and run nothing, no key). Red on
the old code ("Alma's fetch is given 200 [magpie-vision]"). Broke by hand:
hubFromPage = fromBrowser(r) goes red; dropping the Origin mark stays green
because serveMCP refuses an unlisted Origin on its own (two layers).
gofmt, vet darwin/linux(nogui)/windows, then go test -tags nogui -count=1
./internal/gateway (ok, 1283s) and ./internal/library (ok, 300s) at the
commit before the rebase onto origin/main.
Not tried: the real Alma app against a real hub (its config is the user's live one).
2026-11-11 19:55:21 +08:00
yetone de10c66766 gui: plugin page inlining compiles its regexps on first use (#6145)
55dff77b4 compiled seven package-level regexps in pageinline.go with
regexp.MustCompile, so TestNoEagerPackageRegexps was red on main. They
now go through lazyre.New, like the rest of internal/gui.

Ran on mica at this tree (origin/main 817ccb56f + this change):
- go test -run TestNoEagerPackageRegexps . : ok (red in the full suite
  log at 6b4513082 before)
- go test -tags nogui ./internal/gui -run 'Inline|PluginPage|Page': ok
- GOOS=linux go vet -tags nogui ./internal/gui, GOOS=windows go vet
  ./internal/gui: ok; gofmt clean
Not run: the full suite or GUI suite (the change is a constructor swap).

Fixes #6145
2026-11-11 19:50:56 +08:00
yetone 817ccb56f9 site: SiliconFlow and ModelScope docs pages in en, zh and ja
/docs/siliconflow says how to use SiliconFlow (硅基流动) in Claude
Code, Codex, Gemini CLI and OpenCode through magpie: the China and
Global sites as separate accounts with a site per key; Chat Completions
only, so Claude Code's and Codex's requests are converted; model names
with their maker, as models.dev's siliconflow catalog has them; the
balance query retired on 2026-08-14, so the card points to the
console. From internal/provider/presets.go (siliconflow), balance.go
(readSiliconFlow, siliconFlowGone) and the bundled catalog.

/docs/modelscope says the same for ModelScope (魔搭) API-Inference: a
ModelScope access token as the key, not DashScope; Chat Completions
and Responses at api-inference.modelscope.cn/v1; a hand-added entry
there taken as ModelScope; its async image tasks drawn one at a time.
From presets.go (modelscope), nvidia_modelscope_test.go and
internal/gateway/draw_modelscope.go's header.

Both linked from each language's "By provider" line after Baidu
Qianfan (33 pages), in the sitemap, llms.txt and llms-full.txt.

Run: the six pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: a SiliconFlow key or ModelScope token on magpie for these
pages; they name only what magpie's source says.
2026-11-11 19:43:15 +08:00
yetone f94ece2ffa catalog: a relay's 404 "no channel for this model" on one API sends the model to the next too (equinox0253 on X)
2c05df52b sent a model on to the relay's next API when New API answers 503
"No available channel ... under group" on the one asked. WandAPI answers 404
for the same case, so a GPT asked on its Anthropic URL stayed a 404.
catalog.NoChannel already took a 404 but only by the 503's words; it now also
takes a 404 whose JSON error carries New API's model_not_found code (code or
type) with a message that names a channel or a group, in English or Chinese,
and the Chinese 没有可用渠道.

A real 404 stays one: a wrong base URL ("404 page not found", HTML,
"Invalid URL"), Anthropic's not_found_error, and OpenAI's "The model X does
not exist or you do not have access to it" (same code, no channel or group
named) reach the client and nothing is remembered.

Fixture basis: New API's source (QuantumNous/new-api, middleware/distributor.go
and service/channel_select.go) gives no-channel as 503 with
ErrorCodeModelNotFound and "No available channel for model {{.Model}} under
group {{.Group}} (distributor)". I did not find WandAPI's 404 body: the 404
fixtures are built from New API's code and message template, not a captured
WandAPI reply. If WandAPI's wording names neither a channel nor a group, this
will not match; the reporter's body would settle it.

Run (mote, -tags nogui): go vet catalog+gateway; go test -run NoChannel
catalog and gateway: ok. TestNoChannel and TestNoChannelAs404FromAFork
(fallback taken; missing-model and wrong-base-URL 404s not) are red with the
404 branch switched off by hand.
Not tried: a real WandAPI account.
2026-11-11 19:42:17 +08:00
yetone b1f5806cb3 gateway: Copilot's Gemini keeps a nullable union untyped, its Grok gets namespaces flat (yuushabu_buyinn on X, #4374)
Copilot's Gemini models still answered 400 "invalid request body" to Codex
Desktop after the oneOf rewrite. RoyShen12's live isolation on #4374: the
cause is geminiToolTypes writing `type: string` beside a nullable union
(move_thread_to_project.projectId = anyOf [string, null]); removing that one
field made the full request 200. For a Copilot Gemini on chat, a union node
(anyOf or oneOf, any shape, nullable or not, at any depth) now goes as its
client wrote it, without the parent type; its branches are typed as ever, and
every other Gemini route (Vertex relays, plugins) is unchanged.

Grok 4.7 behind Copilot (Responses) is turned away over a namespace tool
(mcp__codex_app) and over a function whose parameters are a root union
(automation_update); Copilot's word is a bare 400/422, so nothing teaches
the refusal-learner. For a Copilot Grok the namespaces go flat
(namespace__name, provider.GrokFlatBody, nothing else of the body touched)
and root unions become objects (ObjectRoot); the model's call to a flat name
gets its namespace back through the existing namespacedIn path. GPT on the
same /responses keeps its namespace and unions as they came.

Run (mote, -tags nogui): go vet gateway+provider; go test -run
'TestCopilot|TestGemini|TestGrok|TestObjectRoot' gateway and provider: ok.
New TestCopilotGeminiKeepsNullableUnionsUntyped (anyOf, oneOf, array items,
$ref'd nullable), TestGeminiTypesOtherVendorsKeepTheirs and
TestCopilotGrokTakesNamespacesFlat (GPT unchanged) are red with the two
wiring lines reverted by hand, green with them.
Not tried: a live Copilot account (the fakes refuse with the shapes
#4374's isolation recorded); the full suite, started after the tag.
2026-11-11 19:42:17 +08:00