da29171a4e148e1815a608ed999023efcca7e2cf
8293
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
da29171a4e |
library: a plugin hook that reads CLAUDE_PLUGIN_ROOT itself gets the folder
@AXmake110 on X: with the Claude Code plugin ponytail installed for an
agent, every start of the agent printed a red error. ponytail's hooks
read the folder in Node, not through the shell:
node -e "require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-activate.js'))"
magpie replaced only ${CLAUDE_PLUGIN_ROOT} and $CLAUDE_PLUGIN_ROOT, so
the command went into Claude Code's settings.json (and, for the
UserPromptSubmit hook, Codex's hooks.json) as written. Outside Claude
Code's plugin runtime nothing sets the variable, and Node threw
"Cannot read properties of undefined (reading 'split')".
Fixed for the class (plugin_env.go):
- a hook program's own read of CLAUDE_PLUGIN_ROOT or CLAUDE_PLUGIN_DATA
becomes a quoted string literal of the folder, with forward slashes:
process.env.X, process.env['X'], Bun.env, Deno.env.get, Python's
os.environ[...]/.get/os.getenv, Ruby's ENV[...]/ENV.fetch. The quote
is chosen so it doesn't end the sh quoting around it. PowerShell's
$env:X / ${env:X} and cmd's %X% become the folder.
- a plugin's command MCP server gets both variables in its env, as
Claude Code gives them, unless the plugin set them.
- ${CLAUDE_PLUGIN_ROOT}/DATA in a subagent's prompt and in a copied
SKILL.md are resolved, as Claude Code resolves them in Markdown.
- every agent gets the same text: the parts are library items, so
Claude Code, Codex, Gemini, Cursor and Grok are all written from them.
- existing installs: load() heals the hooks, servers and subagent
prompts of an installed plugin that still name the variables, and the
next sync (the app's startup sync) writes them out again; the old
entry is replaced, not duplicated. A SKILL.md copied before is fixed
by the plugin's Update or a reinstall.
Not carried yet, filed as #6682: exec-form hooks (command + args, whose
args are dropped today) and CLAUDE_PLUGIN_OPTION_<KEY>.
The fixture is ponytail's published hooks files, byte for byte
(DietrichGebert/ponytail 96608e07, testdata/ponytail/README.md).
Run (mote; full suite at 901b56c80 on origin/main
|
||
|
|
411769e9c7 |
library: GitHub Copilot gets the Library's instructions with VS Code or JetBrains alone
@codealc on X (0.1.3827, Windows, Codex with Copilot as the provider): 资源库 › 指令 has no way to give GitHub Copilot instructions. The only Copilot row was Copilot CLI's, listed only when the CLI was detected (settings.json or the copilot command) and not uninstalled, so a user of Copilot in VS Code or JetBrains saw none. Which file Copilot reads, from each surface's own source: - Copilot CLI 1.0.95: $COPILOT_HOME/copilot-instructions.md, else ~/.copilot/copilot-instructions.md (run for real, below). - VS Code (microsoft/vscode d95071e96, promptsServiceImpl / computeAutomaticInstructions): ~/.copilot/copilot-instructions.md, plus ~/.copilot/instructions/**/*.instructions.md; its docs' reference table gives the same for the Copilot harness's user scope. - GitHub Copilot for JetBrains 1.21.0 (javap of the plugin's classes): getCopilotCliHomePath() (COPILOT_HOME, else ~/.copilot) + copilot-instructions.md. So Copilot CLI's agent now has shared "GitHub Copilot" (as Cursor CLI's ~/.cursor is the Cursor editor's) and a sharedApp check: VS Code, VS Code Insiders, or the JetBrains plugin is here. agent.SharedRead says so; SharedHere is true with it even before ~/.copilot exists, and targetsAsleep keeps a CLIMissing agent whose folder such an app still reads. The Library's row is named GitHub Copilot; the agent stays Copilot CLI on the Agents page. SharedName also names Copilot CLI's chats in Sessions, which are now "GitHub Copilot" as Cursor CLI's are "Cursor". The user's own text in copilot-instructions.md stays outside magpie's block, and comes back whole when magpie's instructions are emptied. Tests (internal/library/copilot_shared_test.go): row named GitHub Copilot; VS Code alone (no ~/.copilot) gets the row and the file written without making Copilot CLI detected; JetBrains plugin alone; the user's own file kept; CLI uninstalled with VS Code still here keeps the row, with nothing reading it drops it; COPILOT_HOME followed. TestCursorIsCursorCLI and TestCursorFolderFromTheEditorIsNotTheCLI now allow Copilot beside Cursor. Run: - The six new tests on the old code (source files checked out from |
||
|
|
a4dd893af4 |
gateway: test that a classifier group keeps its member's pinned account
@AWilsonPeng on X (v0.1.4178, OMP, ChatGPT with two accounts) picked the
found group GPT-6-luna as a routing group's intent model, pinned one of
its accounts, and saw intent decisions still choose between both. Not
reproduced: on main every case below asks the pinned account only. The
tests stay as a guard for the path.
A fake ChatGPT backend records the chatgpt-account-id of each request,
with two Codex accounts signed in:
- TestClassifierGroupKeepsItsMembersAccount: the group asked as a
classifier, own and found group, member pinned (provider/model#id) or
the group held (Group.Accounts), ordered and default routing.
- TestClassifierGroupPinnedAccountRefusing: the pinned account answers
429 usage_limit_reached; the other is never asked.
- TestClassifierGroupPinnedThroughATurn: POST /v1/chat/completions to a
routing group whose Classifier is the group, effort auto, 4 turns.
- TestClassifierGroupManualPickedAccount: a Manual group, the pinned
member picked.
- TestClassifierGroupPinnedEveryRouting: every routing, pinned and held.
The Routing log lists the other account under the classifier call's
left-out accounts, "another account is named for this model in {group}";
that may be what the reporter read as both being used.
Run at origin/main 221c91fae; committed on
|
||
|
|
217e933dd9 |
LESSONS: 11-14 afternoon, 14 tags with no green CI run behind them
After |
||
|
|
3ffac60480 |
docs: the management API's routing groups and the app's switch for it (#6307)
docs/reference.md's Management API lists the routing-groups routes (list, get, create, update and the Routing page's actions), says they are checked as the app checks them and that found/skip are not served, names the key menu's Advanced switch beside `magpie gateway-key admin`, and drops "this first part leaves out Routing Groups": what is left out on purpose is the export of sign-ins, which would hand out every account's secrets. docs/subsystems/gateway-routing.md says how the routes reach /api/groups (adminGroupActions, adminGroupWrite over provider.SaveGroup) and names the tests. The site's remote page says the same in en, zh and ja, and public/llms-full.txt is built again from it (node llms-full.mjs, on mica). Run: site's worker.test.mjs (llms-full current) in the full run before the push; no code changes here. Run for the three #6307 commits (mica, at 4eafd9963 on 90efddaba's successor, then the touched tests again after rebasing onto |
||
|
|
1cfa53b678 |
gui: a gateway key's management level is switched from its menu, under Advanced (#6307)
ljayic on X asked to give a key the management API without curl. A key's … menu has Advanced (after Rotate key) for keys that can hold the level: not the sharing key, a browser or read-only key, an issued or expiring key (the same set access.Update and adminOf accept). It opens the app's menu headed "Management API" with Off, From this computer and From any computer, ticked at the key's level, and posts /api/caller-keys/admin-key. A key that has a level says "Manages magpie" in its row, its title saying from where. Strings in zh, zh-TW, ja and de. gateway-card's menu list now names Model names (on main since before #6029) and Advanced, 8 items. Run (GUI, Playwright 1.62.0, both engines, en/zh/zh-TW/ja/de, 1100 and 420px): - gateway-key-admin (new), gateway-card, gateway-key-readonly, gateway-caller-keys: pass (mica). - key-page, i18n-keys, i18n-en-no-cjk: pass (mote, repo root). - gateway-key-admin with keys.js and i18n.js from HEAD: red 0/10 (waits for .key-admin on ops). - Whole gateway-*.test.cjs set, key-page, phone-connect-menu: the reds left are gateway-key-arrange at 420px, which is red without this change too (#6268), and gateway-card's 7 !== 6 on main (#6029), fixed here. Not tried: the real app with a second computer calling the API. |
||
|
|
261b84ba38 |
gui: the management API serves the Routing page's groups (#6307, ljayic on X)
ljayic asked again for routing groups through /v1/magpie/admin/. They are
served now as the other routes are, by the app's own handlers behind the
same guard (gateway/admin.go, by path prefix, nothing new there):
- GET routing-groups: the Routing page's /api/groups answer.
- GET routing-groups/{id}: one group as that list has it, by its id or the
ref agents pick it by (group/<id>, auto/<model>); 404 for none.
- POST routing-groups/create: the page's save, refused with 409 when the
id is a group's already (save would write over it).
- POST routing-groups/update: the page's save over the group as it is,
the fields sent put over its own, so one field changes alone; 404 for no
such group; "from" renames, as the page's editor does.
- POST routing-groups/{save,delete,copy,switch,arrange,pick,defaults,
template,share,import,show}: the page's actions as they are.
Members, combos (a group in a group) and each member's account
("provider/model#<account>") go through provider.SaveGroup, so what the
page refuses the API refuses: an account the provider has none of, an
account on a group, an empty group, a bad id, deleting a group a combo
holds. Not served: "found" and "skip" (the found-groups switches, which
move the agents set to a found group, rewriting this computer's agents).
Run (mica; mote was at load 62 with a GUI suite): go test -count=1
-run 'TestAdmin|Group' ./internal/gui ok; go vet ./internal/gui and
GOOS=windows go vet ./internal/gui ok; gofmt -l empty.
Red on the old admin.go (origin/main's, with the new tests): both new
tests 404. Broken by hand, each red in TestAdminAPIRoutingGroups: create's
409 check off (create over team served), update's merge off (a name-only
update refused as an empty group), "found" added to the actions (served).
Tests: TestAdminAPIRoutingGroups (create, combo, 409, four refusals the
page makes, get by id and ref, update keeps fields, member change, rename
carried into the combo, switch, arrange, found/skip 404, delete refused in
a combo then both at once, no provider key told);
TestAdminAPIRoutingGroupsGuarded (through gateway.New().Front(): no key
401 from loopback and the network, a key that may not manage 403 from
both, a local key from the network and through a proxy 403, Origin 403,
five routes each, nothing made; then local from loopback and any from the
network 200).
Not tried: the full suite (both boxes had a GUI suite running; it runs
before the push), a Linux vet of gui (needs WebKitGTK; wsl-run before
the push), a real request from a second computer.
|
||
|
|
221c91fae3 |
gui: the gateway card opens the chat page
The gateway card gets a "Chat page" button beside Restart gateway while the gateway runs. It opens <gateway>/deepseek-chat/ in the browser, or, in web mode, the public URL's chat page. Both buttons sit in one .gw-acts group, so a narrow card wraps them together, and Restart keeps its .gw-fix class (the takeover, pause and port-holder tests read the first .gw-fix). The label is translated in zh, zh-TW, ja and de. Run: gateway-chat-page.test.cjs in Chromium and WebKit, every language, at 1100 and 420 wide, on mica: ok. It is red without this change (no button). At |
||
|
|
6bdeedc6fb |
gateway: serve DeepSeek's chat page with magpie's models
@yanghonghang asked on X for DeepSeek's open-source web chat page (deepseek-ai/chat-demo) to run on magpie, with its search and link reading served by magpie's own. magpie now serves it at <gateway>/deepseek-chat/, with no setup: - The page is the v0.1.1 release (MIT, LICENSE kept in the zip), embedded and served from memory. Its API origin is rewritten to location.origin+"/deepseek-chat", and magpie.js adds a model picker: any magpie model answers, sent as the magpie_chat_model cookie. - On this computer the page needs no key of the user's. Another computer types a gateway key, as for every other route. - POST anthropic/v1/messages maps deepseek_web_search to magpie's web_search_20250305 and deepseek_read_url to a read_url tool magpie runs itself with fetchPage between rounds. Each round goes through the gateway's own Messages route, so routing, keys, limits and usage are the same as an agent's. - Files (images, PDFs, text) are kept in memory until a restart; Word, PowerPoint and EPUB are refused with 415. ASR and TTS go to the speech models set in magpie. - Only the page's GET/HEAD static files are keyless (readOnlyRoutes and lanGuard's chatPageOpen), served under a strict CSP. Its models, chat, files and speech routes need a key from another computer, and a read-only key is refused on each (readOnlyRefused). Docs: docs/subsystems/gateway-routing.md, "DeepSeek's chat page". Real use: a sandbox magpie (sandbox HOME, port 3486 on mote) served the page in Chromium; a Claude answer with web search showed citations and source chips, a DeepSeek link read answered from the page, and the picker was checked in light and dark. Run: go test -tags nogui -run 'TestChatPage|TestReadOnlyKeyEveryRoute' ./internal/gateway on mica, ok. Without this change every TestChatPage* is red (the routes 404), and TestReadOnlyKeyEveryRoute is red with the chat routes missing from readOnlyRefused. |
||
|
|
cd75e3ca80 |
gateway: a held text block's citations go after its start
With function tools in a request, anthropicTextCalls holds an empty text block's content_block_start until its first text_delta, in case the text turns out to be a written call. A cited line streams its citations_delta before its text, and those went out at once: before the block they belong to had started. A client that keeps blocks by their start (DeepSeek's chat page, the Anthropic SDKs) dropped or choked on them, so web search answers relayed with tools lost every source. Seen live: a remote magpie's Claude answer had 19 citations_delta with the start first, and the sandbox's relay put all 19 before it. Now a delta other than text on the held block lets the start go first. Run: go test -tags nogui -run 'TestTextCallsCitationAfterItsBlock|TestChatPage' ./internal/gateway on mica, ok. TestTextCallsCitationAfterItsBlock is red on the old textcalls_anthropic.go (citations_delta before content_block_start). |
||
|
|
0581197059 |
usage: a table's account cell has its name above its address
normalcoder_ on X (tweet 2121623100425134513): in Usage > Overview's table, the account cell put the name and the address side by side, so a long one was cut. The name is now on the first line and the address, the key plan it stands in for and shared keys each on a line below it, with the cell's whole width; a masked page's eye stays on the name's line. Run (mote): usage-table-acct-lines.test.cjs, chromium + webkit, en zh zh-TW ja de, 1100 and 420px: 20/20 here, 20/20 red on origin/main |
||
|
|
47684ef176 |
usage: a table column is what its windows are of, not their names
normalcoder_ on X: in Usage > Overview's table, Antigravity's
"Gemini · 5 hours / 7 days" landed in the last ("Other") column, since
columns were keyed by window name. That holds for every provider whose
names don't match the column keys.
columnOf keys a pooled window to its pool's column (poolWord, "Claude &
GPT" under Claude) and names the window in the cell; any other window
goes by its span (spanOf: "Weekly", "7 days" and "7d" share a column,
headed by the name most rows use, a number on a tie); a window with no
span goes by its name.
Run (mote, chromium + webkit, en zh zh-TW ja de, 1100 and 420px):
usage-account-subcards.test.cjs 40/40 here, 40/40 red on origin/main
|
||
|
|
2a6ab83d8a |
usage: each account of a provider's card is a card of its own; the ⋯ keeps its room
normalcoder_ on X (v0.1.4079, Usage > Overview): accounts inside a provider
card were told apart by a hairline only, and the card's ⋯ was drawn over
the end of the head ("Show the other accounts in brief" was hidden).
- renderQuotas puts each account of a card with several into a
.subscription-acct box (a provider's keys, a balance a line, stay
lines); quotaCardMenu looks through the box for the account's head.
- The head keeps 18px for the ⋯ whether it shows or not; where nothing
hovers, the ⋯ is always shown.
- Core budgets +57 (app.js) / +81 (core): renderQuotas draws every card,
so there is no page to move it to.
Run (mote, both engines):
- usage-card-menu-room.test.cjs: 20/20 here; red 20/20 on origin/main
|
||
|
|
cfd70c60c2 |
update: the old pill quiet ran through 0.1.4181, not 0.1.4179
Comments and docs only: v0.1.4180 and v0.1.4181 were tagged before
|
||
|
|
3f09b9ffc6 |
update: the header's Update pill shows a waiting update at once; only its x holds it, for 3 days (visamzh, normalcoder_ on X)
visamzh (0.1.4174, 0.1.4176 downloaded, Update button and Automatic updates on) and normalcoder_ (0.1.4079) saw no Update pill for about two days. Cause: |
||
|
|
1106a33a89 |
routing: every account row in Accounts and keys shows all its windows
zwm_vincent on X: with two subscription accounts, Accounts and keys showed one window per row, 5H on one and 7D on the other, so neither row said what was left in the other window or when it reset. A subscription account's row now has one line per window Usage read: the short name (5h, 7d), a small bar, what is used or left, and when it resets. Each part's column is as wide as the widest down the list (in ch, CJK counted double), so the names, bars, values and resets start at the same place on every row. Where a row is too narrow (the list in columns at a phone's width, under 215px) the bar is left out and the reset wraps under, alike on every row. The hover still has each window in full with the day and time it resets and when it was read. The single-figure status, the windows line and the bottom bar are not drawn for such a row; wallets and accounts with no windows keep their one line. Tests: routing-account-windows.test.cjs adds a second account whose binding window is the week and checks both rows show both windows with their bars (40%/12%), the hover text, every column's left (and the reset's right) equal across lines and rows, nothing cut, no sideways scroll; en, zh, zh-TW, ja, de at 1100px and 420px, Chromium and WebKit. routing-pooled-card and routing-read-allowances read the new lines. Run at this head, rebased on origin/main |
||
|
|
af62d3d646 |
routing: a try's answer in the caption is figures in fixed places
Puremilk_chun on X: the caption over the Routing stage told an answer
as one sentence ("Codex's own sign-in (gpt-6.1-sol) 以 high 推理强度
用 41 秒 完成回答 · 197.5k token · 35 秒 后出首字 · 40 token/秒 ·
请求缓存命中率 98%"). Its length and line breaks moved with every
value, so the reader had to find each one again.
The caption now lays the answer out as a grid: who answered, its model
and effort on top; under them the duration, tokens, first token, speed
and cache hit rate, each a value over its existing label ("Duration",
"Tokens", "First token", "Speed", "Cache"; no new strings). Five to a
line; three to a line where the stage is 720px or narrower (a byWidth
class, no container query, WebKit #1249). A figure the try doesn't tell
is a dash in its place, so the others keep theirs. The sentence stays
on hover and in the steps list below. The caption's min-height grew so
the next answer doesn't move the page.
Test: routing-answer-figures.test.cjs plays the reporter's request
(41 s, 197.5k, 35 s first token, 40 tok/s, 98%) then a shorter one
with no first token and no cache figure, and checks every part keeps
its x, its line and the caption its height, nothing is cut, the effort
sits on the account's line, no sideways scroll; en, zh, zh-TW, ja, de at
1100px and 420px, Chromium and WebKit.
Run at this head, rebased on origin/main
|
||
|
|
171fce511a |
gateway: Google's suspension of an Antigravity or agy-cli plugin account rests it as restricted (plugins#1148)
googleSuspended read Google's 403 "disabled in this account for violation
of Terms of Service" only for an account whose Agent is antigravity or
gemini, the built-ins. An account of the community Antigravity plugin, or
of agy-cli, has Agent "plugin", so its suspension was an unknown failure:
a minute's rest, doubling to ten, and asked (and refused) again every few
minutes for good. plugins#1148's reporters saw a 403 followed by a dozen
more tries. googleSignIn now also takes a plugin account whose plugin
provider is antigravity or agy-cli; such an account rests two hours as
restricted, and the last one left is answered by magpie without asking
Google, as the built-in's is.
Run (mote, base
|
||
|
|
0b8c4bfc34 |
agent: Claude Code's permission mode is set in magpie and kept (EricChenChannel on X)
The report: "every time I configure settings.json it is overwritten and
reset" for permissions.defaultMode = bypassPermissions.
Cause, reproduced in a sandbox HOME with Claude Code 2.1.316: magpie's
writes to ~/.claude/settings.json are key-level and kept the user's
permissions block. Claude Code itself drops the mode: it ignores
bypassPermissions at launch unless skipDangerousModePermissionPrompt is
true, and its auto-mode nudge and /config write defaultMode over it.
Change:
- agent.Field gets Own: the user's own setting of the agent. Apply does
not record it, Disconnect neither clears nor restores it, Pick never
connects the agent for it, magpieValueIn is false for it, and profiles
(Fields, ApplyFields, InUse) and the WSL copy leave it alone. So the
mode outlives disconnecting magpie and switching profiles.
- Claude Code's permission_mode field (default, acceptEdits, plan, auto,
dontAsk, bypassPermissions; "" removes the key) writes
permissions.defaultMode, and bypassPermissions also writes
skipDangerousModePermissionPrompt: true so Claude Code honours it.
- GUI: own fields go in agentJSON.own, apart from fields, and
agentcompact.js draws them in an Advanced fold (collapsed) under the
agent's settings, with the app menu (no <select>). app.js unchanged.
Labels in en, zh, zh-TW, ja, de (zh: 高级 › 权限模式 › 跳过权限确认).
- docs/subsystems/agent-wiring.md: Fields and options row.
Run at this tree (base
|
||
|
|
aa358555ff |
LESSONS: 11-14, two sessions fixed TestInfoSaysMCPHub at once
The review loop and another session each wrote the hub pruner fix;
|
||
|
|
49f49c41c1 |
gateway: its end waits for the MCP hub's pruner, which reads MCPHub
keepHubPruned ran on its own goroutine with nothing waiting for it, so ListenAndServe could return while the pruner was still between ticks or in Prune. It reads MCPHub, which tests swap with withHub, so a test that waited for one gateway's end and then swapped the hub raced the old gateway's pruner: TestInfoSaysMCPHub, ubuntu Race on CI at |
||
|
|
90efddabae |
gui: providers can be picked and removed together (eiyuuzaki2333 on X)
Many API providers added meant removing them one at a time. Select, by
the Providers search box (shown with two or more), puts a box on every
row as Routing's groups and Library's lists have it: a click on a row
picks it rather than open its editor, Shift picks the rows shown
between, and the bar's box picks every row shown. Remove asks once, in
the app's own dialog, with the count and every name, then posts
POST /api/providers/delete {ids}. That runs provider.Delete for each
id, as the editor's Remove does, inside one agent.Reseat, so agents
move once, to where they end up. One it can't remove comes back in
`unremoved` with why, stays picked and is named in the status; the call
is refused only when nothing was removed. Done or Escape ends picking.
The rows, bar and removal are in pvpick.js, imported when Select is
first clicked. The core grows 270 bytes (pvSel, the button's click and
two lines in renderProviders), and coreScriptBudget is raised by that
with the reason. "{name} wasn't removed: {error}" moves from Library's
words into core i18n.js, since core code says it now.
Run (rebased on origin/main
|
||
|
|
e6e0585bd3 |
antigravity: reword Hermes', OpenCode's, Codex CLI's and pi's identity lines, which Google refuses since 11-14 evening
Since about 18:43 on 11-14 Antigravity answers 429 "Resource has been exhausted" to a system instruction holding "You are Hermes Agent" (Hermes' current persona), "You are OpenCode", Codex CLI's "You are a coding agent running in the Codex CLI" or pi's "a coding assistant running inside pi", whatever quota is left (@ZhouYimingsjtu, @Lmohn39 on X). Hermes' earlier persona is still refused as "You're … created by", so it keeps its "built by". Tried on a real account (gemini-3-flash), each alone: Codex GPT-6's prompt, Claude Code, Gemini CLI, Qwen Code, Cline, Kilo, goose, Amp, Droid, Kimi, Aider and Cursor pass as written. agTurnedAway gains the four lines; agSaidAs rewords them "You're …" and "running within pi", the smallest change that passed 5/5 on the real account (gemini-3-flash: pi 1.5.0's full default prompt, both Hermes personas, OpenCode's first lines, Codex CLI's prompt; claude-sonnet-4-6: pi 5/5), through the antigravity plugin's cloak, which has the same lines (plugins a617ecfd, antigravity 0.1.16, agy-cli 0.1.48, antigravity-cloak 0.1.9). The refusal's hint names the agent: new OpenCode, Codex CLI and pi hints, Hermes' covers both personas, word for word the plugins' and the Routing page's (client.js HINTS, i18n zh/zh-TW/ja/de). Run (mica; mote was over its 18 cores): - go test ./internal/gateway -run 'Antigravity|Cloak|CodeAssist': ok - go test ./internal/gui: ok - GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gateway ./internal/gui: ok - node --test i18n-keys, i18n-en-no-cjk, routing-ag-turned-away (both engines): 38 pass - gofmt -l: clean Broken by hand: with the pi and OpenCode lines out of agTurnedAway, TestAntigravityCloakRewordsEveryLineItTurnsAway and TestAntigravityHermesHint go red. Not run: the full go test ./... (mica had another session's full suite running, mote over load) and the whole GUI suite; the change is strings in four tables plus the hint switch. |
||
|
|
e0ed2c4d81 |
gateway: model ids without the provider can be listed alone, in place of provider/model
qQianye on X (v0.1.4094 in Docker, several WorkBuddy accounts): the
client on their computer lists every model as provider/model and they
want those hidden. The advice was the Agents page's model list, but
gateway mode (what the Docker image's web page runs as) has no Agents
page. Settings › Network and sharing › Model ids without the provider
was drawn there already, but only added bare ids beside the prefixed
ones, so the list got longer, not shorter.
The row is now Off / On / Only. Only (settings.BareModelIDsOnly,
POST /api/settings/bare-ids {"on":true,"only":true}) lists each bare id
in place of the first row it stands for (provider.OnlyBare) and leaves
the other rows it stands for out: the found group it reaches
(auto/glm-5.3) and every provider's row of that model it reaches. A row
the bare id doesn't reach (b/vendor/m9, whose bare id names provider
vendor), a held key's row whose bare id isn't listed for it, and other
groups keep their ids, so no model leaves the list. Requests by
provider/model are served as before; only /v1/models changes. Another
magpie's list is unchanged. Claude Code's discovery, which drops a bare
row it wouldn't keep because the full row is there, lists it by its
alias with Only (there is no full row). Off clears Only.
Run, at this commit (base
|
||
|
|
3dbbb173ed |
gateway: spawn_agent names every model for a Codex an app-server host runs under its own name
@m0eaki on X (magpie 0.1.4159, Codex 0.169.0 through LobeHub's
app-server, /v1/responses): the lead saw only Codex's first five of a
local catalog of 13. `codex app-server` makes the host's
clientInfo.name its originator and the head of its User-Agent (codex-rs
initialize_processor.rs, set_default_originator), so LobeHub's turns say
"lobehub-desktop/0.169.0 (…) (lobehub-desktop; …)", and the gate before
spawnAgentModels took only Codex's own names (fromCodex) or the codex
token.
The class: any host may name Codex's turns after itself (Zed, LobeHub,
other IDEs). Every Responses turn Codex sends, to any provider, carries
x-codex-window-id (and x-codex-turn-metadata): core/src/
responses_metadata.rs compatibility_headers. codexRuns takes those as
Codex's too, beside fromCodex and the codex token, for spawnAgentModels
alone. spawnAgentModels still widens only a body with Codex's own
spawn_agent signature or <model_catalog>, and its added text is the
same neutral line (nothing naming magpie or Codex). spawnChoices at /v1
reads the codex catalog and the key's list, not agentOf, so a host's
lead gets the catalog magpie wrote for Codex. codexForClaudeCode reads
the same headers through codexTurnHeaders now.
codexTiered stays on the old gate (split out of the same if).
Gates that send a request upstream as Codex's own, to a relay that
checks it (codexAsSent, codexNamed's header forwarding, keepTurnAsks),
stay on Codex's own names. The other gates on fromCodex (subagent pick,
resume and follow, hookKind, codexOwnOffMagpie, codexTiered, the events
only Codex reads) are left as they are, filed as #6653.
Test: TestSpawnAgentNamesEveryModelForAnAppServerHost posts at
/v1/responses with the headers Codex 0.169.0 sends under LobeHub
(User-Agent lobehub-desktop/0.169.0 (Mac OS 26.5.0; arm64) unknown
(lobehub-desktop; 2.1.40), originator lobehub-desktop, x-codex-window-id),
a lead on magpie's model, in four shapes (tools, V2 additional_tools,
model_catalog_in_context, tool search; the real 0.162.0 and 0.169.0
fixtures), and checks that the same app name without Codex's turn
headers is left as sent.
Run (on mica, mote's load was 100):
- Broken by hand: the old gate back in place, the four LobeHub
subtests go red, the four without-headers ones pass. Restored, green.
- gofmt -l clean; go vet ./internal/gateway, GOOS=windows and GOOS=linux
go vet ./internal/gateway: clean.
- go test ./internal/gateway -run SpawnAgent -count=1: ok.
- go test ./... -count=1 -timeout 45m at base
|
||
|
|
bc9ea912a5 |
contributors: 11-14 two of ggbdpq's patches needed the review again (#5452, #5197)
From the review of |
||
|
|
7a9c40413b |
gateway: only a PDF goes as a translated file, with a filename (#5452)
Review of the commit before. It wrote a Messages `document` and a Responses `input_file` for a file of any type. Anthropic's base64 document takes only a PDF, so a .docx or .csv that used to go as the "[attachment …]" note would now get a 400 for the whole turn, the #934 risk. Both encoders now write the file only for application/pdf with data. Any other file is still described in the note. - The Responses input_file carries "filename": "document.pdf" beside file_data, as OpenAI's shape has it. Part has no field of its own for a file name: Name is a tool's, and is read in many places. - A Messages document by URL is described in the note, not sent as a url source. A file reference from another vendor (Gemini's fileUri is an https Files-API link) is not something Anthropic should fetch. - On the read side, a `document` with a text source carries the document's words, so it becomes a text part rather than base64 inline data. A base64 source is a file. A url source is a file reference. Anything else (a file_id source) is left out, as before. Run on mica: TestOnlyAPDFGoesAsAFile, TestResponsesFileHasAFilename and TestAnthropicDocumentTextAndURLSources fail at the commit before (a csv sent as input_file, no filename, the text source not carried as text) and pass here. The patch's own tests (pdf_translation_test.go, image_input_test.go) fail with the product files at origin/main |
||
|
|
fee33668db |
gateway: a PDF survives translation (#5452)
A PDF reached the model only when the request was relayed as sent; the moment magpie translated it, the file was lost — the Responses input_file and the Messages document were dropped whole, and the Chat file became the placeholder text "[attachment application/pdf]" (#5452, NemoAir: three paths located line by line; a ChatGPT API account speaks only Responses and only streams, so a Chat request to it always translated and its file always became the note, and a non-streaming Responses request to a stream-only account lost its input_file while the same request streamed arrived whole). The parts parse into file parts now — the Responses input_file (a standalone item, its file_data and filename flat on the item, and a message block, flat as the OpenAI shape has it or nested as a Chat client sends) and the Messages document — and the Responses and Messages encoders write inline data in their own tongue (input_file / document), where Gemini's inline data already rode. A file only referenced — a Gemini fileUri on the vendor's storage, or another host's file id — is still told of: Responses' file_id is OpenAI's own, Anthropic's url source takes http(s) and not a cloud-storage scheme, and the Chat encoder keeps telling of the file rather than carrying it, Chat upstreams' file support being uneven and a 400 there losing the whole turn (#934). The Claude subscription line renders text to its CLI, which carries no PDF either way. Rebased onto the video work (#6135), which reads an input_file of a video alone and left this face standing: a video rides the video machinery still, and every other file — a PDF, say — is a file part. Generated-by: GLM-5.3-Flash (ZCode) Landed from @ggbdpq's patch on #5452, reported by NemoAir. The commit after it scopes the change to PDFs. |
||
|
|
131037e2ba |
gateway: preserve Codex model-list OAuth alongside gateway keys
A managed x-api-key made identifyCaller overwrite Codex's valid ChatGPT bearer with the internal token. /models then forwarded that token and returned 401, losing the configured model metadata (#5197). Keep the bearer privately only for the native model-list GET after key validation. Restore it on a request copy used by both the model-list cache and its upstream ask, removing gateway authentication fields. Key-only requests remain refused; other routes keep normalization. Verification on Go 1.27.3, macOS arm64, based on |
||
|
|
a49f3745eb |
claudetui: use a conpty folder beside the executable before Windows' own ConPTY
Windows 10's conhost (10.0.19041) drops bracketed paste marks, so Claude Code
takes a long message as many pastes and submits only part of it (#5205).
Windows Terminal's conpty.dll with its OpenConsole.exe keeps them. When
<exe dir>/conpty holds both, CreatePseudoConsole and ClosePseudoConsole come
from it; otherwise from kernel32 as before, so nothing changes for anyone who
does not add the folder.
Landed from @ggbdpq's verification on #5205. It's opt-in: without
<exe dir>\conpty\{conpty.dll,OpenConsole.exe}, both calls still come
from kernel32. The red/green evidence is the thread's: two Windows 10
machines (19044, 19045) with Terminal's ConPTY 1.24/1.25 passed 1 to
217 KB pastes intact, and lost them with conhost 10.0.19041.
Run on xiaomi-gpu (Windows 11, no conpty folder, so the kernel32 path):
go vet ./internal/claudetui ok, go build -tags nogui ok, go test
./internal/claudetui: every test passes except
TestShimFirstMessageWaitsForTools, which fails the same way at
origin/main
|
||
|
|
8769a5819a |
gateway: a rest ends at the time it shows, after the Mac slept (plugins#1126)
A rest's end came from time.Now().Add(d), which carries Go's monotonic
reading, and restOf and Retry-After compared by it. On macOS that clock
stops while the computer sleeps, so a WorkBuddy AI rest to 00:40 still
held at 09:57 the next day: 17h22m past its end, against 17h26m of
sleep in pmset's log over the same span (Xiang-Player's measurements).
onWall drops the monotonic reading. It is applied where magpie keeps a
deadline for minutes to days: the three places a rest's end is set
(restAfterMarked, restSlow, restDrawer), Codex's held refusal, Claude's
quota shelf, a Codex window's reset and a search key's rest. Shorter
waits (a request's patience, ten-minute shuns) are left as they are; a
sleep can only stretch them by their own length.
TestRestsKeepTheWallClock records a rest through the quota and 500
paths, a slow start and a search key, and checks none counts on the
monotonic clock.
Run on mica at this tree: go vet ./internal/gateway (darwin, linux,
windows); go test ./internal/gateway -count=1 -timeout 45m: ok (883s).
Broken by hand: onWall returning t unchanged turns the test red on all
four paths.
Not tried: a real Mac sleeping past a rest; a test can't sleep the
machine.
At the pushed head (rebased on
|
||
|
|
42cc557015 |
library: an agent's profile id (claude#magpie-desktop) is an agent's id on every route
@AXmake110 on X: on Library > Claude plugins, clicking the chip of a Claude Code config folder (claude#magpie-desktop) answered `agent "claude#magpie-desktop": not an agent's id`, so the plugin couldn't be turned off for it. The page draws a chip for each profile agent (claude#, hermes#, omp#), and the library already writes skills, MCP servers and instructions to them (targets.go), but checkAgent took only name or name@wsl:distro. checkAgent is the one place an agent id is validated in the library. It now takes name[#profile][@wsl:distro], the profile a plain file name like a distro's. That fixes each route through it: plugins/agents (PluginAgents), an agent's own instructions (SaveInstructions Extra, setup.go's extras), skills/how (SetSkillHow) and carry.go's import. The other chip routes (skills, servers, hooks, env, subagents agents) never called it and already took profile ids. No GUI change. Run on mica (mote at load ~130): - TestLibraryTakesAProfilesAgentID (new): with origin/main's library.go put back it FAILs at the plugin's off for the profile with `agent "claude#magpie-desktop": not an agent's id`; passes with the change. It also checks bad ids (claude#, #work, claude#../x, claude#a/b, claude#a#b, claude#.x) are still refused. - gofmt -l internal/library: nothing; go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: ok. - go test -tags nogui ./internal/library ./internal/gui -count=1: ok. Not run: the full go test ./... (mica had another session's gateway run and GUI suite going), the GUI suite (no GUI file changed), a real Claude Desktop profile. Run at base |
||
|
|
1ab2c39843 |
tray: the menu bar and panel leave out what Usage's Overview hides (onkashiko on X)
onkashiko on X: a quota hidden in the main window still showed from the menu bar. |
||
|
|
534b1a334e |
lessons: 11-14 two changes pushed before their own suite, at a coordinator's ask
Recorded from the review of |
||
|
|
61e2035d39 |
gui: a Windows start no one can answer is never asked where to install, so the gateway comes up (v0.1.4160-4166 release check)
Every magpie-releases build from v0.1.4160 to v0.1.4169 failed windows-check (amd64 and arm64) at "Launch magpie": the exe logged "magpie 0.1.4166 started (app, ...)" and the gateway never answered, so none of those versions has assets. Cause: |
||
|
|
ee6352b638 |
gui: black's dark page is #000000, and a dark colour darkens the page in its hue (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS on X (tweet 2121543612278472704), on the dark theme: 「现在的纯黑……感觉色对不上」 beside Chrome's black, and the darkest navy of the system's picker 「感觉是有浅灰存在,所以导致深变浅」. Their screenshots: black's page (2,1,7), Chrome's (0,0,0); navy #191047's page (24,23,29), card (31,30,36), the grey of Graphite's. Why (appearance.go ground()): - the dark grounds went down by the same amount on every channel, so app.css's cool grey cast stayed: black's page was #000003, its card #08080c, a blue-black next to Chrome's #000000; - how dark a pick is was its mean channel against the page's. #191047's mean (37) is above the page's (27), so a deep navy counted as light and only got a breath of hue (0.08): the same grey page as Graphite. What changes: - darkness(): a pick's OKLab lightness under 0.4 (Graphite #52525b is 0.44, every preset 0.51 or more) is how far the dark grounds go toward black; 1 for black. #191047 is 0.23, so 0.43. - as a ground goes down it loses the grey's cool cast by as much, and takes more of the pick's hue (0.08 + 0.25 x darkness). Black's page is #000000 with neutral steps above it (card #090909); navy's page is a near-black navy. - Graphite, the presets, colours lighter than 0.4 and the light theme are unchanged; lifted() (where the ink starts) is unchanged. Measured (Settings > General zh, dark, 1200px; screenshot pixels, the same in Chromium and WebKit), before -> after: - black: page #000003 -> #000000, card #08080c -> #090909 - #191047: page #191821 -> #0c0b17, card #22212a -> #151420 - #130830: page #17161e -> #0b0813, card #201f27 -> #14111c - Default, Graphite (#1a1a1e / #232327), teal, #7f1d1d: unchanged Tests: - TestDarkPickDarkensPage: black's grounds are neutral greys; three dark blues draw a darker, blue page with text >= 7:1 and the accent >= 4.4:1; Graphite and the presets have darkness 0. - TestBlackIsBlack: black's page is #000000 exactly. - appearance-look: black's dark page is rgb(0, 0, 0); #191047 draws a dark navy page with Settings' list on its card (dark), and keeps the light page's lightness (light). Fixture gains #191047. Run on mote (load ~22-35 over its 18 cores; mica's disk is full, 116MB free), at this change on origin/main |
||
|
|
106a24b95e |
library: skills from GitHub and git update by themselves when switched on
0xYaCo on X: "skill 能自动化升级吗?". magpie already checked for skill updates by itself (every 12h, as the Skills tab opens), but each update waited for a click on Update. A new switch, Update by themselves, sits under the Skills list while a skill comes from GitHub or git (POST /api/library/skills/auto-update; `magpie library skill auto-update on|off`; library.json's autoUpdateSkills, this computer's own). It is off by default. When it is on, KeepSkillsCurrent (a gateway.WhileServing loop) runs AutoUpdateTick 2 minutes after start and then hourly. Every 12h that runs CheckSkills, then UpdateSomeSkills on the skills found at "update". So a skill changed here stays in Unupdated with its Update button, one removed upstream is only marked, and a replaced edited version goes to the backups, as with an update by hand. Updated names and a new error are logged. Run (WSL2 magpie-desktop, Go 1.26.8; mote was at load 167, mica's disk full), at ab637d3c4 (this change on |
||
|
|
32c830fc16 |
tui: speaks the language picked in Settings, Simplified Chinese first
zaidu259434 on X asked why magpie's CLI/TUI pages don't support Chinese. The GUI had en/zh/zh-TW/ja/de; the TUI had English only. - internal/uilang: the language pick the tray already made (the setting, else the system's: zh-Hant regions to zh-TW, other zh to zh, ja, de) moved out of internal/gui so the TUI asks the same function. The tray calls it unchanged; its tests moved with it. - internal/tui/i18n.go: tr/trf look a string up by its English text in a zh table (464 entries), falling back to the English. zh-TW reads Simplified for now; ja and de stay English. Terms come from the GUI's i18n.js where the same word is there (供应商, 路由, 用量, 会话, 资源库, 分组, 方案 …). - Every user-visible string in the TUI goes through tr/trf; widths that counted runes (Library's name column, sessions' columns) use lipgloss.Width, so 共享指令 is no longer cut to 共…. - Names stay names: agent and model ids, flags, commands, and the field labels magpie/ultracode/harness/opus/sonnet/haiku/fable. TestEveryWordHasZh reads the TUI's source (every tr/trf literal, every hints label, the tables shown through tr, agent field labels) and fails on a word with no zh, on a zh format that takes the English one's arguments badly, and on a zh entry no longer shown. Not changed: the CLI's own output is still English (#6649). Run: - mica (macOS): go vet ./internal/uilang ./internal/gui ./internal/tui; go test -count=1 -timeout 45m ./... was still running when this was pushed (pushed on the coordinator's ask); its result goes on #6649. - wsl-run (Linux): go vet + go test ./internal/tui ./internal/uilang ok; GOOS=windows go vet ./internal/uilang ./internal/gui ./internal/tui ok; GOOS=darwin CGO_ENABLED=0 go vet ./internal/uilang ./internal/tui ok. - Real TUI (go build -tags nogui) in WSL magpie-desktop, sandbox HOME with settings.json {"lang":"zh"}, tmux 150x40: every page (Agents, Providers, Routing, Usage, Sessions, Library), the add-provider picker, sessions stats, the gateway line and footers read in Chinese. The Library row showed 共… before the lipgloss.Width fix, 共享指令 after. - Broken by hand: an added tr("zzz untranslated") and a zh format with its %s dropped each turned TestEveryWordHasZh red. Not tried: zh-TW, ja and de wording (they fall back as above); the TUI on Windows' console. |
||
|
|
21f8ef61c4 |
provider: a complete Qwen AI platform sign-in is taken, and no sign-in error quotes a token (@imthe99galaxy on X)
On v0.1.4159 the Qwen AI platform's sign-in (qwen-token-plan) was
approved, and magpie failed it with "the Qwen AI platform answered in a
form magpie doesn't know: {"Data":{"Status":"complete","Credentials":
{"User":{"Id":"…"},"ExpireTime":"…","AccessToken":"RACv…"…". Two bugs:
1. qianwenWait decoded the device/token reply into a struct.
encoding/json matches a name whatever its case and fails the whole
reply on a value of another type (a number Id, an accessToken or user
field beside AccessToken/User, a BOM), where the QianWen CLI 1.10.0
(ul and ll in @qianwenai/qianwen-cli's dist/bin/qianwen.js, read from
the npm tarball) looks up the names it wants and ignores the rest.
readQianwenReply now reads it as the CLI does: Data.Status ?? status
?? authorization_pending; Data.Credentials.AccessToken ??
credentials.access_token; ExpireTime ?? expire_time; User{Id, Email}
?? user{id, email}; by exact name, a value of a type it doesn't expect
taken as absent. A RefreshToken is ignored, present or not: the CLI
has no refresh, the user signs in again when the token runs out.
The reporter's reply was quoted only to its first 300 characters, so
which field failed it is not known; every type and case mismatch
that could is covered, and the CLI's other (lowercase) form is read.
2. The error quoted the reply, live access token included, and the user
posted it publicly. QuotedReply (quoted_reply.go) scrubs a reply
before it is quoted (redact.ScrubJSON: a field named for a secret
wholly, a key-shaped value anywhere). The class:
- volcHead, every Volcengine / Alibaba Cloud / Tencent Cloud / Qwen
AI platform error that quotes a reply, the Qwen sign-in's and its
console token mint's ("gave no token") among them;
- apiError's fallback for a body of no known shape (APIError, every
upstream refusal and token endpoint that uses it);
- Copilot Auto's "picked no model" (its reply carries session_token);
- mcpauth's dynamic client registration failure (may carry a
client_secret; it was quoted whole and unbounded, now cut at 300);
- signInFlow.finish, where every built-in and plugin sign-in ends:
its Error goes through redact.Scrub, so a plugin's or vendor's
error text quoting a token leaves it there; the Qwen flow's own
failure likewise.
Tests (internal/provider/qianwen_plan_test.go):
- TestQianwenSignInReadsEveryCompleteForm: the reporter's head with and
without a RefreshToken, a number Id/ExpireTime, a like-named field of
another type, the CLI's lowercase form, a BOM. Red on the old code
(3 forms failed with the reporter's message, the lowercase one never
ended), green now.
- TestQianwenErrorsQuoteNoToken: unreadable replies' errors, volcHead,
APIError and QuotedReply never hold the token, and still say the
words of a plain error (Throttling, RequestId). Red on the old code
(sign-in errors and 8 quotes held it).
- TestSignInFailureQuotesNoToken: finish's Error. Red with the Scrub
line taken out by hand, green with it.
Run:
- on magpie-desktop (WSL, mote's load was over 40 to 135) at this tree:
gofmt -l clean; go vet -tags nogui and GOOS=windows go vet on
internal/provider and internal/mcpauth ok;
go test -run 'Qianwen|SignInFailure|SignIn|APIError|Volc|Alibaba|
Tencent|CopilotAuto' ./internal/provider ./internal/mcpauth: ok.
- Full go test -tags nogui -timeout 45m ./... was started there at this
tree and was still running at push (pushed on the coordinator's ask);
its result goes in a follow-up note.
Not tried: a real sign-in to the Qwen AI platform. The owner's browser
has no platform session (it asks for a phone sign-in), so the complete
reply's tail past the reporter's 300 characters was not seen; a live
device/code + device/token poll answered as the fake does
({"Data":{"Status":"authorization_pending"},"RequestId":…,"Success":true}).
darwin go vet: mote's load was over 100 for the whole run; the files
have no darwin-only code, and linux and windows vet are ok.
|
||
|
|
7a69f455cb | lessons: 11-14 the updater shipped on chosen packages while both run boxes were busy | ||
|
|
39e33f46f7 |
provider: ZCode's mover min is 0.1.66, which keeps a gift-only account's requests on its free quota (bg5eau on X)
bg5eau saw ZCode's free grant stay unspent while pay-as-you-go was charged. Two routes in the plugin could do that for an account with no GLM Coding Plan: a model the Start Plan balance doesn't name was still sent on the Start Plan, where it is metered, and a plan-list read that failed sent the key to the coding plan's /api/anthropic host, which bills a key with no plan pay-as-you-go. 0.1.66 (plugins 87a8cf03) refuses the first with a 400 that names the models the gift serves, and keeps such an account on the Start Plan when the plan list doesn't read. It also carries 0.1.65 (plugins 1dbbc1fb): a -Trial pick with no gift names the weekend plan ZCode holds unclaimed, which only ZCode's app can claim behind its captcha (heduian, bg5eau on X). The min makes keepMovedCurrent update every moved user. Run: npm view --prefer-online shows 0.1.66; on mote (load ~150; mica's disk is full), go test -tags nogui -run 'Moved|Mover|Migrat|ZCode' ./internal/provider ok; gofmt clean. Plugin at 87a8cf03: packages/zcode bun test 271 pass, 0 fail; bun scripts/check.mjs zcode ok; the unnamed-model test red with the guard off, the stays-on-Start-Plan test red with the catch change off. Not tried: a real gift-only account, a real pay-as-you-go charge, a real weekend plan claim, Windows and Linux, a full go test ./... before the tag. Which of the two routes bg5eau hit is unknown (no request log). |
||
|
|
ed82d8fab1 |
agent: a plugin's connect is given magpie's decision models as decisionModels
An agent plugin's connect() got only chat models in `models`, and
/v1/models leaves decision models out too, so a plugin had no way to
learn magpie's Jev, Clef or plugin `decides` models, though
/v1/systemone and /v1/decisions answer them (baranwang on X,
tweet 2121551068022915149).
connect's input now has `decisionModels`, apart from `models`:
provider.OfferedDeciders (what /v1/models lists under
X-Magpie-Deciders), then the decision routing groups, each
{ id, name, provider | group: true,
endpoints: ["/v1/systemone", "/v1/decisions"] }, [] for none.
`models` and /v1/models are unchanged. Docs: reference.md,
agent-wiring.md, site plugins page (en, zh, ja) and llms-full.txt.
Run at 87f358b70's tree rebased on
|
||
|
|
659ca3f026 |
gateway: through a Remote magpie the log records the tier the other magpie sent (JackyFill on X)
Codex -> magpie1 -> (Remote magpie) -> magpie2 -> a ChatGPT account, with Fast on in magpie2 alone: magpie2 sent service_tier priority and logged the served tier unknown (the ChatGPT backend says "auto"/"default" whether priority ran or not, servedTierAt). magpie1 only saw that "default" in the relayed body, from a host that isn't chatgpt.com, and logged tier_sent "" and tier_served "default". A try asked by another magpie (magpieAsks) now says on its reply's header the tier it sent its vendor (X-Magpie-Tier-Sent, "none" for none) and, when that vendor's "auto"/"default" tell nothing, X-Magpie-Tier-Unsaid: 1 (stampTier, from holdWriter.writeHeader). The asking magpie takes them from a Remote magpie's reply alone (tierThere in heardReply; a vendor's X-Magpie- headers are still never passed) and records them as the try's tier_sent and an unknown tier_served, in the usage log and on the route. A chain passes the farthest magpie's on. docs/subsystems/gateway-routing.md says so. Run (wsl-run, Linux, at this head): new TestRemoteMagpieTierRecorded (one server as both magpies, its key's tier fast then standard, the backend answering auto/default) green; broken by hand: with the four source files at origin/main it fails with exactly the report, "sent '' served 'default', want sent 'priority'"; the whole internal/gateway package ok (932s, -timeout 45m) at 5a28b17c6 (on origin/main |
||
|
|
9f4e1120f3 |
agent: a Codex not connected is never pointed at magpie for account failover
TylerBai_loveai on X (tweet 2121532671180632290): with several ChatGPT accounts added in magpie and Codex not connected, Codex's requests went through magpie anyway; only adding Codex in Agents, then Disconnect, put it back. Cause: Sync's `failover` in codex.go wrote `openai_base_url = "http://127.0.0.1:3425/backend-api/codex"` (stash codex.failover), or pointed a CC Switch OpenAI mirror's base_url at the gateway (codex.mirror_failover), for any Codex signed in to ChatGPT with another of its accounts on (#1385), on every start and Sync, unless the user had disconnected Codex or turned on "Only switch Codex's sign-in". The row said not connected while every request went through magpie. Fix: failover writes nothing any more. A Codex that isn't wired or using magpie as its provider gets what failover wrote before taken out by Sync: the marked base URL, or the mirror's base_url. A base URL the user wrote by hand has no mark and stays (#856). Failover between Codex accounts comes with connecting Codex. modelOptions no longer counts failover as through magpie, so a pick of Codex's own model on the Agents page doesn't go via magpie. codexProxyOK (the proxy probe only failover waited for) is gone. The CLI's and GUI's switch-only lines, reference.md and the subsystem pages say failover is for a connected Codex. Users already affected: the first Sync after updating (magpie's start) removes the marked openai_base_url or mirror base_url, and the route change restarts Codex's app-server; Codex then goes straight to OpenAI on its own sign-in. A thread opened while it was on magpie keeps its provider until reopened, as after Disconnect. Tests: - TestCodexNotConnectedStaysOffMagpie: two spare accounts on, Codex not connected; SyncCatalog, Sync twice and a model pick leave no base URL, no model_provider, not Wired/FailingOver/CodexOwnOnly. - TestCodexFailoverFromBeforeTakenOut: a marked base URL and a marked mirror base_url from before are taken out, bytes restored exactly. - TestCodexSwitchOnlyKeepsCodexOffTheGateway, the CC Switch mirror, disconnect-stays and proxy/EndFailover tests reworked to seed the old state by hand; TestCodexFailoverHeldWhileProxyDoesNotPassOn deleted with codexProxyOK. Red on the old code (old codex.go + codex_proxy.go, new tests, mote): TestCodexNotConnectedStaysOffMagpie, TestCodexFailoverFromBeforeTakenOut and TestCodexSwitchOnlyKeepsCodexOffTheGateway fail with the reporter's line `openai_base_url = "http://127.0.0.1:3425/backend-api/codex"`; TestCodexCCSwitchOfficialOpenAIMirror fails with the mirror pointed at magpie. Run (mote; mica's disk is full, 100% with other sessions' runs, and mote's load was ~17-25 of 18): - At base |
||
|
|
fc7941ca60 |
antigravity: Gemini 4's late INVALID_ARGUMENT is asked again, and says it isn't a region block; min 0.1.14 (Lawson0112 on X)
Lawson0112 (v0.1.4152, Windows, Codex) saw every request to antigravity/gemini-4-hydrogen end "400 · failed, 2 tries" after 20-38s and asked whether it was a region block. It isn't: Google refuses a region at once with FAILED_PRECONDITION "User location is not supported..." (regionWords). A 400 after the model has thought is Gemini 4's late INVALID_ARGUMENT, which Code Assist writes as a bare JSON line with no "data:" (sse_bare.go). The plugin's quiet retry read only data lines, so it never ran for the real reply. Antigravity 0.1.14 (plugins 2596d259) reads the bare line, asks again as it meant to, and words an INVALID_ARGUMENT that stays as "<model> turned down a call it built while thinking, asked N times (Google: ...). Not a region or account refusal". The mover's min goes to 0.1.14 so every moved user gets it (dist index: 0.1.14 latest, 10:34:14Z). Run: go test ./internal/provider in WSL (magpie-desktop) at this tree: ok 125s. gofmt -l clean. mote was at load 150-180 and mica's disk full. Not tried: Gemini 4 itself; no account here is served it (gemini-4-* listed -disabled, 404). See the plugins commit for the rest. |
||
|
|
9434044773 |
update: Restart to update puts in the version already downloaded, with downloads on a click too
sakamotokurome on X: "重启能不能跟更新分开,我本来下载一个新版本了,点击restart, 结果它又跑去下载了". With Settings' "Download updates automatically" off, a version downloaded on a click (Download update) was not what Restart to update put in: the click's recheck asked the feed first and, magpie having released again since, downloaded the newer version whole while the user waited (keepsStaged kept the one waiting only with downloads automatic, |
||
|
|
14807bcf20 |
update: a Windows download kept outside Downloads asks to install too
@XBJNTMs2mDbsvPH on X: on Windows magpie ran from wherever the
downloaded exe was and updated itself in place there, so deleting the
download deleted magpie, and opening copies of different versions left
several Magpie entries in the Start menu.
Cause: update.Settle installed the exe into %LOCALAPPDATA%\Programs\magpie
only when it ran from the known Downloads or Desktop folder or a temp
folder. A browser set to save elsewhere (D:\下载), or a download moved
into a folder of the user's own, never counted, so that copy stayed the
app, updated in place, and each copy opened was an app of its own to
Windows (its own path: taskbar, Start's lists, Open at login,
Magpie.lnk repointed at whichever ran last).
Now an exe still named as the site's download
(magpie-windows-amd64.exe, "… (1).exe", arm64; downloadName) counts as a
download wherever it is, but only through the existing install dialog,
never unasked (no dialog, no install). Installed, it opens the installed
copy as a download in Downloads does, and a newer one replaces it.
Cancel on such a copy is kept in HKCU\Software\magpie NotInstalled (the
exe's path): it runs where it is from then on, is not asked again and
never forwards; another copy is still asked. Cancel in Downloads is not
recorded, as before. forwards() (no magpie.com beside a forwarding
copy) follows the same rule. Uninstall's ForgetInstallDir takes the new
value out with InstallLocation. A renamed copy (D:\Tools\magpie.exe)
is left alone as before. No new UI: the dialog is the one from
|
||
|
|
a63923e3dd |
lessons: 11-14 a third guard left red by chosen packages (80a315a70, route parity)
|
||
|
|
dbac411b2e |
gui: TestRestartedWindowIsDrawn puts the other app in front as the user would
The behind and cover cases start a WinForms window as "the app the user is in" and wait 20 s for it to hold the foreground. Windows lets it take the front only while the test's old magpie may give it away, and that depends on what held the foreground before it: run alone on the Windows box at |
||
|
|
ffb14c8260 |
gui: a restart by itself asks Windows for no attention (shangyuan0818 on X)
shangyuan0818 on X (Windows, AutoRestart and auto-update on, lightweight
mode off): magpie's window turned up on the taskbar by itself, its
button flashing orange, while they were in another app.
The cause: Wails (v3.0.0-beta.24) activates every window as it makes
it, hidden ones too. The panel's frame change (Frameless, run() in
webview_window_windows.go) and the main window's centring
(CenterWindow) are SetWindowPos calls without SWP_NOACTIVATE. The new
magpie a restart by itself starts runs in the background and may not
take the foreground, and Windows answers that ask by flashing the
window's taskbar button (HSHELL_FLASH) until it is clicked. Where it
may (nobody at the keyboard for a while), a hidden magpie window took
the keyboard from the app in front instead. The main window was then
shown with SW_SHOW, which activates it again, and a minimised one with
SetWindowPlacement(SW_SHOWMINNOACTIVE), which activates it all the
same.
Now a WH_CBT hook on Wails' main thread (noactivate_windows.go, put on
from appWndProc, which every WailsWebviewWindow message passes) turns
down HCBT_ACTIVATE for a magpie window that isn't shown, and for one
being shown quietly: showHere without focus (showQuietly) and
showMinimised. The tray's message-only window and Wails' disabled
main-thread window share the class and are left alone. A window the
user opens is shown and focused as before. Adding SWP_NOACTIVATE to the
moves' WINDOWPOS in WM_WINDOWPOSCHANGING doesn't stop the activation
(tried on the box).
TestRestartBySelfAsksNoAttention (new) plays the restart in a child
process, window and tray modes, another window in front: it records
the shell hook's notes for magpie's windows and the foreground, needs
none of either, the page drawn and visible, then that a user's
ShowMain brings the window to the front.
TestRestartMinimisedComesBackMinimised now makes its app with
windowsOptions(), as the real app does; without them its window kept
the foreground it took at creation and it was red on main and on this
change alike.
Run, on the Windows box (xiaomi-gpu, Windows 11, interactive session):
- TestRestartBySelfAsksNoAttention: red on the old code, green both
modes with this change, green again at the pushed tree.
- TestRestartMinimisedComesBackMinimised: red on the old code ("the
window minimised took the foreground"), green with this change,
restore and draw included.
- TestRestartedWindowIsDrawn (13 cases, the behind/cover cases shown
quietly under another app): 13 of 13 at the pushed tree, with the
setup fix in the commit after this one.
- The whole internal/gui package, old code and this change, compared:
the same reds both sides apart from the two tests above (plugin-page,
import-row, container and client-cert tests red on the box on main
as well) and TestRestartedWindowIsDrawn's setup flake, fixed after.
- Broken by hand: the hook not put on, red (window 0x4 activation,
tray took the foreground); showingQuietly never set, red (window:
0x4).
Full suite on mica at 31a08ce8c (this change on
|