c9e8422fa8c2b8eb96dfb7ff0c91c2caef1306bd
2530
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c9e8422fa8 |
agent: a field label with no TUI Chinese fails internal/agent's tests
A new agent field's label with no entry in internal/tui's zh map left TestEveryWordHasZh red on main twice ( |
||
|
|
3b4983710a |
gateway: a usage cap holds with sessions in parallel (yalifesign on X)
yalifesign runs 4 or 5 sessions on one ChatGPT Plus account with a 90% cap and capStop/capCareful off, and the five-hour window went to 100% and Codex's own 429. Caps from 99 down to 90 all overshot. Cause: a Codex reply reports usage (codex.rate_limits, x-codex-*) as its turn begins, without that turn's own spend. The near-cap gate ( |
||
|
|
618bfc1a95 |
kimi: pick Kimi Code's subagent pool and its effort (XiaoLing_Arisa on X)
XiaoLing_Arisa asked on X for Kimi Code's subagent pool (子代理池) on the
Agents page: which models its subagents may run on, and how hard they
think. Kimi Code 2.x keeps them in config.toml's [secondary_model]:
default_model (the legacy `model` stands for it), the pool
[secondary_model.models] ("alias" = "when to use it") and default_effort.
- internal/agent/kimi_secondary.go: three fields, subagent_model,
subagent_pool and subagent_effort, written the way Kimi Code takes
them. Its validator refuses a pool that lacks the default, a name with
no [models."…"] table, and an effort a pool model can't take, so a
default goes into the pool, a pool without the default gets its first,
and only the levels every pool model takes are offered
(kimiPoolLevels). A magpie model goes in only while [providers.magpie]
is there. Keys are set in place; hints, other keys and comments stay.
Before Sync or Unwire drops a magpie model table, its name leaves the
section (kimiPruneSecondary). The default goes back to the user's own
(stashed at kimi:<path>:secondary) or to the pool's first, and an empty
section goes. The user's own pool of their own models is never touched.
kimi-cli (legacy) has no such section. A stopped WSL distro shows none
of the three, since each reads the config (#3896).
- GUI: the three fields form one Subagents line in the opened row: the
model, then the effort (disabled until a model is set), then a
multi-pick pool menu that stays open between ticks. The model's tick
can't be removed. The picker's note says an unset model runs each
subagent on the lead's model. The line is drawn by kimisub.js, which
Details imports before its first slide so the sheet measures it.
- Size budgets +457 (reason in core_budget_test.go). Translations in
zh, zh-TW, ja and de. kimisub.js is added to old-webkit's list of
scripts loaded on demand. The Kimi bullet in agent-wiring.md is
updated.
Run at this tree on mica (mica-run):
- go test -tags nogui -count=1 ./internal/agent ./internal/gui: ok,
including TestKimiSubagentPool*, TestWSLColdPlaceOpensNothing and
TestCoreScriptBudget. An earlier run of these packages found the cold
read and the budget overrun; both are fixed here.
- go vet ./... on darwin, GOOS=linux go vet -tags nogui ./... and
GOOS=windows go vet ./...: ok. go build: ok. gofmt -l .: empty.
- GUI: kimi-subagent-pool passes 20 of 20 (Chromium and WebKit, 5
languages, 1100 and 560px). kimi-thinking passes. agent-details-ready,
old-webkit and i18n-keys have 35 reds, and origin/main
|
||
|
|
ff88ec264a |
sync: subscriptions whose sign-ins stay on this computer (Ethereal499 on X)
Sync's sign-ins can now leave chosen subscriptions out on one computer
(`signInsExcept`, provider ids; Ethereal499 on X keeps Claude's accounts
off other computers). On that computer:
- its accounts of those subscriptions never go up;
- the server's accounts of them are never merged in, so a removal or a
new account on another computer changes nothing here;
- the server keeps them as they are for the computers that do sync them
(syncOnce splits the remote set with SignIns.Except and puts the held
part back with With after the merge, so the hash doesn't change);
- the preview and Restore count and restore none of them.
An id names both the built-in and its -plugin id. An old config has no
field and syncs everything as before. The setup text doesn't carry the
choice, since it belongs to one computer.
GUI: Settings > Sync > edit > Advanced, under "Sign-ins", a "Not synced"
row with a multi-select openProtoMenu of the subscriptions with an
account. The row shows only while the sign-ins tick is on. The strings
already existed in en, zh, zh-TW, ja and de. CLI: `sign-ins-except=`
on the WebDAV, S3 and GitHub setups ("none" clears it), and status
shows the excluded ids. docs/subsystems/sync-backup.md says it.
Tests:
- TestSignInsExcept (provider) and TestSyncSignInsExcept (davsync, two
computers on a fake DAV).
- sync-signins-except.test.cjs: both engines, 1100 and 420px, all 5
languages.
Broken by hand, each red and then restored:
- the Except in collect;
- the Except on the remote set before the merge;
- the Except in the preview;
- the With after the merge;
- the GUI form's post of signInsExcept.
Run:
- At
|
||
|
|
873b1f7d5e |
classify: 15 seconds unset for a classifier that reasons, and its cut call is magpie's wait (ESern29751 on X)
ESern29751 on X (v0.1.4341): in a routing group with intent recognition, magpie often 499-cancels the intent classifier's request, with MiniMax, GPT-6 Luna and Grok 4.6 as the classifier. Cause: those models reason before they answer. The classifier asks for reasoning_effort none, but MiniMax thinks anyway and Grok 4.6 and Luna go no lower than low. Through the live gateway with the classify prompt over a real routing prompt (~5k tokens of context): grok-4.6 took 4.7-8.1s (288-462 reasoning tokens), minimax-m2.5 3.7-10.3s (439-1012 output tokens), gpt-6-luna 1.2-7.2s; cold calls reached 12-29s. The unset classifier timeout was 8 seconds, so most turns were cut off, fell back to the group's order and lost their intent routing. Each cut call was then logged 499 "the agent canceled the request", which usage counts as no failure, though no agent had canceled anything: askChat's own context.WithTimeout had no cause, the mislabel #2318 fixed for an image's description but never for the classifier. Fix: - settings.ClassifyTimeoutDefault 8 -> 15 (an existing Settings segment). A user who saved 8 keeps 8; only the unset value moves. The GUI's fallback segment follows (app.js), and the docs (en/zh/ja intent and start, gateway-routing.md) say 15. - askChat's wait is context.WithTimeoutCause(..., sideTimedOut{"decision model", wait}): the usage row says "magpie stopped waiting: its decision model had no answer in Ns", a failure. - Siblings checked: the advisor and Codex titles use the client's context, compaction and vision already carry sideTimedOut; askJev (decision providers) logs no 499 row of its own. - Tests that assumed the 8-second unset wait now use 15 (classify, decide, decide_group, nested_classify_wait, settings). - app.js grows by the one byte of the fallback's second digit: both core budgets +1 with the reason (TestCoreScriptBudget was red at exactly 1 over without it). A shorter `|| 15` would show a hand-edited negative value as its own segment, so it wasn't taken. - site: llms-full.txt and the search indexes regenerated for the docs pages (node llms-full.mjs, node search-index.mjs). Test: TestReasoningClassifierAnswersInTheWaitUnset - a classifier answering in 10 units routes the turn with the timeout unset, and one slower than 60 units gives no answer with one 499 usage row that says magpie stopped waiting for its decision model and counts as a failure. Broken by hand (mica-run): with askChat back on a plain WithTimeout the test is red ("the classifier's cut call: 499 "the agent canceled the request""); with the default back at 8 it is red ("gave no answer in 400ms"). Run at 0479372b8, this commit's tree (mica, through ~/suite.lock; mote was over its cores): - gofmt -l: clean. go vet (darwin), GOOS=linux go vet -tags nogui, GOOS=windows go vet: rc 0 (darwin vet rc 0 at the first try on mote). - go test -tags nogui -count=1 -timeout 45m ./...: rc 0, 103 ok. (The first run, on mote before the budget raise and the rebase onto |
||
|
|
adfa196db0 |
lessons: a docs page change regenerates the site's indexes (seen a fifth time)
|
||
|
|
255ccdd7ca |
omp: a Protocol row picks the API magpie's models are asked on (imty42 on X)
omp's models.yml had magpie's provider on openai-completions with no way
to change it: ompKept treated the provider's api as magpie's, so an api
typed there was written back on the next sync, and omp's row had no
protocol as Pi's has. An auto/* group whose members don't all take
Responses (provider.GroupAPI) could only be asked on Chat.
- omp's row gets the Protocol row Pi has (protocolField, now shared with
Pi's piProtocolField): each model's own (unpicked, as before),
openai-completions, openai-responses or anthropic-messages. omp takes
each for the provider and a model (KnownApi in pi-catalog types.ts and
the api enum of models-config-schema-bundle.ts, omp 18.9.1). The pick
is kept per place and agent folder, so each profile has its own.
`magpie omp protocol openai-responses` sets it from the CLI.
- ompOn puts the provider and every chat model on the pick: Chat and
Responses with no api of their own and thinking mode effort; Messages
at the gateway's root with budget, or anthropic-adaptive for a Claude
that thinks only adaptively. Image models stay on openai-images.
- The provider's api typed into models.yml by hand now stays and shows
as picked (ompAPIKept, the same api:<path>:wanted record as Pi's); a
pick made after it replaces it.
Unchanged: unpicked, Responses-native models and groups whose members
all take Responses already went on openai-responses per model.
Run at this head (3d0cadfce, the same tree; only this message differs),
on mote:
- gofmt -l internal/agent: nothing. go vet ./..., GOOS=linux go vet
-tags nogui ./..., GOOS=windows go vet ./...: rc 0. go build, linux
nogui and windows builds: rc 0.
- go test -tags nogui -count=1 -timeout 45m ./... in a sandbox HOME
under suite.lock: rc 0, 103 packages ok, no FAIL.
- Broken by hand: without ompAPIKept, TestOmpProtocolPicked is red
("an api typed by hand: file openai-completions, field \"\"").
- Real omp 18.9.1 in a sandbox HOME against a stand-in server: with the
provider on openai-responses a group model posted to /v1/responses;
a model on anthropic-messages at the root posted to /v1/messages.
Not tried: the GUI suite (no GUI file changed; the Protocol row is the
generic one Pi's uses, shown for any agent with a protocol field), and
omp against the real gateway with a real auto group.
Not changed: a model's api typed by hand in omp's models.yml is still
magpie's (the model list is magpie's whole); site docs for omp.
|
||
|
|
90d7ea9331 |
agent: a new agent named nowhere in the Library fails internal/agent's tests
TestEveryAgentInLibrary (internal/library) went red on main for a new agent four times: |
||
|
|
2f25728ddf |
claude: Use switches Claude Code itself to a setup-token account (liukaybee on X)
liukaybee adds Claude accounts with `claude setup-token` and wants magpie
to switch only which one Claude Code itself uses, without connecting it
to magpie. Such an account has no sign-in to put in Claude Code's
keychain or .credentials.json, so Use was refused ("magpie only").
Claude Code takes CLAUDE_CODE_OAUTH_TOKEN from the env of its user
settings.json ahead of its stored sign-in. Use on a setup-token account
now writes the token there (claude_token_env.go). Claude Code's stored
sign-in stays as it is and stays Active; the token account is listed
with Uses. A switch to a signed-in account, Use on the signed-in row,
or removing the token's account takes the token out again.
- A value the user set is theirs: magpie keeps only the sha256 of what
it wrote (claude-token-env.json), never writes over another value and
never removes one whose hash differs, even if it once wrote it.
- An unreadable settings.json is "unknown": nothing is written, the
record is kept, and the switch fails without moving the sign-in.
- NextLogin (Switch accounts only) leaves Claude Code on a token in use,
as its allowance can't be read.
- magpie's own runs pass --setting-sources "" and are unaffected.
- GUI: the token row's Use and In use; the signed-in row says Signed in
with a Use back. Every new string in zh, zh-TW, ja and de.
- app.js +864 bytes over its budget, raised with the reason in
core_budget_test.go: one swUse helper shared by both buttons, packed;
renderAccounts draws every account row, so no page to move it to.
Real use: real Claude Code 2.1.316 in a sandbox HOME/CLAUDE_CONFIG_DIR
(never the live ~/.claude) with a deliberately broken .credentials.json
access token. The settings.json magpie's switch writes (dumped from a
test) gave a PONG with a real account's token; the file after switching
back gave "401 OAuth access token is invalid", i.e. Claude Code was on
its stored sign-in again. Sandbox homes holding real tokens deleted.
Run (mote/mica, at f00e2059d rebased on
|
||
|
|
00b2c11a6b |
agent: Open Code Review (ocr) is an agent magpie sets up (@AlanWang1027713 on X)
Open Code Review (github.com/alibaba/open-code-review, npm @alibaba-group/open-code-review) is a Go CLI, `ocr`, that reviews a diff with a model. Its Claude Code, Codex, Cursor, Kimi Code and OpenCode plugins and its skills all run that command, which reads ~/.opencodereview/config.json on every run. Picking one of magpie's models on its row writes a custom provider "magpie" there (protocol openai, the gateway's /v1, a key naming Open Code Review, the model) and points provider at it. The user's own provider and model are stashed and come back on Disconnect, which also drops a custom_providers left empty. A model of the user's own can be picked too (written the way `ocr config model` writes it). Check reports a hand-edited url or key, or a removed entry. The `ocr` command counts only under a folder named for Open Code Review, since other programs share the name. WSL distros get the row too (cold distros not opened). Its User-Agent, open-code-review/<version>, already counts as this agent. CLI update via npm. Docs, READMEs, site and icon (OCR's own logo, Apache-2.0). Run (mica, at 593517bf0; origin/main has one unrelated usage commit since): - go test ./internal/agent -run 'TestOCR|WSL|Wsl|TestOwnProviderNamedAsMagpies|TestHandWiredMagpieProviderSiblings|TestAgentOf|TestEveryAgentNamedByItsKey|TestMarkedLinesEveryAgent': ok - gofmt -l: clean; GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...: ok - Broken by hand: url dropped from Check -> TestOCRWiring red; stash turned off -> red at the Disconnect restore. TestWSLColdPlaceOpensNothing went red before the row's options were given an asleep path. - Real e2e in a sandbox HOME: npm-installed ocr v1.13.10 (7e5ce06c) darwin/arm64, magpie built from this tree, a fake OpenAI upstream that calls tools. `magpie agents` lists the row with the user's deepseek/deepseek-chat; `magpie open-code-review magpie/fake/m1` wrote the entry and kept the user's keys and settings; `ocr llm test`: connection ok, tool-call round trip verified; `ocr review` on a repo with a nil dereference: 2 findings "[bug · high]" through magpie (8 /v1/chat/completions calls, UA open-code-review/v1.13.10, model m1, its six review tools); `magpie usage` counts them under Open Code Review; `magpie open-code-review default` put deepseek/deepseek-chat back and removed custom_providers. - Full suite: not run before this push (ship at once; mote was running another session's suite). It runs on mica right after, at this head. Not tried: a real vendor model behind magpie; WSL and Windows/Linux machines for real; the Claude Code / OpenCode plugin path itself (it runs the same `ocr`); an ocr installed by the curl script outside a folder named for it is found by ~/.opencodereview only. |
||
|
|
2071195ff4 |
usage: a plugin window named by one of its models counts that model (Google AI Studio)
WangYeruo on X: with the Google AI Studio plugin (@dorokuma/magpie-gemini-web's
ai-studio), one model's 429 for its quota held the account from every model
until the reset, while AI Studio limits each model's day on its own and argon
still answered after hydrogen was out.
The 429 itself already rested only the model: AIStudio2API's AllCoolingError
("模型 gemini-4-hydrogen 的可用账户均在冷却…;每日限额: … model:
gemini-4-hydrogen …") names it (TestAIStudioModelDayRestsTheModel, a guard;
it passes on the old code too). What held the account was the usage read
after it: the plugin's accountUsage (lib/studio.mjs, 0.15.3) tells a cooldown
as a window named after the model's id, used 100 until it ends, with no
model or models said. magpie read it as the whole account's window, so
Allowance.Full held every model and Pooled said the account was out.
namedModelWindows (pluginLoginQuota) now scopes a plugin window that says no
models, no family and no pool, and isn't text or aside, to the model whose id
its name is, when the provider serves that id. "所有模型" (a cooldown with no
model_id) and any other name stay the whole account's, as before.
Old data: such a reading has a matches, so keepLast doesn't write it down,
as with models/notModels. A reading kept on disk before this, still within
its cooldown, can hold the account from every model after a restart until
the first read (seconds); one past its reset holds nothing.
The plugin can't be fixed upstream: its repo has issues off, and it needs no
change now.
Run (mica-run, at this commit on origin/main
|
||
|
|
ce16633367 |
tune: a Codex card locked by config.toml's own compact limit hands it to magpie on a click (sufeng1894 on X)
sufeng1894 asked why Codex's compaction threshold can no longer be set by hand. The card said config.toml's model_auto_compact_token_limit wins, and the background row said features.async_compaction's model_async_compact_threshold_percent wins: both locked, and nothing on the card did anything about it. Cause. Only the old tune card ( |
||
|
|
2ba62f7f76 |
gateway: agy's "Individual quota reached … Resets in" rests the account until then
@Airan_FS on X (11-17): an Antigravity account served through agy-cli answered "⚠ Individual quota reached. Please upgrade your subscription to increase your limits. Resets in …" as the model's reply, and routing never asked the next account. The agy-cli plugin 0.1.87 (magpie-community/plugins afe4c086, on the dist branch) now ends such a turn with a rate_limit_error in agy's words, before or after reply text, so the gateway fails over and rests the account as for any plugin quota error. Here, quotaResetAfter also reads the notice's "Resets in 1h18m40s" (Go's duration form, which resetsInWords can't read since no word ends after its "h"), scoped to the "individual quota reached" line, so the account rests until Google's reset instead of quotaRest's 15 minutes and isn't asked again every quarter hour. gateway-routing.md says so. Tests from the literal notice (discuss.ai.google.dev report, the tweet): TestAgyCLIQuotaNoticeRestsUntilItsResetAndFallsOver (group falls over to the next member, rest "resets" ~1h18m40s, next turn skips it), TestAgyCLIQuotaNoticeMidReplyStillRests (partial text kept, still rests), TestAgyQuotaNoticeResetIsRead. Run (mica, at f33278541 = this change less the doc line): go test ./... -timeout 45m: 102 ok, no FAIL. mote: GOOS=windows go vet ./... ok, GOOS=linux go vet -tags nogui ./... ok; gofmt -l clean. Broken by hand: the old quotaResetAfter with these tests: the account rests 14m59s by "quota" and resetsAfter reads 0, so all three fail. Not tried: a real agy account with its quota used up. |
||
|
|
ead91a9a50 |
gui: a browser tab's title names this magpie: MAGPIE_NAME or Settings › Network and sharing › Advanced › Name (starballl on X)
starballl on X (tweet 2122376116220633444) runs several magpie web pages
and every tab is titled "magpie", so they can't be told apart. A magpie
now has a name, and a browser tab's title is "<name> · magpie" (plain
"magpie" with none).
- settings.Name, set in Settings › Network and sharing › Advanced › Name
(instancename.js, imported when Settings is drawn, so nothing is added
to app.js's core). Advanced is closed until a name is set.
- MAGPIE_NAME (Docker, magpie web) names it while the field is empty and
is the field's placeholder. It is read, never written, so a name typed
in Settings always wins and clearing the field goes back to it.
- One line, at most 60 characters (settings.CleanName).
- This computer's own (KeepOwn): sync and a restored backup never bring
another magpie's name. A Settings save that leaves `name` out keeps it
(settingsapi.Merge).
- boot.js titles a browser tab itself for the first paint, so app.js's
core gains only the line in applyPrefs, which sets the title again from
every settings read (TestCoreScriptBudget was 74 bytes over with a
title function in app.js). Only a browser page (web) is retitled: the
app's windows and tray keep "magpie".
- Docker docs (en, zh, ja) list MAGPIE_NAME; docs/reference.md and
docs/subsystems/gui-shell.md say how it works.
Tests:
- TestInstanceName (internal/gui): the variable alone names it at boot;
a saved name wins over it, trimmed; a save without `name` keeps it;
KeepOwn keeps it; cleared goes back to the variable; no name, none at
boot. Broken by hand, each red: KeepOwn without Name ("KeepOwn took
\"other\""), Merge without the keep ("a save without the name changed
it to \"\""), boot.js with s.Name in place of InstanceName ("named by
the variable alone: boot <nil>"), boot.js not setting the title ("a
browser tab's boot.js sets no title"). The app window's boot.js sets
none.
- TestSettingsSaveKeepsWhatItDoesNotSend now sets Name: the page's other
saves leave it out, and it is kept.
- instance-name.test.cjs: title from the first paint, the field under a
closed Advanced, save and clear retitle the tab, Advanced open after a
reload, 360px, the app's window keeps "magpie"; en, zh, zh-TW, ja, de,
Chromium and WebKit, 16/16. 14 of 16 red with applyPrefs not setting
the title.
Run, at this commit on
|
||
|
|
dbbb2f26b1 |
groups: free: takes the models a catalog marks free (#5903)
A routing group's pattern may now start with free: (provider.FreePrefix): free:workbuddy/* is, of the models workbuddy/* matches, those whose catalog entry says free (Entry.Free, the vendor's or plugin's own flag as the catalog was last read). The rest after free: is a glob, a re: pattern or an id, matched as on its own, so free:re:workbuddy/hy.* works too. It is expanded where every pattern is (matchesIn, PatternHits) each time the groups are read, from the catalog magpie already keeps: no request to a vendor, and a model the next list marks free joins without a save. Only the flag decides. A $0 price (PricedFree), a rate of 0, an account named Free or "free" in an id never counts; the test holds a deepseek-v4-free id with no flag, a rate-0 model and an or/y priced at $0 out. Existing patterns read as before: openrouter/*:free still means ids ending in :free (that is why the rule is a prefix, not a :free suffix), and a provider's AutoInclude takes no free: (isIDPattern). GUI: the Routing editor's pattern box counts and lists a free: rule live as it does any pattern (patternTest in plugins/routing/client.js, from groups.models' free), refuses "free:" alone, and one hint line says the flag is the last catalog's, not a promise of no charge, in en, zh, zh-TW, ja and de. CLI help, docs/subsystems/providers-accounts.md and the site's routing-groups page (en, zh, ja) say the same. routing-levels.test.cjs: the Advanced hint line made the editor taller, so the second group's Levels row opened under the editor's sticky foot and the click landed on the foot (webkit en). The test already wheels to that row for its first group; it now does for the second too. Run: - TestGroupFreeRule, TestFreeRuleSyntax and the existing pattern tests pass. Broken by hand: with groupmatch.go and autolist.go from origin/main both are red (no members for free:workbuddy/*, IsPattern); with takes() ignoring the flag, TestGroupFreeRule is red (all six WorkBuddy models matched). - group-free-rule.test.cjs (new): chromium and webkit, en and zh, green; red with origin/main's client.js. - go vet ./... (darwin, mica), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: clean. gofmt -l: nothing. - Full suite go test -tags nogui -timeout 45m ./... on Linux (WSL magpie-desktop) at 1e180c630 (this change on |
||
|
|
cb4ad12bd1 |
zcode: the mover's min is 0.1.68, whose every account takes requests (mathfournity on X)
mathfournity on X: several ZCode accounts in magpie, and requests went to two of them only. The plugin (0.1.40 to 0.1.67) declared maxAccounts 2, so keepAtOnce held every account past the first two in reserve until one rested. magpie's own handling of a plugin's accounts was right: on a throwaway gateway test with the real plugin under bun and four accounts on a fake Z.ai, 0.1.67 sent 12 requests at once 6/6 to two accounts and none to the others, and 1302, 1308, 3008 and 500 on one account each went to the next and rested the first. plugins 36dc4007 (zcode 0.1.68) declares no maxAccounts and holds what zcode.z.ai's firewall refuses an address for instead: six Start Plan requests in flight from this computer over all accounts, besides each account's three. On the same throwaway test, 0.1.68 sent the burst 3/3/3/3 over the four accounts, failover unchanged. Raising the min updates moved users (keepMovedCurrent). gateway-routing.md's Accounts at once row says the plugin no longer declares two. npm: registry.npmjs.org has 0.1.68 as latest (npm view --prefer-online --registry https://registry.npmjs.org). The plugins publish run is red only for middleware-system-prompt and middleware-think-tags (trusted publisher); its log shows "+ @magpie-community/opencode-zcode-auth@0.1.68". Run: - go test ./... -count=1 -timeout 45m on mica at |
||
|
|
1c59acd36d |
plugin: a fetch whose head never comes is given up on; Devin min 0.1.45 (wu_chong4136 on X)
wu_chong4136 on X: with the Devin plugin a session sometimes hung for
10 to 20 minutes with no reply, until the effort or the context was
changed. The Devin plugin returns its fetch's head only once Devin sends
the reply's first content, and the host's headRead waited for that head
with no bound, while the gateway kept the agent alive on keepalives. A
request Devin took and never answered therefore hung silently. The body
already had bodyIdleWait (30m between bytes, #4934); the head had none.
- host.go headRead: the same bodyIdleWait bounds the wait for the head.
On it the fetch ends with "the plugin sent no reply in 30m0s; that
fetch was given up on", Fetch settles the call, and the host writes
"abort", so the plugin's fetch signal ends its vendor request too. The
gateway answers the agent its retryable 502 (an SSE error event on a
stream). This holds for every plugin fetch, not only Devin's.
- ReplyWaitForTest lets the gateway test shorten the wait.
- Devin mover min 0.1.45 (on npm, `npm view --prefer-online`): the
plugin itself gives up after 5 minutes of quiet from Devin (no head,
or no frame between reads) with a retryable 504. A real probe saw
Devin's first frame at 2.5s and at most 13s between frames.
(magpie-community/plugins e30f8ed0)
- provider-plugins.md says so.
Tests:
- TestHostHeadWaitEndsAFetchNeverAnswered: a head that never comes ends
in "sent no reply", the host is sent "abort", and the call is
released; TestHostHeadWaitSparesAHeadInTime: a head in time is kept.
- TestPluginHeadNeverSentEndsInAnError (gateway, through the fake
plugin in Bun): a vendor that reads the request and never answers
gives the agent the error on a stream and on a whole reply, and every
vendor request the plugin made is closed afterwards (asked 30, open 0).
Run:
- mote: the three tests above, ok.
- Broken by hand (headRead without the timer case): the host test fails
("held its reader for ever") and the gateway test hangs to its 60s
timeout in io.ReadAll.
- mica: gofmt -l clean; go vet for darwin, GOOS=linux and GOOS=windows
on internal/plugin, internal/gateway, internal/provider: ok.
- mica: go test -tags nogui -timeout 45m ./... at this tree (rebased on
|
||
|
|
a24a5f6af4 |
gui: a model test its vendor queued shows queued, not green (sufeng1894 on X)
sufeng1894 (v0.1.4248) added Qoder China and QwenWork providers (both served by the Qoder plugin): their models were green in the provider's Test, and every request through Routing failed with 503. A Qoder/QwenWork plan queues a model (code 10605, e.g. "this plan's queue: p4"). The test sends x-magpie-fallback, the plugin answers the queue's 503 at once, and probe counts it OK with Result.Queued ( |
||
|
|
07f7e0b45d |
claudetui: Windows 10 gets Microsoft's ConPTY with the release, no folder to place (#5205)
|
||
|
|
efb62fe901 |
claudetui: a message Claude Code didn't get whole is asked again as claude -p (#5205)
The helper took a message as sent once a row of it reached the transcript (rows > before), whatever the row held. A console that loses part of a paste, as Windows 10's own ConPTY does (#5205), gave Claude Code the rest, and the model answered that as the message. Now the words the transcript records of it (a user row's text, or a queued message's) are compared with those pasted, white space, paste tags, image marks and format characters aside, read in place with no copy (whole.go). The paths of images Claude Code says it took ([Image: source: <path>] meta rows) are left out and the images counted. What Claude Code answers meanwhile is held for up to 2s. A message that isn't whole ends the turn as Unpastable before any of its reply, so the bridge asks it again as claude -p, as it does an image the interactive mode didn't take. This is 3leg0ocat's patch (github.com/3leg0ocat/magpie-lite, branch claudetui-whole-message, b800c0cb3b), applied as written, with TestShimCutMessageIsUnpastable added: the fake Claude Code gets a FAKE_CUT knob that keeps only a long paste's tail past its 1024-byte blocks, as Windows 10's conhost lost them. Run: - go test ./internal/claudetui ./internal/conptypair on mote (macOS): ok. TestShimCutMessageIsUnpastable broken by hand (send returning nil in place of checkWhole): red, the cut tail answered as "echo: ...". - go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... on mote: ok (with the next commit). - win-run go test ./internal/claudetui on xiaomi-gpu (Windows 11 26200, whose own ConPTY keeps the marks): every test ok but TestShimFirstMessageWaitsForTools, red on Windows at main (#4810). 3leg0ocat's own record: Windows 10 19044, Claude Code 2.1.319, Windows' own ConPTY at 64 KB caught 4 of 4 before any reply; with ConPTY 1.25.260930003, none caught across 8/64 KB, a leading /, two images, a queued message and two turns. Not tried by me: Windows 10 itself (no Windows 10 box here). |
||
|
|
5ba53b2392 |
agent: dsh and Pi ask a Gemini 3+ on Messages adaptively, so Xhigh reaches it as xhigh (#6778)
larryhaonlp: DSH's Xhigh on agy-cli/gemini-4-hydrogen through
magpie-anthropic reached agy-cli as high, and a compat
forceAdaptiveThinking: true added by hand in dsh went on restart.
Cause, from the installed sources (dsh 0.2.1-rc.2's and Pi 1.4.0's
pi-ai, anthropic-messages.js and simple-options.js): without
compat.forceAdaptiveThinking pi-ai asks a budget through
adjustMaxTokensForThinking, whose clampReasoning turns xhigh and max into
high (16384), and agy-cli's requestedEffort reads a budget of 16384 as
high. With the switch it sends thinking adaptive plus output_config.effort
from thinkingLevelMap, which agy-cli reads first. magpie wrote the switch
only for Claude that thinks only adaptively and GLM-5.2/5.3.
- gateway.AsksAdaptively is the one rule: adaptiveOnly, AdaptiveWithEffort
or a Gemini 3 or later (geminiGeneration, the rule geminiLevelBody
already turns a budget into adaptive + effort by). dsh's dshKindConfig
and Pi's piModelOn (both cases) use it. Pi now also gets the switch for
GLM-5.2/5.3, which it lacked (same clamp).
- omp is left on AdaptiveThinking, said in omp.go: its budget isn't
clamped (ANTHROPIC_THINKING xhigh and max are 32768, read as xhigh), and
its anthropic-adaptive mode turns thinking off by leaving thinking out at
the lowest effort, which a model that can stop thinking takes as on.
- The user's own values: dshKeepCompat kept a hand-set switch magpie
doesn't write, but magpie's own switch won over the user's. magpie
writes its switches only as true (omitempty), so a false in the file is
the user's, and now stays.
- The restart: dsh-settings' importLegacyDocument imports
~/.dsh/settings.yaml into the profile dsh starts on and renames it
.imported; magpie writes settings.yaml again with routes that had no
hand-set compat, so each start of dsh took it out of the profile.
dshProfilesCompat carries the profiles' hand-set compat into
settings.yaml's routes, by the same dshKeepCompat.
Existing users: KeepDshWired's sync (30s) and Pi's sync rewrite magpie's
routes, so forceAdaptiveThinking: true lands on a Gemini 3+ there with no
action; a false the user set stays. Pi's models.json provider block is
magpie's own and is written whole, as before.
Run (mote; sandbox HOME):
- go test -tags nogui ./internal/agent -run the new tests and the dsh,
Pi and omp compat tests (TestDshMaxReachesOutputEffortModels,
TestDshRefreshKeepsHandSetCompat, TestDshKeepCompatNotAcrossProtocols,
Pi.*API, Omp): ok
- gofmt -l: clean
- Shipped before the whole ./internal/agent and ./internal/gateway run and
vet (darwin, linux, windows) finished: it was still going on mote, over
its cores, and mica's disk was full. A red there gets its own fix or
issue.
Broken by hand:
- the new tests at origin/main
|
||
|
|
9b376de163 |
gateway: a Gemini model's levels above high come from its provider too (#6871, hhh2210)
withGeminiEffort (decide.go) and geminiLevelFor (gemini_level_body.go)
let a level above high through only where models.dev's catalog lists
it (catalog.EffortsOf). A model a plugin or relay lists that models.dev
doesn't have, such as ai-studio's gemini-4-hydrogen-search with
low/medium/high/xhigh, had agy's xhigh or max sent as high, after the
candidate step had already fitted it to xhigh from p.Efforts.
withGeminiEffortFor and geminiLevelForEfforts now take the provider's
levels (p.Efforts(model)) first and fall back to the catalog's; the four
withModelEffort sites in serve and passthrough's onEffort retry, and
geminiLevelBody, pass them. A model whose levels stop at high is still
asked high. Left as they were: aiStudioThinking and withFixedEffort
(no provider in scope there). Ported from hhh2210's
hhh2210/magpie#3 (8dd4c5f6e), the doc line reapplied by hand on
today's gateway-routing.md.
Broken by hand: with the tests alone on origin/main, both new tests
are red (gemini-4-hydrogen-search sent "high" for xhigh and max on
Gemini and Chat upstreams, output_config {"effort":"high"} on an
Anthropic relay); the high-only gemini-4-carbon-search case stays high
either way.
Run on mote at b394095c7 (origin/main
|
||
|
|
34606000da |
gui: the tray panel's Usage tab ends in a heatmap of recent weeks (eiyuuzaki2333 on X)
Asked for "a heatmap like GitHub's / Codex's, also in the tray". The window already has one (Usage › Requests, 53 weeks, #1369), so no second copy goes on the Overview, which counts gateway calls only while the heatmap counts session-file calls too. The tray panel had none. The panel's Usage tab now ends in a card of the recent weeks, one cell a day, Monday on top, as many weeks as the card fits (8 to 53: about 25 at the panel's 440, 17 at 320). It goes after the chart and ranking, so nothing above it moves. Its shades are the existing monochrome accent ramp (.l0 to .l4) and follow the tab's own Tokens / Cost / Requests switch, with no new read; a provider or computer picked above narrows it. A tooltip says the day and its tokens, requests and cost. Weeks with no call show no card. No animation. It reads the existing cached /api/usage/heatmap, at most once a minute and again when a pick changes; the tab's own 10 s reads don't wait for it, and no endpoint was added. The card, its reads and tooltip live in plugins/usage/page.js, which shares its grid (heatGridOf, taken out of drawLedHeat as it was) and tooltip (ledHeatTip, now told the metric and provider) with the Requests tab. app.js keeps one guarded call in renderPanelUse: the ledger read can come back before page.js has run, so page.js draws the tab again when it loads. Both script budgets hold it at this base with no raise. The card is .pu-heat, not .pu-card, so the chart's card stays the tab's one .pu-card. The panel's light pills are its card's white, so a quiet day there is a 7% shade of the text over the card. Run (rebased on origin/main |
||
|
|
2896e82ccb |
claude: a turn with a new image after a reply split by thinking goes on in its run
Yqihotaru on X (omp 18.20.3, magpie 0.1.4314, DEBUG on): a user turn with an image, after a reply with no tool calls, logged "no run here has had this conversation" and was told to a new Claude Code from a transcript (81 messages, 4 images; the turn before had 5), all of it written to the prompt cache again. The same turn after a reply with tool calls, and a text-only turn after it, went on in the run. omp keeps 5 images in a request to a provider it has no image budget for (clampProviderContextImages, providerImageBudget's default), so each new image takes the oldest out: the conversation's earlier images moved, and only looseTurn.rewrote's mediaMoved could match it. mediaMoved compared the conversation part by part (heardRuns), and the run keeps its reply as the one text it said while the client sends it back as the text blocks Anthropic's stream told it, one between each thinking block (#5705). #5705 made the turn keys read a reply's words without whitespace; the part-by-part compare still read two blocks against one text, so the first such turn found no run. heardRuns now reads an assistant run's texts in a row as one part, their words with no whitespace, as messageWords does. A user's texts stay apart: the text an image left between them is what lostFromRun reads. TestClaudeOmpImageBudgetGoesOnInItsRun sends omp's clamped history (the budget of 5, "[image omitted: provider image limit]" in a message left empty) eight turns, with the reply in one block and split by thinking, and an image with words, alone, before words, and two at once. The subsystem page says what heardRuns reads. Run (on mote, through mote-run, at |
||
|
|
ccae8e8211 |
claude-desktop: a 1M model runs at 1M in the Code tab again (fwxkogaia on X)
Claude Desktop 5.11492 (released 11-13) starts its Code tab's Claude Code
with CLAUDE_CODE_MAX_CONTEXT_TOKENS=200000 in its --settings file whenever
the provider routes models itself, the gateway included (Fcn=2e5 and Lcn in
index.chunk-xV3fJhc7.js; 4.16336 had no such value). Flag settings come
before ~/.claude/settings.json, so the window magpie writes there no longer
reached the Code tab, and every model picked by its plain entry ran at 200K,
a 1M one too. No magpie change caused it: nothing in v0.1.4300..v0.1.4322
touched what Desktop is told about 1M.
Claude Code takes a "[1m]" id for 1M whatever that variable says (pT in
2.1.322). magpie's profile now gets Desktop's own "Use 1M wherever it's
available" (modelPrefer1mContext: true, 3p only, Desktop 1.28929+) once, on
a switch on and from Sync, as toolSearchEnabled is (desktopSeedPrefer1M):
Desktop then shows a model it offers a 1M entry for by that entry alone
(D5n: prefer1m on every supports1m entry) and hands Claude Code its [1m] id.
Desktop offers that entry only for a row whose max_input_tokens is 1M or
more, so nothing smaller changes. The user's own value, false too, or their
taking it away, stays theirs. Compaction is as before: the working window,
or the whole window under Full window.
Not fixable this way: a model between 200K and 1M (a 272K or 400K GPT)
still runs at Desktop's 200K; only a managed policy setting comes before
flag settings, and magpie writes none.
Run (mote, at this tree):
- go test ./internal/agent -run TestClaudeDesktop: ok
- TestClaudeDesktopPrefers1M red with desktopSeedPrefer1M returning nil
("switch on: modelPrefer1mContext <nil>"), green with it
- go vet ./internal/agent for darwin, linux, windows: ok; gofmt -l: clean
- go test -timeout 45m ./... at base
|
||
|
|
98955300a7 |
claude: no request-sized value on a run's command line or in its environment (#6848)
recih (on X) ran a long Claude Code session through the Claude subscription's interactive mode on a Linux server: every start, the resume and the replay alike, failed "fork/exec <magpie>: argument list too long", 8 502s, and every request after. Linux starts nothing with one argument or variable over 128KiB (MAX_ARG_STRLEN), and startRun put the conversation's safeguards in CLAUDE_CODE_EXTRA_BODY whole and the JSON schema in --json-schema whole. Now no value of a request's goes on the command line or in the environment over claudetui.StartValueMax (16KiB, under Windows' 32K variable too): - interactive mode: CLAUDE_CODE_EXTRA_BODY is a stand-in (startSafeguards: all when they fit, else without the parts Claude Code itself sheds, else []); guard.json keeps them whole and tap.js puts them in each request, as before. tap.js no longer sets the variable to a file over the bound, since Claude Code's MCP servers and tools inherit it. It is given no --json-schema (it never used it; the answer tool has the schema). - -p: a schema over the bound goes with the initialize request (jsonSchema, as the Agent SDK sends it). Claude Code passes over an initialize schema it can't use silently, so such a schema is compiled first and refused with a 400, as the flag's exit was (#3036). Other per-request starts checked (warmups, usage, sign-ins, other agents' bridges): nothing request-sized on argv or env. Run: - TestClaudeTUIStartBounded, TestClaudePrintStartBounded, TestClaudePrintSchemaPlaces (gateway) and TestTapPutsSafeguardsTooLargeForTheEnvironment (claudetui, bun and node): red on the old code on mote (152KB env, 277KB arg, 502 for a bad large schema, 204KB variable left by tap.js), and on Linux (wsl-run, magpie-desktop) the old code failed with the real "fork/exec .../magpie: argument list too long" and the tap's child start with E2BIG. All green on the new code on mote and Linux. - Real claude 2.1.316: an initialize jsonSchema answered structured_output {"city":"Paris"} (haiku); CLAUDE_CODE_EXTRA_BODY {"safeguards":[]} is sent as "safeguards":[] in every request (local listener, sandbox config). - gofmt; go vet (darwin, GOOS=linux, GOOS=windows) on the two packages; go test -tags nogui ./internal/claudetui ./internal/gateway on mote: ok claudetui 182.5s, ok gateway 1066.8s (at base |
||
|
|
8707ea7757 |
gateway: Codex's prompt suggestions go on a model set for them (@0xcb198609 on X)
The Codex app's home-page prompt suggestions (thread_source ambient_suggestions, and their safety check, ambient_suggestion_safety; the Routing page's 提示词建议) are a background agentic turn that reads the project and connected apps. The app asks for the model its server config names (codex-app-model-routing's codex_ambient_suggestions_model_slug, gpt-6-luna) with provider model fallback on, so with magpie as Codex's provider they ran on the provider's default model, often auto: @0xcb198609 saw 76.9k tokens in 113s on deepseek-v4-pro. Codex has no config.toml key for that model, only an on/off switch in the app (store key ambient-suggestions-enabled, Settings › Configuration › Homepage suggestions; read from the 26.1106 bundle). magpie now has a setting for it, "Codex prompt suggestions" in Codex's row on the Agents page (Settings, beside Codex composer predictions): - Empty, the default, is Codex's own pick: nothing moves. A value the user set is never overridden. - A model or group of magpie's puts both calls there: in serve as the codex-suggestions move (the Routing page says why), and on the ChatGPT backend's route before the split, carrying the asked model to serve so the trace and ledger keep it. codexOwnOffMagpie leaves a bare gpt-6-luna to magpie while the setting is on (codexSideSet). - A target that is disabled, unserved or not allowed to the gateway key leaves the call as asked, with a log line (compactRefused). - To fit app.js's script budget without raising it, the suggestions and auto-review pickers share codexPick with codexSidePick, and every Codex row's button comes from condButton. The new route is named for the CLI (settings_parity_test.go). agent-prefs and settings-general list the new row. - The row's tooltip and the Routing page's Suggestions story say where Codex turns them off. magpie's old story said "Suggested prompts", which the current app no longer shows; corrected in all five languages from the app's own locale files. Run (mote, at this head rebased on |
||
|
|
e25210b6e4 |
providers: an Alibaba Token Plan's AccessKey says the grants it needs, in the reader's language (MetalHqa on X)
MetalHqa on X: "阿里云百炼 Token Plan 的额度查询需要的权限不明确,希望能够在里面备注出来". Since |
||
|
|
1bfc6378c9 |
providers: Antigravity CLI's own Gemini API key is found and imported (shenggxhz on X)
shenggxhz set agy up on an AI Studio key: "modelProvider": "gemini" in ~/.gemini/antigravity-cli/settings.json, GEMINI_API_KEY exported in the shell. `agy models` then listed Gemini 4 Carbon and Hydrogen. magpie's model refresh didn't, because the agy-cli subscription runs agy on its Google sign-in, whose models are the account's in Antigravity, and the key was used nowhere in magpie. The Providers page now finds that key on its own. A new import source, "Antigravity CLI" (readAgySettings), reads agy's settings.json and offers the key as the Google Gemini preset, which lists the key's models from the Gemini API. With GOOGLE_GEMINI_BASE_URL set, it uses that endpoint's Gemini API instead. The variables are taken from magpie's environment, else from the login shell's: a key exported only in .zshrc is found when magpie is opened from the Dock. proc.GeminiKeyVars are only read (LoginEnv), never set in magpie's environment. agy on its sign-in offers nothing. With no key the entry shows as not importable, and a key that points at magpie itself is refused. Not changed: the agy-cli plugin's own `agy models` reads the same setting and, with no key in magpie's environment, fails and keeps the old list silently. Filed as magpie-community/plugins#1218. Run: - red on the old code: with the appReaders entry removed, all four TestAgyGeminiKey* tests fail (no "agy" source); green with it. - a real login shell on mica, in a sandbox HOME (key exported only in .zshrc, MAGPIE env without it): DiscoverSources gives status new, preset google, the key read. - real agy 1.5.9 in a sandbox HOME: API-key mode lists the Gemini 4 models from a list built into agy; without the key it exits 1 with the modelProvider error. - go vet (darwin, GOOS=linux, GOOS=windows) for proc and provider, plus darwin internal/gui; gofmt -l clean. - full `go test -timeout 45m ./...` on Linux (magpie-desktop): every package ok except internal/usage's TestRequestStateKeptAcrossACatalogFetchedAgain (#6572, filed, untouched here) and the root, internal/cli and internal/gui, which don't build there (no gtk4/webkitgtk-6.0 dev packages). Those three, plus provider and proc, ran on mote (darwin): ok. A first full run on mica died of a full disk (117G of shared Go build cache), so it tested nothing. - GUI on Linux, Chromium + WebKit: icon-tile, import-collision, import-opencode, provider-discovery, import-row and i18n-keys pass, 92 of 93. The one red is icon-tile's dim-color (#6759, red on main). - appIcon became a table so the agy icon fits app.js's code budget without raising it (TestCoreScriptBudget ok). Not tried: a real AI Studio key or a real Gemini request; the GUI import sheet in a browser (the source shows through the existing discovery and import sheets, with Antigravity's icon); Windows (LoginEnv is "" there, so only magpie's own environment is read). |
||
|
|
b5688404da |
gateway: a body to another magpie goes as a delta against the one before (RFC 9842 dcz)
gaubeebangeel on X asked for RFC 9842 (Compression Dictionary Transport) on the magpie-to-magpie hop: a Remote magpie provider, a LAN share, a cloud or Docker deploy. Every agent request is its whole conversation, and that hop carried it uncompressed each turn on Chat and Anthropic (Responses already went as a semantic delta, remote_delta.go). Ideas from jixoai/reply9842 (MIT, by jixoai): dcz turned round for a request, content-defined anchors to pick the base. No code taken. How it goes (remote_dict.go; docs/subsystems/gateway-routing.md): - A request of 16 KB or more to a remote magpie offers its body (X-Magpie-Keep-Body: dcz). A magpie of this version keeps it, only from a magpie's request, scoped to the caller's key id and connection address, and answers X-Magpie-Kept-Body with the SHA-256. A magpie from before never answers, so it is sent every body as before. - Next request to that route: Content-Encoding dcz (the RFC's magic, dictionary hash, zstd frame with checksum) against the kept body that shares the most content anchors, Available-Dictionary naming it and X-Magpie-Body-Digest the body's own SHA-256. No base sharing: zstd. - Dictionary not held in that scope (restart, evicted, another key or computer), a corrupt frame, a digest that differs: 400 with X-Magpie-Dictionary-Miss before the key limit or any route, and this side sends it again whole at once; the agent sees nothing. A 415 does the same and the route goes uncompressed until it says it keeps bodies again. - Bounds: up to 48 MB a body, 30 min, server 8 per scope / 96 MB per scope / 256 MB in all (LRU), client 8 per route / 128 MB in all. Memory only. The headers are stripped on arrival and from the relayed reply. Measured (TestDictSavingOnALongConversation): two interleaved agent conversations, 80 requests of real repo Go files as tool results plus a 300 KB screenshot, a moving cache_control, growing to 1.1 MB: as sent 44,606,511 bytes zstd 26,409,026 (59.2%) dcz 639,701 (1.43%); the last 1.1 MB request went as 1,368 bytes; dcz encoding 179 ms over the 80 requests. Tests: TestRemoteMagpieBodyGoesAgainstTheOneBefore (one gateway as both computers, Anthropic protocol: turn 0 whole and offered, every turn after dcz under a quarter of its size, the vendor gets the same messages and no X-Magpie or encoding header), TestRemoteMagpieLostDictionaryResendsWhole (restart: miss, resent whole, agent gets 200, next turn dcz again), TestRemoteMagpieFromBeforeIsSentBodiesAsTheyWere, TestKeptBodyIsOnlyItsCallers (another key, no key, another computer, a truncated or flipped frame, another or no digest: 400 miss and the handler never reached), TestKeptBodiesBounded. remote_delta_test's hopLog now logs bodies as the other magpie reads them, and the raw wire bytes apart. Run: - go test ./internal/gateway -timeout 45m on mote on this change over |
||
|
|
e97271f027 |
agents: a client of a Remote magpie can connect new agents the remote has connected (KoiLx0 on X)
KoiLx0 runs one magpie as a client of another, through a gateway key, and had to switch every agent on by hand on the client before it took the remote's models. A Remote magpie's editor now has "Connect new agents to this remote" (自动接入新 agent) under Advanced, off by default. It is kept per computer in the stash (remote.<id>.connectAgents), not in providers.json, so a synced or shared providers list doesn't turn it on anywhere else. No server-side key permission. With it on, the follow loop (FollowRemotePicks, every 5 minutes, and at once when the switch is turned on) connects an agent installed here that the remote has connected, on the remote's pick (connectFromRemote), and records it as <agent>.remote.auto = on. An agent the user disconnected here is never connected again: - one with the Agents page's Disconnect mark, connected or not before; - one recorded on that is no longer connected (taken out by hand in its file, or by any other route) is recorded off. An agent magpie put back on quit (quit.restored) is left to RewireOnStart and not taken for a disconnect. Connecting it by hand records on again. The follow throttle's time is now under a mutex, since the save handler resets it from another goroutine. The switch shows in /api/providers as connectAgents and is saved as connectAgents (a save that leaves it out keeps it; a provider that isn't a Remote magpie is refused it). Advanced opens on its own while it is on. docs/subsystems/providers-accounts.md says all of this. app.js stays within its budget (TestCoreScriptBudget): the Remote magpie's three ticks (MCP servers, skills and prompts, agents) and their save are one loop, which the new switch costs less than it saves. Run: - mote, go test -tags nogui -count=1 -timeout 45m ./... with the first draft of app.js: every package ok but internal/gui, where only TestCoreScriptBudget failed (1087333 > 1086971). After the loop, rebased on origin/main |
||
|
|
187d067241 |
gui: a page's row in Sidebar pages is dragged by a finger too (chet030714 on X)
v0.1.4296's page order "根本拖不动" on a phone. Reproduced in Chromium with real touch input (CDP Input.dispatchTouchEvent, 390px, hasTouch, isMobile): the press on the grip went pointerdown, pointermove, lostpointercapture, and the drag ended before it began. A finger (and a pen, where the browser does so) is captured by what it pressed, here the grip span inside the row; dragRows then takes the capture on the row, the grip loses it, and its lostpointercapture bubbled to the row's listener in dragListen, which cancelled the drag. A mouse has no implicit capture, which is why the mouse test and the desktop app were fine (mouse drags passed in Chromium and WebKit, 1100px and 390px). dragListen now cancels only on the handle's own lostpointercapture. The fix is in the shared listener, so every dragRows/dragCards whose handle holds a child (the accounts' rows, a model's rows, plugin pages) gets it. On a coarse pointer the grip is 40px wide instead of 26, a finger's target. Alt+Up/Down is unchanged. No new motion: the rows' existing 0.16s strong ease-out shift (none under reduced motion) is what a finger drag shows. The listener's lines were written shorter so app.js stays under its budget (4 bytes of room left), no raise. Run: - nav-pages-order.test.cjs: a finger drag (CDP touch) and a pen drag (CDP pointerType pen) on the phone's menu, Chromium; WebKit checks the grip shows. 10/10 (Chromium, WebKit x en/zh/zh-TW/ja/de) on mica. Red on origin/main 269e54de5's app.js: "a finger dragged Masking up", chromium en and zh (2/2). The pen step passes on the old code too (Chromium's CDP pen isn't implicitly captured), so it guards nothing old, only the path. - The drag GUI files (account-arrange, agent-grip, codex-model-order, drag-rows-shift, gateway-key-arrange, group-arrange, group-member-drag, group-member-row-drag, panel-arrange, plugin-page-arrange, provider-order, routing-rule-drag, usage-arrange, usage-drag, tap-lost-click, tap-inverted, tap-click, search-order, nav-pages-order) on mica: 196 pass / 12 fail. The 12 are account-arrange (53 !== 52, #6010) and gateway-key-arrange 420px (#6268); both fail the same 12 at origin/main 269e54de5's assets. - go test ./internal/gui/ on mote: ok (TestCoreScriptBudget included). Not tried: a real phone (iOS Safari, Android Chrome); WebKit touch, which Playwright can't send; a real pen; the Wails windows. |
||
|
|
91b3af8470 |
usage: Qoder's own calls are under Not through magpie, by the credits they cost (eating_dream on X)
Qoder's and Qoder CN's sessions were on the Sessions page and nowhere in
Usage: callSources never listed their files. They are Claude Code's
lines, and are now read for calls as Claude Code's are (ccCallAgent:
claudeCallLine, the call cache, continuations and revisions).
Qoder writes a reply on its own models ("auto" among them) with every
token count 0 unless QODER_EXPOSE_TOKEN_USAGE is set: the transcript
writer (vUl in qodercli, the same in Qoder.app's worker, qoder-agent-sdk)
zeroes them unless the model is a custom one, from qodercli 1.1.0 on. It
keeps the reply's credits. So such a call carries Credits (new on
sessions.Call, passed to the ledger's Record), counted with no tokens
and no price; "auto" names no model, so nothing is priced for it. A
model of the user's own, whose counts are written, is read and priced
as before. The GUI's direct section already shows credits (ledCredits).
Fixture: testdata/qoder-1.1.89 is lines as qodercli 1.1.89's writer
lays them out (key order, zeroed usage, credits/original_credits/
billable, a reply with no usage), read from its npm bundle; the ids are
made up. The older invented qoder fixtures got message ids of their own
(Calls counts a message id once across agents, and they shared
WorkBuddy's m1/m2).
Run (on mica, at f07e3e067's tree, rebased on
|
||
|
|
269e54de5f |
gui: an update restart nobody clicked comes back in the tray alone (eating_dream on X)
eating_dream on X (v0.1.4303, macOS, Restart automatically on, a check every half hour, prerelease channel): after each automatic update the main window came back over what they were doing. A restart by itself brought the window back when it was up (#2096), and minimised when it was (#3495). Now every restart nobody clicked comes back with the tray icon alone, on every system, the window closed even when it was up. That covers Settings' AutoRestart, `magpie update` from a terminal, a Remote magpie's ask, and another copy replacing this binary. The restart path is restartBySelf, which updates.autoRestart calls. It still takes no focus and the Mac's Dock icon joins without coming to the front (quiet_restart.go). A restart the user clicked (the pill, Settings, the tray) opens the window as it was. No new setting. restartInto loses its minimised parameter, and markQuietRestart writes the seconds alone. An older version restarting into this one still asks for its window and may write "<seconds> minimised", so the reading side (takeQuietRestart, quietMinimised, showMinimised) stays. host.mainUp had no caller left, so it moved into the Windows test that reads it. Tests: - New TestRestartBySelfComesBackToTheTray: by itself asks for no window, clicked asks for it. - TestRestartBySelfComesBackQuietly now checks restartBySelf's mark and reads an older version's minimised mark (markOldQuietRestart, which the Windows minimised and quiet tests use too). Run, at fd407bc99 + this change: - mote-run: - go test ./internal/gui -count=1 -timeout 45m: ok - go vet ./internal/gui, GOOS=windows go vet ./internal/gui, GOOS=linux go vet -tags nogui ./internal/gui: clean - gofmt -l: clean - Broken by hand: restartBySelf asking for the window (the old behaviour with it up) fails "windows asked for [true true], want [false true]". The old code read the window through a live Wails window, so the test can't run against it as it was. - win-run go test ./internal/gui -run 'Quiet|BySelf|Minimised|RestartBy': ok. TestRestartMinimisedComesBackMinimised and TestRestartBySelfAsksNoAttention skip over ssh (session 0). - wsl-run go test -tags nogui ./internal/gui -run 'Quiet|BySelf|Beside': ok Not tried: a real automatic restart of the app on any system, and the Windows desktop tests in the signed-in session. The first update into this version is still made by the old one, which brings the window back once. Docs: gui-shell.md, restart by itself. |
||
|
|
e0f9218f91 |
update: Restart to update goes into the newest version out, not an older download (char1es_lu on X)
char1es_lu on X: Restart to update put in a version downloaded a while ago, and right after the restart magpie offered an update again. Since |
||
|
|
0f81c0b358 |
gateway: a Codex thread's system prompt says its latest collaboration mode, not the one it was compacted in (#6835, #6100)
@bubuweiying2026 on X (#6835): Codex Desktop on the Claude subscription,
interactive mode. A Codex compaction while the thread was in Plan mode
started a new Claude Code run whose append.md held the Plan block ("Plan
Mode is not changed by user intent"), since the Responses read lifts the
developer messages before the first reply into the system prompt. Every
later switch back to Default came after a reply, so it went into its
turn as a <system-reminder>, pasted text to Claude Code, and the model
refused to execute on every turn. #6100 is the same on a Chat provider:
a thread started in Plan keeps Plan in its system message.
Now every <collaboration_mode> block lifted into the system prompt says
the conversation's latest mode (latestModeInSystem in responses.go).
Codex's own words are not changed, and the switch stays in its turn too.
Every path that builds a run's instructions reads req.System, so
append.md for a new or resumed run, -p's first message and the
compaction request itself all carry the current mode. A switch changes
the system prompt once (one new run, one cache write), not every turn.
Run, at 8aaae20fa rebased on
|
||
|
|
fb711ae0fd |
settings: Quick check's Web search tests every search API, one line each (heyiwei5 on X)
heyiwei5 on X: "快速检测 联网搜索 是不是只检测第一个api 多个api的话 是不是不能检测?"
The Web search check ran one search (webSearch), which stops at the first
searcher that answers, so a second search API was never asked and a broken
one read as ok.
CheckPipeline's search now goes through checkSearch: it asks each searcher
a search can go to once, at the same time, by the path a search takes to
it, with no other standing in: the provider that searches (searcher, via
searchBy) unless provider search is off, and each search API on
(provider.SearchAPIs, via askSearchAPIKeys), in the order a search asks
them. The answer gains `searches` (name, ok, ms, error); the check is ok
only when every one is. Nothing set up, or the plugin off, says so as
before. pipecheck.js draws one line per searcher under the Web search row,
"Exa · 1.5 s" or "Tavily · <its error>" in red. Test and Test all are the
only things that ask, one call per searcher. No new strings. Documented
in docs/subsystems/gateway-routing.md.
Run (mica):
- TestCheckSearchAsksEveryAPI red on the old pipeline_check.go ("a broken
API reads as ok: {"kind":"search","ok":true}"), green now.
- pipeline-check.test.cjs red on the old pipecheck.js (0/16), green now
with i18n-keys.test.cjs, chromium + webkit, en/zh/zh-TW/ja/de, 1100px
and 400px.
- At
|
||
|
|
3d25679154 |
accounts: a setup-token pasted into the Claude import is added as one, not taken for a refresh token
liukaybee on X asked whether the token `claude setup-token` prints can be pasted into Providers > Claude > Import accounts. It couldn't: the paste box read every bare line as a refresh token, and a Claude one with no email failed with "the file doesn't say which Claude account this is". parseLoginImport now reads each bare line (and a JSON string) through bareImport. A line that is a setup-token (sk-ant-oat..., bare, as CLAUDE_CODE_OAUTH_TOKEN=... or export CLAUDE_CODE_OAUTH_TOKEN="...") is checked by checkClaudeSetupToken and added by AddClaudeSetupToken, the same path as "Add an account by setup-token...": kept in logins.json, named by its hash, nothing asked of Anthropic. One magpie already has is "exists", twice in one paste is "in the files twice", an sk-ant-api key pasted there is refused as an API key. In the ChatGPT import a setup-token is refused as Claude's and never sent to ChatGPT's token endpoint. Refresh-token lines and JSON files in the same import work as before. No result row carries the token; nothing here logs. Run (mica, mica-run): - TestImportClaudeSetupToken red on origin/main's login_import.go (#2..#5 failed, setup-token lines "doesn't say which Claude account"), green with the fix. - go test ./internal/provider -run 'Import|SetupToken|Login': ok - go vet ./internal/provider: ok - go test -timeout 45m ./internal/provider ./internal/cli: ok, ok - gofmt -l internal/provider: clean Not tried: a real setup-token pasted in the real app (the add path it calls is the existing one, itself not tried with a real token). |
||
|
|
56c988cb5e |
gateway: /v1/realtime passes a Realtime API session on to its provider (Qwen Token Plan's realtime voice)
gaubeebangeel (X) set up Qwen's Token Plan in magpie and couldn't use its
realtime voice: magpie had no /v1/realtime, so the WebSocket upgrade got a
404. Token Plan does cover realtime: qwen-audio-3.0-realtime-plus at
wss://<plan host>/api-ws/v1/realtime?model=… with the plan's sk-sp- key,
OpenAI Realtime events
(platform.qianwenai.com/docs/token-plan/best-practices/realtime-voice).
GET /v1/realtime and /realtime upgrade to a WebSocket after the same Front
guards as every route (lanGuard, corsGuard, keys, the rebinding check),
plus a same-origin check on the socket's Origin. The model resolves as on
the other routes (a bare id unlisted anywhere goes to the one DashScope
provider that is on), with key, model and account holds, and each try is
dialled in turn with the account's key. A DashScope base ending
/compatible-mode/v1 dials /api-ws/v1/realtime; any other base dials
base+/realtime (OpenAI). Frames go both ways as they are; a close goes on
with its code and reason. Text frames are masked going up and restored
coming down (audio appends and deltas are not), failing closed. Each
response.done's usage is recorded as a "realtime" call (cached input as
cache read). openai-insecure-api-key / organization / project
subprotocols never go upstream. Shutdown ends open sessions with 1001.
/realtime is a client route on magpie web's port (and in the LazyCat
manifest), and a read-only key is refused it.
Run (mote, at this tree):
- TestRealtime* (fake upstream WebSocket, no network): Token Plan path,
echo, binary, close both ways, usage 60 in / 40 cache read / 20 out,
OpenAI-style path, subprotocol filter, masking; guards: 426, 400, 404,
Origin evil/null/localhost subdomain 403, rebound host, remote without
key 401, key held to another provider 403, vendor 401 passed on.
- Broken by hand, each went red: subprotocol filter removed, masking off,
cached tokens not subtracted.
- GOOS=linux and GOOS=windows go vet ./internal/gateway: clean.
- go test -count=1 -timeout 45m ./internal/gateway ./internal/masking
./internal/gui: the first run found TestClientPathCoversHandler,
TestReadOnlyKeyEveryRoute and then TestLazyCatManifestListsTheClientRoutes
red, all fixed here and rerun green. Otherwise ok. The log has one
recovered "close of closed channel" in continuation_test.go:781's
doneHold fake upstream (a test fake this change doesn't touch; in both
runs), already filed as #6505 (and its duplicate #6690).
- Rebased on origin/main
|
||
|
|
afd2df09b9 |
gateway: a Copilot Gemini conversation past the model's 10 images goes on with its oldest left out (yuushabu_buyinn on X)
Copilot refuses a Gemini request whose conversation holds more images than
the model takes ("too many images: maximum allowed for model
gemini-4-carbon is 10, got 12"), and it counts every image in the
conversation, not one message's. A long chat with screenshots stopped
working for good.
Now, on that 400 from a Copilot account, the gateway learns the cap the
error states (per provider and model), replaces the oldest images outside
the latest user message with a one-line placeholder until the count fits,
and sends again once. Later turns are fitted before they are sent. A
request under the cap is never changed. If the latest user message alone
is over the cap, the refusal is passed on as it came. Other vendors are
untouched (imageCapped: Copilot accounts only).
The cap is learned from the 400, not from /models' max_prompt_images:
Copilot lists 1 for gpt-* and 5 for Claude models but took 3 images on
gpt-4.1 and 7 on claude-sonnet-5 live, so the list is enforced only for
Gemini and would strip images that are fine.
Run (suite at the pre-rebase tree 4649e2269; after rebasing on
|
||
|
|
b9c385286b |
agent: the disconnect preview reads no sign-ins, so macOS never asks "Keychain Not Found"
jasonz3g on X (macOS, two Claude accounts): clicking Claude Code on the Agents page made macOS ask "Keychain Not Found — A keychain cannot be found to store …" (Cancel / Reset To Defaults), dozens of times. The Agents page loads a disconnect preview each time an agent's box shows: DisconnectPreview runs Disconnect on a copy, in a subprocess whose HOME is a temporary folder. Claude Code's Disconnect builds the model list (buildModels -> CatalogFor -> provider.All -> Accounts -> rememberLogins -> liveLogin), which read the Claude sign-in with `security find-generic-password`, and Cursor's too. On a Mac the keychain is found through HOME, and the temporary one has none. With a copy of real ~/.claude and ~/.config/magpie, the dry run ran security three times under the temporary HOME, started Devin's CLI there, and rewrote held/lapsed in the copy's logins.json. previewEnv now sets MAGPIE_NO_ACCOUNTS=1, which every keychain read and write, liveLogin and askClaudeStatus already honour. The dry run of the same real copy then runs no security and no CLI, and the agent's ~/.claude files come out byte for byte the same as before (diff -r), so the preview shows the same changes. Run: - TestDisconnectPreviewReadsNoSignIns (new), red on the old code (security find-generic-password -s Claude Code-credentials ... twice), green after; its second half checks the fixture does reach the keychain out of the dry run. - go test ./internal/agent -count=1 -timeout 45m: ok on mica (macOS) and on WSL Ubuntu (magpie-desktop); GOOS=linux and GOOS=windows go vet ./internal/agent ok; gofmt -l clean. - Real binary, dry run of `claude` on a copy of real ~/.claude and ~/.config/magpie with logging security/claude stubs: 3 security calls before, none after. Not tried: the GUI dialog itself (no display over ssh); the reporter's own accounts. |
||
|
|
50f7a8e01f |
routing: a Smart row behind one renewing sooner says so; Smart says new conversations go there too
YsiCing on X: in Smart, every conversation went to one Codex account (pro,
74% of its week) while Business and team, both at 0%, said "已用 0% · 会话留在另一个账号" ("0% used · the conversation stays on another account").
That is what Smart is meant to do. It sends every request, new
conversations included, to the one account whose quota renews soonest, and
only Stays: Session or Strict spreads new conversations. But the row blamed
a kept conversation, and the Smart description said "one account at a time"
without saying that covers new conversations, plus "at 90%", which is wrong
for a week since
|
||
|
|
1aa348d145 |
gateway: Claude Code's /advisor works through a Claude subscription (#6804, #6813)
The Claude subscription bridge runs the real Claude Code with magpie's
tools only, so Claude Code's advisor (Anthropic's server tool
advisor_20260301) was read like a translation without one: dropped from
the request and its instructions rewritten to "The advisor tool is no
longer available". /advisor did nothing (recih on X, #6813; swordencao's
group advisor, #6804).
bridgeRequest now reads a Claude Code request whose advisor model magpie
serves (advisedInBridge: provider.Resolve takes it, groups and [1m]
included) as readAdvised does: Request.Advisor is set, the instructions
stay as Claude Code wrote them. The run is offered advisorToolDef beside
magpie's tools; mcpCall answers a call by asking the advisor model
(adviceRound, 55s), and the client is told a server_tool_use and an
advisor_tool_result as Anthropic's server tells it, max_uses_exceeded
past three a reply. Claude Desktop and an advisor magpie doesn't serve
go as before. Nothing about the request's identity changes: the run is
still the real Claude Code, and the advisor tool goes to no upstream.
adviceFor, shared with the vendor route, now cuts Claude Code's advisor
instructions from what the advisor model is asked (advisorCut). With
them, or advisorGone in their place, the advisor answered as the executor
that it had no advisor; seen in the reporter's exact #6804 run.
Not changed: Claude Code's Code Mode (read in 2.1.325) needs ANTHROPIC_BASE_URL
on api.anthropic.com, first-party auth with no auth token or helper, and
a GrowthBook flag; no gateway can serve it without faking Anthropic.
Run:
- go test ./internal/gateway -run 'Advis|ClaudeTUIAdvisor|BridgeRequest'
ok (mote). Red on the old code: TestBridgeRequestKeepsTheAdvisor
("the advisor is \"\""); with advisorCut a no-op,
TestAdvisorServedForAVendorModel and TestClaudeTUIAdvisorAnsweredHere
("the advisor was told of itself").
- go vet ./internal/gateway on darwin, linux, windows; go test
./internal/gateway -timeout 45m at 7abbfac34 (rebased on origin/main
2026-11-16): ok, 946s (mote). At d54abb292, rebased on
|
||
|
|
b1dd96ab14 |
agents: a client of a Remote magpie starts its agents on the remote's models and follows them (KoiLx0 on X)
KoiLx0 runs several computers on one remote magpie and had to set every agent's models again on each of them, and again whenever the remote changed. Routing groups already reach a client (a group is a model of the remote's list, TestRemoteMagpieNewGroupServedBesidePicks); the agents' picks did not. - The remote tells, per connected agent, each model field's catalog ref at GET /v1/magpie/agent-models (gateway.SharedAgentModels, agent.SharedModels). Guarded as the Library is: this computer, or a full-access key of a magpie shared on the network; a held key is refused (readonly_test), and another machine without a key gets 401 (TestNetworkGatewayGuardsEveryRoute). - An agent connected here starts on those picks where this magpie lists them as <remote id>/<ref> (How "remote", after "again" and "joined"; the Agents page says "as on the remote magpie", in all five languages). - A field taken from the remote, or found on its pick, is recorded in the stash and follows the remote's change every 5 minutes (FollowRemotePicks from library.KeepLinked). A model picked here is the user's: the record goes, and the field is left alone until it is on the remote's pick again. A pick this magpie doesn't list is skipped. - app.js budget: no raise. The new line's 76 bytes come from same and alike sharing one string (CONN_WAS) and the native joined case returning plain instead of the same t() again. Run at this head (rebased on |
||
|
|
c38753a7ee |
search: Settings can ask every search API at once, results merged (heyiwei5 on X)
The search APIs are asked in order: the next only when one fails or
finds nothing. Asking several together, with their pages merged and
repeats dropped, has existed since #2845 but only through
`magpie search mix`. Settings › Models › Web search now has an Advanced
fold, shown with two or more search APIs on, holding "Ask the search
APIs: In order | All at once". All at once marks every API on as mix
(POST /api/settings/search-api {"mix":[...]}, provider.MixSearchAPIs);
In order clears the marks. In order stays the default. A mix of some of
the APIs, set from the CLI, opens the fold with neither choice on and
names the APIs it asks.
Run (mote, at this tree):
- go test ./internal/gui -count=1: ok.
- TestSearchAPIsMixedFromSettings at origin/main's api.go: build fails
(searchAPIJSON has no Mix), so it is red on the old code.
- node --test search-mix, search-count, search-api, i18n-keys:
72/72 pass, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 560px.
- search-mix.test.cjs at origin/main's assets: 0 of 30 pass (red).
- gofmt -l: clean.
- After rebasing on
|
||
|
|
b010fba05b |
gui: the pages go in the reader's own order, in the sidebar and a phone's tab bar (chet030714 on X)
Settings › General › Sidebar pages, where pages are hidden, now also puts them in order: a row is dragged by its grip (shown on hover, always on a touch screen), or moved with Alt+↑/↓. The order is kept for this browser in localStorage magpie.navOrder, beside magpie.navHidden. The sidebar and the header's tabs follow it at once, and a phone's tab bar (phonetabs.js) shows the first four with the rest under More. Providers is listed (it can be moved, never hidden). While the order isn't the home one the sidebar's group names (Work, Models, ...) are left out, since a reordered list breaks the groups; Default order (shown only then) removes the key and puts the pages and their names back. A page the kept order doesn't name (new in an update) goes after the page it follows at home. Plugin pages keep their place in their group. A reader who never reorders sees nothing change. navOrder and navArrange live in the new navorder.js, imported by navHides only once an order is kept (and by navpages.js with the menu), so what is left in app.js is that one line: +107 on both core budgets, explained there. old-webkit's list of on-demand scripts names navorder.js. Built on the unpushed WIP 10b9ee22c (page-order worktree), cherry-picked onto origin/main; the WIP test clicked the aria-disabled Providers row without force, and its reload checks now wait for the async import. Run: - nav-pages-order.test.cjs (new): Chromium and WebKit, en/zh/zh-TW/ja/de, 10/10 pass. Red on origin/main (no menu opens), 5/5 chromium. - The whole GUI suite (make test-ui) on mote at the first, inline version (navArrange ran on every start; the final version runs nothing new for a reader with no order), stopped after 4,171 ok / 171 not ok, none in a nav, sidebar or phone file. Five of the red files (agent-switch-accounts, gateway-key-arrange, first-untick, data-folder, api-key-theme) rerun on mica at this tree and at origin/main |
||
|
|
c1ab9a4946 |
gateway: an input item a Responses upstream has no type for is translated, and a compaction refused so is asked as text (cyberestro on X)
cyberestro on X: a Codex subagent on a local Qwen server's Responses API (qwen, http://127.0.0.1:30010/v1) got "compaction: qwen (qwen, …) answered the summary request 400 Bad Request: qwen: Unsupported input item: agent_message". agent_message is the item Codex's MultiAgentV2 hands a subagent its task in (author, recipient, input_text content, as #5259's and plugins#61's requests carry it). Two gaps, both fixed: - The compaction's fallback for an input kind refused (inputKindRefused, #5181, #5259) read only "unsupported_input_item" and "unknown item type". inputKindWords now reads "unsupported input item" with spaces too, so the summary is asked again with the conversation as text, the agent_message as the user's turn (itemText), then compacted locally. - The normal path relayed every subagent turn to the same server with the agent_message as Codex sent it, and gave the 400 back. passthrough now treats that refusal, on a request carrying an item other than a message, function call, its output or reasoning (hasOtherItem), like a custom tool refused (#2656): the model is marked (inputKindsRefused) and the turn is translated on the same API, where agent_message is the user's turn and a custom tool call a function call; later such turns go translated at once. A native compaction or sealed task still gets the refusal, and magpie's own summary ask (inCompaction) keeps its text fallback. Run (mote, mica): - New tests on the old code ( |
||
|
|
c867a12c5b |
claude: a client sending earlier turns' images back still goes on in its run
Yqihotaru (X) keeps a long conversation on claude-opus-5-5 through the
bridge, and their client takes the images of earlier turns out of some
requests and sends them back in others: the log's image count flips
between 2 and 4, every turn says "no run here has had this conversation",
and a new Claude Code starts from a transcript each time, so the prompt
cache is lost every turn.
lostMedia (#1382) took only images taken out, and looseTurn compared the
last turn alone with the whole history before it hashed exactly. Now
mediaMoved compares the conversation one role's run of messages at a
time, either way (images taken out, or put back where nothing or a line
of text stood). follows uses it for tool results; looseTurn keeps the
whole conversation and its settings apart, and rewrote takes a request
with the same settings whose images alone moved, in any turn. A sealed
tool result keeps the last 2KB of its words so one sent back without the
client's line is told from one changed otherwise.
Run (mica): go test ./internal/gateway (whole package, -tags nogui,
-timeout 45m) ok; go vet, GOOS=linux go vet -tags nogui, GOOS=windows go
vet of internal/gateway ok; gofmt -l clean. Rebased on origin/main
|
||
|
|
3ad5b93d41 |
provider: a Gemini model id with a slash keeps it in the request path (#6695)
A custom Gemini compatible provider's namespaced model id (example/model-demo) was asked at /models/example%2Fmodel-demo, since GeminiPath escaped the whole id. A relay that routes by literal path segments answered 403 Invalid URL (POPOBE97 in #6695, LuoRuiyao on X). GeminiModelPath now escapes each segment and keeps the slashes, so the request goes to /models/example/model-demo:streamGenerateContent. An id with an empty, . or .. segment, which a server could clean into a path outside models/, still goes as one escaped segment. Google's own ids (no slash) give the same bytes as before. Siblings made to agree: Vertex AI's VertexPath, VertexWholePath, its model test and the Claude rawPredict path (a slash id there goes to partner chat completions, so only the pinned test changed), the plugin Code Assist path in plugins.go and Gemini image generation in draw.go, both of which put the id in raw before (a ? or space broke the URL). Run (on mote): - red on the old code (old provider/gateway files, a shim for the new helper): TestGeminiModelPathKeepsSlashes FAIL `GeminiModelPath("example/model-demo") = "example%2Fmodel-demo"`; TestGeminiNamespacedModelKeepsItsSlash FAIL `status 403, asked [/v1beta/models/example%2Fmodel-demo:streamGenerateContent?alt=sse]`. Both pass with the change. - gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go build for darwin, linux (nogui), windows. - go test -tags nogui -timeout 45m ./...: all 101 packages ok. Not tried: a real relay that routes by namespaced id, or a real call to Google's endpoint (its paths for slash-free ids are byte-identical, held by the test). |
||
|
|
13e8002641 |
claude-desktop: two providers' Claude model read "Opus 5.5 · agy-cli", not the id's tail (onkashiko on X)
Claude Desktop names a row listed as magpie-<n>.anthropic.claude-opus-5-5
after its own catalog ("Opus 5.5"), whatever display_name says, so
agy-cli's and another provider's claude-opus-5-5 read alike and Desktop
5.11492 told them apart by the part of the ids that differs: "Opus 5.5
(…<n>.anthropic.claude-opu…)" (xVn/wVn in its app.asar). Only an
inferenceModels entry's labelOverride comes before the catalog's name,
and Desktop never suffixes such a label (keep in xVn).
magpie now writes the profile's inferenceModels, each row's display_name
as labelOverride, while two rows are named after one Claude model of
Desktop's catalog (desktopNamesClash), not only while a tier is picked.
The ids are unchanged. As with a tier's list, Desktop reads it at start
and its menu stays as listed until the next start; the Agents row's
Restart shows.
desktopNames' own fallback for two rows display_name still leaves alike
(one provider's models named alike) is now the model's id, "Z · D (z2)",
not the whole catalog id; two providers of one name keep the catalog id.
Claude Science takes the same names.
Run (mote, at origin/main
|