873a5caa2f551bfb85109dd5a1d9963cb0dccc19
8099
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
873a5caa2f |
daemon: the macOS gateway runs as Standard, not Background (#2961)
Generate ProcessType Standard for the gateway launch agent so launchd does not apply Background throttling on an interactive request path. KeepAlive, throttling interval, logs, environment, and lifecycle behavior are unchanged. Verified with gofmt, git diff --check, TestLaunchdPlistProcessType, and TestLaunchdInstall. Not tried: a real macOS launchd reload, plutil on macOS, and a current-main performance A/B. |
||
|
|
bda69db0ee |
awake: the gateway's process keeps macOS from App Napping it (#6261)
ChasLui (#6261, and on X): with the screen locked, every request after a
quiet while got the 30s pre-routing 504 from the menu-bar app (160 in one
night). The app serves the gateway in its own process, and a locked
screen leaves it a background app, which macOS App Naps: priority band 4,
timers throttled, so parsing the 6MB catalog took ~800ms instead of 50ms
and requests queued behind it past unroutedUnknown. Keep-awake
(caffeinate) holds sleep off, not App Nap.
ListenAndServe now holds an NSProcessInfo activity for as long as it
serves (awake.NoNap): NSActivityUserInitiatedAllowingIdleSystemSleep,
Apple's App Nap opt-out without the idle-sleep hold. Held for the whole
life of the gateway, not only while a request is in flight: the request
that suffered is the first one after an idle stretch, which arrives at
an already napped process. NSActivityLatencyCritical is left out: it is
timer precision for audio/video, at an energy cost, and App Nap's
throttling is what the reporter measured. Sleep is still Keep's alone,
only while the user turned keep-awake on.
The command-line magpie is built without cgo and runs from a terminal or
launchd, where App Nap doesn't reach it; there NoNap does nothing.
Run:
- Real App Nap on mote (macOS 27.2): two copies of a throwaway AppKit
.app (regular policy, launched hidden with open -j -g), one holding
NoNap. Without it: runningboardd "Set AppNap state: active:Y
priority:Y timer:Tier5" and ps pri=4 (42 of 42 samples once napped).
With it: "active:N socket:N priority:N timer:Tier0" and pri=20, never
4. pmset -g assertions listed nothing for either pid.
- TestNoNapLetsTheMacSleep (darwin+cgo): holds NoNap, reads pmset -g
assertions, fails on a Prevent* assertion of its own pid. Broken by
hand with NSActivityUserInitiated: red ("PreventUserIdleSystemSleep
named: magpie serves the gateway ..."); green with the shipped option.
- go vet (darwin), GOOS=linux and GOOS=windows go vet -tags nogui of
awake, daemon, cli, gateway; CGO_ENABLED=0 nogui build; gofmt -l.
- go test -count=1 -timeout 45m . ./internal/{awake,daemon,cli,gateway,
proc,update,masking,plugin} on mote: all ok (gateway 908s, plugin 159s, cli 52s) at base 7eecbcc56; at the pushed head (rebased on
|
||
|
|
459d668b35 |
sync: pick what syncs, preview a sync, undo the last one (#6428)
jinpwng (#6428, on X) syncs two computers and wants only Library and memory to go between them: each keeps its own providers, settings and models. They also want to see what a sync would change before it applies, and to roll the last one back. What syncs: providers, settings and profiles now have switches like agents' models, library and memory (Config.Providers/Settings/Profiles, *bool, nil = synced as before, so an existing setup syncs exactly what it did). The sync form shows Providers (and its API keys), Settings and Agents' models up front; Profiles, usage and sign-ins sit under Advanced, closed unless one is set away from its default. The form sends a part's choice only when it is or was off. A part left out stays as it is here and on the server; turning it back on joins it like a first sync (st.Off, rejoin). The sync's line says which parts each computer keeps ("Stays as it is on each computer: ..."). The setup text and the CLI carry it: magpie <webdav|s3|github> set providers=no settings=no profiles=no. Preview: davsync.Preview (plan.go) says, per part, what syncing now would bring in, send up, or leave; library items and memory files by name, sign-ins and plugins gone. Preview... in Settings > Sync shows it, and Sync now from there runs SyncPreviewed(token): if the server or this computer changed since, it says so and shows the new plan instead of syncing something else. CLI: magpie <kind> preview. Undo: a sync that brings parts in records them (st.Applied) and keeps a sealed copy of this computer first (keepSealed, as Restore does). Undo the last sync puts those parts back from that copy, on this computer only (st.Local, so the next sync sends it up rather than fetching the server's again). If one of them changed here since, it asks first (409 changed, Undo anyway). CLI: magpie <kind> undo-sync [anyway]. Restore's own Undo is unchanged. docs/subsystems/sync-backup.md and the site's sync docs (en, zh, ja) have a section on it. i18n: zh, zh-TW, ja, de. Run (worktree at base |
||
|
|
7eecbcc56b |
routing: a wider window never shows a request on more lines, nor cut off
normalcoder_ on X (v0.1.4053): on the Routing page a request still answering had its numbers (60 B, ≈ tokens, ago) drawn past the list's edge, cut off, and widening the window moved Accounts and keys beside the requests, where each request took two lines it had on one in a narrower window. - The hidden probes that size the list's columns now carry a request in flight's numbers, measured as "59 min ago" (the widest it says in the hour): measured without them, their column had no room; measured as "3 s ago", they wrapped once it said "13 s ago" and stayed two lines. - The accounts go beside only where the page is 1150px or wider and the requests, tried beside before the frame is drawn, still keep their numbers on one line (sideFit). By width alone, a page kept to 1200px left the requests ~850px. Metrics are never hidden by width: they wrap or go under the model, so the same ones show at every width; the Metrics menu still picks them. New routing-rows-widths.test.cjs: a request in flight alone, and with six finished, on the desktop and the browser page, by request and by session, from 2000px down to 520px and back: no cell past the list, the same metrics narrowed and widened, none gone and no row taller on a wider page. Chromium and WebKit, en and zh. Broken by hand: byWidth's min1150 put back, red at a page of 1096 -> 1156px (31 -> 50px); the probe's live numbers measured as they are, red at 768 -> 796px (31 -> 50px). On the original code the live row's numbers were past the list's edge. |
||
|
|
52c9880cbb |
providers: a setup pasted into Providers' own search opens the provider too (WJaunita45604 on X)
|
||
|
|
ea03a56518 |
update: a restart goes into the version its own check just downloaded
elis_pina on X (Windows): a click on the header's Update downloaded to 100%, then downloaded again, over and over; Settings > About did update. The pill restarts by itself once the download a click started is in (pulling in app.js). That restart asks the feed first (recheck, coeo91's "take the newest"), and magpie releases every 5 to 10 minutes, so with a download slower than that (80 MB on Windows, from China) a newer version was out each time: it was downloaded in place of the one just in, and the restart after it asked again. Settings' button only restarts on a click, so its loop stopped whenever the user clicked before the next release. |
||
|
|
9e3b269c51 |
lessons: the eager-regexp guard red a third time on 11-13 (d21cb563e)
|
||
|
|
49ebd63578 |
codex: the app's app-server is not ended under a turn still running
Norethcy on X (v0.1.4045): the Codex app (ChatGPT.app) went through a routing group. The ChatGPT account ran out mid-conversation, and the group's fallback answered. While that reply went on, magpie restarted the app's app-server and cut the turn off. magpie ends the app's app-server (codexAppStep, every 3s) once Codex's route has changed. That happens here: the account is spent, so magpie becomes Codex's provider. The end waits for the gateway to be idle for 10s, and for no turn open in a session file. The causes: - sessionTurnOpen read only the last 512 KB of a rollout. A turn that wrote more than that counted as no turn at all: a tool's long output, images, an hour of work (one of the owner's own turns is 22 MB). A tool running 10s between two requests was then taken for the turn's end. The file is now read back in 512 KB chunks to the last task_started, task_complete or turn_aborted. Each chunk overlaps the next by a mark's length, so a mark across two reads is found whole. - With the account spent, a turn open past 2m with quiet sessions counted as stuck on the spent account and was ended. A turn that went on through magpie after the route changed is served, not stuck. It is no longer ended for that (goneOn). - busy was read before CodexBeforeAppEnd moved the open chats. A request that began meanwhile was ended under. It is read again just before the end. - When the listing showed no new app-server after the end, the app was quit and reopened (Windows) even while it sent through magpie. Now it isn't reopened while a request is in flight or one began since the end. - A magpie that took the gateway over (an update) saw none of the old magpie's streams, so its first look could end the app-server under one. Its start now counts as a Codex request just ended. The crash relaunch (codexAppCrashStep) and RestartCodexAppWhenIdle use the same turn check, so they wait for a long turn too. The buttons the user presses restart at once, as before. Tests (internal/provider/codex_app_inflight_test.go). All 6 fail with the old codex_app_server.go swapped in, and pass now: - TestCodexTurnOpenPastTheTail: turns of 512 KB+1, 1.5 MB and 22 MB, open and ended, with the app-server's start before and after the turn. - TestCodexTurnOpenMarkAcrossReads: each mark straddling the read boundary at every byte. - TestCodexAppServerWaitsForATurnTheFallbackServes: the reporter's case with the real session-file check. The route goes out while the fallback streams; a 600 KB turn has a 15s tool gap, then a tool running past 2m. The app-server is ended only once the turn ends. - TestCodexAppServerEndLooksAtRequestsAgain, TestCodexAppNotReopenedWhileItSends, TestCodexAppStartCountsAsARequest. Broken by hand: with goneOn forced false, the fallback test fails at "a tool running over 2m0s in a turn the fallback served". Cost: an open 22 MB turn takes 97 ms and 559 KB per look (benchmark on mica). A look happens at most every 3s, and only while an app-server is waiting to be ended, the gateway is idle and such a turn is open. An ended or short turn is found in the last chunk, as before. Run on mote: - Full suite, go test -timeout 45m ./..., at this change on |
||
|
|
36c5ee1e6c |
claude: a run that ends during a turn keeps its session for the answer, retry or summary after (#6528)
When the Claude Code bridge ended a run in a turn the client still goes on with (runTimeout on an AskUserQuestion, or letGo when the client went away mid-reply), removeRun deleted its session file. The late answer, the tunnel-drop retry and the delayed AgentSummary then found no run and were told whole to a new Claude Code (recih: 118K and 305K written to the cache again). removeRun now keeps such a run (keepEnded, claude_ended.go) in the same b.mu section that takes it out of runs, so no request in between finds neither. The bounds: at most endedMost (16), each for endedLongest (idleLongest, the cache hour), the oldest let go first, with its files removed. Not kept: shelved, rewound, client cache marks, a handed-over account, or anything at gateway stop (abortAll drops them all, and sweepSessions takes what a crash leaves). branch and retryBranch look at kept runs after live ones, latest first. Each branch cuts its own copy, so the kept file is never written and the AgentSummary that comes after a recovery still branches. Real Claude Code 2.1.316 (mock Anthropic plus an MCP tool that never answers, both -p and interactive): the text and tool_use lines are in the jsonl ~30-60ms after the reply streams, and on SIGTERM only cost-state lines are added, with no result and no interrupt marker. So a cut after the call line is sound. Run: - New tests: TestClaudeAnswerAfterTheRunEndedBranchesOffItsKeptSession, TestClaudeEndedRunsSessionsAreBounded (time, count, stop, unkept), TestClaudeTurnSentAgainAfterItsRunEndedBranchesOffItsSession (real letGo through the interactive harness, -count=10). - Broken by hand on mote: with keepable() returning false, the answer, count and retry tests went red; with (gone || !run.closed) put back to !run.closed, the answer and retry tests went red. - gofmt -l clean. go vet -tags nogui ./... with GOOS=linux, GOOS=windows and darwin on mote: ok. - Full suite, go test -tags nogui ./... -timeout 45m on mica at 07ed85f97 (origin/main |
||
|
|
48e394146b |
davsync: the setup text's body regexp is compiled when first used (#6534)
|
||
|
|
f46a37f509 |
gui: a WebView2 process that fails is logged and the window comes back by itself
aquaarboraurum on X (magpie 0.1.4040, Windows 11, WebView2 138): the main window went white after a while, leaving the title bar, a strip at the left edge and the status bar. Closing it to the tray and opening it again brought it back, and the log said nothing. Wails registers for WebView2's ProcessFailed but leaves its ProcessFailedCallback unset, so nothing in magpie heard any WebView2 process end or fail. Now each window's failures are handled, once its first page has come (webviewmend*.go): - each one is logged: "webview (main window): GPU process exited; drawing it again", and so on for every COREWEBVIEW2_PROCESS_FAILED_KIND; - GPU, unknown or a new kind: the controller is hidden and shown again (put_IsVisible), what the tray close and open did, without the window going; - a render process that exits or hangs, or a frame's: the page is reloaded (ICoreWebView2::Reload); - the browser process: the window is let go as lightweight mode does and the main window made again, once the old browser has let go of the profile folder (made at once, Wails ended magpie on a controller timeout); - utility, sandbox helper and plugin processes: logged only; - a reload or remake again within 30s is logged and left alone, so a failing renderer doesn't loop; - after the computer wakes (SystemDidWake), each open window is drawn again the same way, since a GPU that lost its device while asleep is the likeliest way to a white surface with the window's frame left. The cause of the report is not proven. Ending the GPU process on the Windows box doesn't leave the old code white (WebView2 makes a new one and the page keeps drawing), and a dead renderer doesn't match a window that the tray brings back. The log line is what the next report needs. Run: - TestWebViewComesBackFromEachProcessEnd (new) on xiaomi-gpu, Windows 11 25H2, WebView2 157, in the signed-in session (schtasks /it; it skips over ssh, session 0): it ends the test build's own renderer, GPU process and browser process and checks the page comes back drawn (screen pixels over the client area, white share 0.00) - renderer, gpu-process and browser all PASS (16.4s). - Broken by hand (mendWebView taken out of makeMain): all three red - "the page didn't load", "hidden=false, never visible again", "timed out waiting until the window is made again". - Old code, GPU process ended, white share sampled 10s: 0.00 every second (not white: the cause above is not reproduced). - TestWebViewMendForEachFailure, TestMendGapHoldsOnlyReloadAndRemake. - mica: go vet ./internal/gui (darwin, GOOS=windows), go vet -tags nogui (darwin, linux, windows), go test -count=1 ./internal/gui ok 137s. - mica, go test -count=1 -timeout 45m ./... at |
||
|
|
b3395ffdaf |
usage: a models.dev change no call of the user's names keeps the request index
The request index's meta named the catalog by models.json's bytes (catalog.CacheKey, v0.1.4037), so every real change models.dev made, most of them to aggregators' lists (OpenRouter, NanoGPT, Kilo, Vercel) no call names, dropped every chunk and read every session file again: ~15 s of CPU on a long history, several times a day. The meta now names catalogBase: the catalog the rows were made under, kept while each question the rows asked of the catalog is answered the same. The questions are Pricer's base price (basePriceIn, taken out of Pricer whole) and ListedAs's listed name; each is noted with its answer the first time it is asked (noteAsk). A new catalog file, or a catalog read again (catalog.Resets: Sync writes the file before it resets), asks them all again; one answered otherwise names the index anew, as any change did before. A question answered otherwise than first, or more than 50k of them, does the same. The asks are kept in catalog-asks-v1.json, written before any file of rows under the meta (toDisk, heat, page, effort, digests), so a restart holds the rows on disk to them too. The price cache key (usagePriceCacheKey) is unchanged. Run on mica at this tree: go test ./internal/usage ./internal/catalog ./internal/gateway ok (gateway 1038s); go vet, GOOS=linux and GOOS=windows go vet of usage and catalog clean; gofmt clean. Broken by hand, each red in TestRequestStateKeptAcrossACatalogChangeNoRowAsks: answersSame always true, the meta back on catalog.CacheKey, and the catalog.Resets check dropped (a check between Sync's write and its reset). catalog_asks.go joins the row code's go:embed, so the index is built once after this update. Not tried yet: a real models.dev change on a real account (next, on mote). |
||
|
|
e5994a0159 |
gateway tests: a fake upstream judges only what the gateway sent it (#6535)
TestTencentTokenHubRoutes went red once in a full internal/gateway run
on the Linux box: "asked at /ws/herdr". Another program on the machine,
a herdr client, reached the fake upstream's loopback port, and the test
fails on any path its fake was asked at. TestQianfan's and Bedrock's
"asked at" loops do the same.
All three now judge only requests that carry the test's key
(sentByTest). The gateway sends that key on every call, so a wrong path
it asks at still fails.
Run:
- wsl-run go test ./internal/gateway -count=3 -run
'TestTencentTokenHubRoutes|Qianfan|Bedrock': ok.
- GOOS=windows go vet ./internal/gateway: ok. gofmt -l: clean.
- Broken by hand: a GET of srv.URL+"/ws/herdr" added before
TokenHub's check is green with the filter, and red
("tokenhub_test.go:155: asked at /ws/herdr") with it taken out.
Not changed: the shared fake that native_compaction_test.go's "asked at"
reads keeps only the last request's path, so a stray request can still
overwrite it. Noted on #6535.
|
||
|
|
d628a1c803 |
settings: Automatic updates' hover card says why an update can be trusted
ArcticLampyrid on X asked for Settings to say why automatic updates are safe. Two lines now join the Automatic updates row's explanation. Like every Settings line, they show only in the row's hover card (or on focus, or inline where there is no hover), and a small info mark goes on the row's name where there is hover. There is no new section or row. - Every update is signed: its SHA-256 checksums carry an ed25519 signature, checked against a key built into magpie (internal/update/signed.go). - Its SLSA build attestation, signed through Sigstore, is checked too: it shows magpie's release workflow on GitHub built those exact files. An update that fails a check is not installed (internal/update/attest.go). The lines are added by updatetrust.js, a module settingshints.js loads on demand. It watches #about and adds them each time About is drawn. They live there and not in app.js because the core scripts' budget (TestCoreScriptBudget) has no room. old-webkit's list of on-demand scripts names it. Translated in zh, zh-TW, ja and de. update-auto.test.cjs: at rest the two lines are out of sight; hovering the name shows the card with the row's line, "ed25519" and "Sigstore"; the mark is there; and the card goes once the pointer leaves. The existing check of the switch's own line now reads the first line only. Run (mote-run, at this commit rebased on |
||
|
|
b05a525a33 |
update: Restart to update goes into the download waiting when downloads are automatic
canlee886 on X: auto-download had a version ready, but magpie releases
many times a day, so by the time they pressed Restart to update a newer
one was out. The click asked the feed (coeo91's "take the newest") and
downloaded the newer one whole while they waited, which made the
download done ahead of time useless ("这个自动下载在如此频繁的更新之下
简直就是摆设了").
Two ways to fix it: keep the staged copy current (check more often,
download each newer one), or restart into the staged copy and let the
next check fetch anything newer. This takes the second:
- the restart is at once, which is what the download ahead of time is for;
- no more bytes from R2 than before: one download per update. Keeping
the copy current would download 40 to 95 MB per release, several times
a day, which iiiiiimone's fix (the clock leaves the one waiting) took
out;
- the new version's first clock check, 5s after it starts, fetches
anything newer in the background, and the next restart goes into that.
So with downloads automatic (the default), recheck leaves a ready
download alone and doesn't ask the feed (keepsStaged). That covers the
page's Restart to update, the tray's restart, and Restart when idle.
The notes dialog's freshen (#910) still asks the feed for late notes
(#649), but with `keep` set it leaves the staged copy as the clock's
check does, so the dialog names the version the restart goes into.
With "Download updates automatically" off, nothing changes: a click asks
the feed and downloads the newest (coeo91).
Tests: TestRestartTakesTheDownloadWaiting (new) covers the page's click,
the tray's restartAsked, AutoRestart's waitIdle and a stale freshen. Each
keeps 0.1.11 with one download while the feed has 0.1.12, and a later
check takes 0.1.12. The coeo91 and #910 tests now set NoAutoDownload
(downloadsOnClick), the behaviour they guard.
TestUpdateClockLeavesWaitingDownload and TestUpdateNotesAskTheFeedAgain
expect the staged copy kept under auto-download.
Run (mote-run, at this change rebased on
|
||
|
|
f9ad4122bb |
providers: Compact at's size chips set several models at once (Yanzhongixuy on X)
A Compact at chip (128K, 200K, 272K, 500K, 1M) opens a menu of All
models and each served model, with the ones at that size ticked.
Ticking one gives it that size, unticking takes it back; the menu stays
open, so several models get one size in a few clicks. Context window
and Max output chips keep setting every model at once, as before.
The three fields' chip rows are now one helper, sizePicks, which keeps
app.js and the core script inside their budgets without a raise. Menu
strings (All models, Compact at {n}, Search models) already exist in
every language.
Run at
|
||
|
|
414517ccf5 |
gateway: a plugin's 4xx turning the agent's prompt away asks the next member (plugins#1094)
The AutoClaw plugin answers 406 when a chat's system prompt carries
another agent's identity line it doesn't rewrite ("AutoClaw refuses
chats whose system prompt carries another agent's identity line …, so
an unknown one needs another provider in this group"). retryable only
read refusedWords at 400 and 422, so holdWriter.failed() was false for
the 406, the try never reached the promptRefused branch, and the group
stopped at AutoClaw while its other members, taking the same prompt,
were never asked.
refusedWords now also matches AutoClaw's own words, and retryable
counts a refusal at any 4xx. Like WorkBuddy's 400, the refusing account
isn't rested and its mates are asked last.
Run:
- wsl-run go test ./internal/gateway -run
'PromptRefus|Restricted|Refus|TokenWall|Volcengine|Decide|Retryable':
ok. TestPromptRefusalRestsNobody is now table-driven, with AutoClaw's
406 body in a "next answers" case and a "nobody left" case.
- Broken by hand: with the new retryable case removed, both AutoClaw
subtests go red ("tried [acct-1]"); restored, green.
- gofmt -l: clean.
Not tried: a real AutoClaw account. The plugin side, rewriting ZCode's
subagent line, is autoclaw 0.2.23 (plugins f053e327).
Reported-by: aynauynij
|
||
|
|
24cdfb5460 |
lessons: #6482 closed on one green release while the 403 came back
Five tags after the close never published (notarisation 403 and a notarytool timeout). Recorded under keeping an issue open until the case works. Docs only; nothing run. |
||
|
|
f5553d7103 |
sessions: a Pi subagent's calls are its lead session's, on its own model (nzvzbmz78932 on X)
nzvzbmz78932 on X: "在pi子代理中使用了deepseek 但是不显示用量". pi-subagents (npm 0.88.1) runs each subagent as a Pi of its own, its session in <lead file's folder>/<run id>/run-<n>/session.jsonl (async and parallel runs a level deeper), or under extensions/subagent/config.json's defaultSessionDir, its header's parentSession naming the lead's file. magpie read only sessions/*/*.jsonl, so those files were never read. The lead's `subagent` tool result carries the subagents' usage summed, and piParse counted it on the lead's model and provider: a lead on magpie's entry made it the gateway's (piGateway), so DeepSeek's calls were on no page, Usage or Sessions. - piFilesIn reads every session file under a lead's folder as the lead's (non-main, like omp's), and the defaultSessionDir ones through their headers' parentSession, up to 8 levels. - piSubagentsRead: a tool result whose every sessionFile is one of those counts nothing, in piParse and piCall; one naming a file not read still counts as before. - The scout's header id is in Session.Subs (pi is idInFile), so a subagent on magpie's entry is the lead's row to the gateway too. - state.codexPath is parsePath, the file read, for piLeadID: a new field took state past its 416-byte class (TestStateFitsItsSizeClass). - parseVersions and callParseVersions pi/raft/cindy raised. The fixture is a real run: Pi 1.4.0 with pi-subagents 0.88.1 in a sandbox PI_CODING_AGENT_DIR, a lead and one scout on a relay's deepseek/deepseek-flash; system prompts dropped, paths rewritten. Run (mica, at this head): - go test ./internal/sessions: ok (119s) - GOOS=linux and GOOS=windows go vet ./internal/sessions: ok; gofmt clean. - Linux (wsl-run, magpie-desktop): TestPi*, TestOmp*, TestCodex*, TestStateFits*: ok TestPiSubagentCalls: beside the lead and in defaultSessionDir, each with the lead on the relay and on magpie's entry (the reporter's case). Broken by hand: without the walk, 3 of 5 calls and 0 of 2 with the lead on magpie (red); without the tool-result skip, 6 calls, the sum counted again (red); the Subs check was red while it named the run id. Not tried: the reporter's own files; a subagent nesting subagents; a subagent run on magpie's entry against a live gateway. With f0fb22c6b and 5bc816c1a below it, at this head (mica): go test ./internal/sessions ./internal/agent ./internal/claudecode ok, ./internal/gateway -run TestClaude ok, GOOS=linux and windows go vet of the four ok, gofmt clean. |
||
|
|
9205ee109c |
agent: the Claude Code magpie downloaded keeps ~/.claude from reading as "CLI not found"
Wing8Aqua on X runs magpie as a systemd service on Ubuntu, where the Claude subscription runs the Claude Code magpie downloaded (claudecode.Install, in its cache folder, off PATH). Magpie's own runs make ~/.claude, and the Agents page took that folder, with no `claude` on PATH, for an uninstall's leftover: Claude showed "CLI not found" while that Claude Code answered every request, and `magpie claude` starts it. cliHeld now counts claudecode.Downloaded() for Claude Code. Run: TestCLIMissing* in internal/agent on Linux (wsl-run): ok, with a case for a download and one for a version folder without its binary. Broken by hand (the download not counted): case 5 red. |
||
|
|
6fad0d0465 |
gateway: a run waiting a minute on its subagents gives its Claude Code place to one that needs it
Wing8Aqua on X (0.1.4026, Ubuntu, magpie.service with memory.high 768M): "4 Claude Code processes are running, as many as may run at once (768 MiB of memory (cgroup /system.slice/magpie.service/memory.high) holds 4); none ended within 2m0s". An ask that finds the room full lets go of an idle run, else of a run parked on tool results, but only one parked parkLongest (5 minutes), while it waits claudeRoomWait (2 minutes). A lead conversation waits on its parallel subagents' Task calls for as long as they work, and every subagent is a conversation needing its own Claude Code: the lead held a place, doing nothing, while a subagent waited the 2 minutes and was answered 503. letGoForRoom now takes a parked run once it has waited roomParkLongest (1 minute), well inside claudeRoomWait. Its results go to a new run told the whole conversation, as past parkLongest; a tool answered within the minute keeps its run, and busy runs are never let go. Run: TestClaudeRoomLetsALeadWaitingOnSubagentsGo, with the room tests (TestClaudeRoom*, TestClaudeRunsHeld*, TestClaudeOneOffs*, TestClaudeParked*, TestClaudeNoRoom*, TestClaudeMem*) on Linux (wsl-run, magpie-desktop): ok. Broken by hand (parkMost back to parkLongest): the subagent got the 503 after 30s, red. Not tried: the reporter's machine; whether their 4 were busy rather than parked is not known (their `magpie claude-code runs` would say). |
||
|
|
6fc8fdae41 |
cli: the Usage page's switched-off check-ins route is named (wxkwxk666 on X)
|
||
|
|
e5b8f381dc |
provider: a Gemini provider saved as a bare host reads its Host without building a URL (#6479)
|
||
|
|
880da8c17e |
agent: ZCode is told a model takes video, so a video it attaches reaches it (Flandern1211 on X, #5098)
A model whose source lists video input (antigravity/gemini-4-argon, say) reached ZCode as text and image only, in config.json's modalities.input and in provider_config.json's inputFormat, so ZCode never attached a video to it. buildModels left the catalog's kinds out of the agent model, and zcode.go rebuilt the list from m.Images. - buildModels carries Entry.Modalities() into InputModalities and OutputModalities. - zcodeInputs adds "video" when the model lists it and the provider's format is Messages or Chat. ZCode's own built-in rules (3.14.3's zcode-builtin.json) use inputFormat.supportsVideo, so the key is one its strict schema takes; it is written only when true. Ported from Flandern1211's fork branch (fix/zcode-video-input, e955d3c24), with these differences after review: - Its gateway half (Messages video block and Chat video_url as a file part) is on main already, since |
||
|
|
7758da0770 |
agent: Crush is told which models take images (Novello42 on X, #6515)
Crush's view tool answered "This model (…) does not support image data", its file picker (ctrl+f) was hidden and a pasted image was left out, for every model through magpie. magpie wrote Crush's providers.magpie.models without catwalk's supports_attachments, so each model decoded with SupportsImages false (capabilities.vision false once Crush 0.99 migrates the file: migrateCatwalkV2Model, internal/config/load.go). Each model now carries supports_attachments from m.Images, as OpenCode's modalities do. Checked against catwalk and Crush main: Crush's load.go moves supports_attachments to capabilities.vision; catwalk v3 reads vision. Report and root cause: #6515 by DaVinci42. Not changed: magpie still writes Catwalk v2 keys, which Crush 0.99+ rewrites to v3 on load; filed as #6521. Test: TestCrushModelsSayTheyTakeImages, red on origin/main |
||
|
|
ea3edd4b13 |
routing: an account's share names its window when more than one counts the model (Wing8Aqua on X)
On the Routing page, under In turn, each account showed its week's share
("41% used") while its five hours were at 0%, and read as the five-hour
window. The row's share is Allowance.For's, the fullest window's, and
that is the one routing goes by: In turn rotates without weighing usage,
and sets an account aside only when a window reaches 98%, so the week at
98% stops it with the five hours empty. The number was right; it didn't
say which window it was.
Allowance.FullestName gives the name of the window the share is of when
two or more windows count the model (empty for one, as before). The
gateway puts it in Weighed.usedWindow, and the Routing row puts its short
form in front: "7d 41% used" (zh "7d 已用 41%").
Run (mica, -tags nogui): go test -run 'Fullest|UsedWindow|UsedRenews|Weigh'
./internal/provider ./internal/gateway ok; go vet darwin, linux, windows
on provider and gateway ok; gofmt clean. GUI (mote): the new
routing-used-window.test.cjs, 22 of 22 in chromium and webkit, en, zh,
zh-TW, ja and de, at 1100px and 420px; routing-*, i18n-keys, gui-zh-tw, gui-ja and
gui-de: 3234 of 3253; the reds are gui-de/gui-ja (fixed in this push's
sessions commit) and routing-context-fold, pin-away, row-swap, signin and
story-shrinks, red the same on a clean origin/main
|
||
|
|
ba60e2e7f4 |
sessions: de and ja name the uninstalled agent once, as the English does
fe20e4dbd's "{agent} isn't installed here…" has {agent} once; its German
and Japanese said it twice, so gui-de and gui-ja's placeholder check was
red on main. The second mention is now "seine eigenen Dateien" and
"そのファイル自体".
Run (mica): node --test gui-de, gui-ja, i18n-keys, sessions-forget: 20 of
20 pass. Before: gui-de and gui-ja "de/ja has every zh string" red on a
mote run of this branch.
|
||
|
|
baffcb65dd |
provider: Host asks a saved Gemini base without building a string again
|
||
|
|
456b5c6c74 |
alibaba: a RAM user's NotAuthorised names the grants Token Plan needs (#6506)
hkxhkxhkx on X (#6506, v0.1.4026, gateway on OpenCloudOS): the Token
Plan personal edition's usage, read with a RAM user's AccessKey, fails
with BailianGateway.Team.NotAuthorised. The RAM user had the
AliyunBailian* and AliyunModelStudio* policies.
magpie calls the right API: GenerateCLIAccessToken, then the console
gateway's zeldaHttp.apikeyMgr./tokenplan/personal/api/v2/usage, the same
call Alibaba's own CLI (modelstudioai/cli, `bl usage token-plan`) makes;
its only other parameter, switchAgent, is for delegated access, not RAM
users. Alibaba's Token Plan docs (personal FAQ; permissions and usage)
list what a RAM user needs, and none of it is a Bailian/ModelStudio
policy:
- the AliyunTokenPlanReadOnlyAccess (or FullAccess) system policy,
- AliyunBSSReadOnlyAccess for the personal edition,
- the Administrator or Subscribe Plan permission for the RAM user on
Model Studio's Account Management page.
The NotAuthorised error now says those three and where, or to use the
main account's AccessKey. Any other refusal now carries the console's
errorMsg (read as raw JSON, so an odd type doesn't hide the code).
Tests: TestAliGatewayRAMNotAuthorised answers the call with the
console's NotAuthorised envelope and checks each grant is named, and
that another code shows its errorMsg. Broken by hand: the old message
makes it red on five checks.
Run on mica (and again after the rebase onto
|
||
|
|
dc1f17c1c8 |
library: RTK's chart says its top number is the busiest day, not a total (jasonchia58 on X)
jasonchia58 on X (macOS, v0.1.3119): the number at the top right of Library → RTK's chart (1.6M) stopped changing, while the total under the chart kept growing. That number is the bars' scale: the busiest day's (or week's) input in the range, shown bare since |
||
|
|
d21cb563e9 |
sync: Copy setup gives the sync setup as text, sealed with the passphrase (WJaunita45604 on X)
Setting sync up on a second computer meant typing the server, user, password (or S3 keys, or GitHub token) and every tick again. Settings › Sync's form, with sync on, now has Copy setup. It copies one line, `magpie-sync:…`, to paste into the same form on the other computer. - The line is not base64 of the settings. It is the setup (server, password or token, endpoint, region, path style, branch, the ticks) sealed with the sync passphrase by backup.SealData, the AES-GCM and PBKDF2 envelope the server's file already uses. The passphrase is never in it. Whoever has the line and not the passphrase has nothing. The copied note says what it holds and that the same passphrase opens it. - Pasted into any field of the form, the line is not typed in; the form asks for the passphrase, opens it (POST /api/davsync/setup-open), picks WebDAV, S3 or GitHub from its address and fills every field and tick. Nothing is saved until Turn on, and Turn on opens a pasted line first. A wrong passphrase, or text that isn't a setup, is said in the reader's language. A line a chat wrapped, or text around it, still opens. - Not built: GitLab or MySQL sync backends. Run (mica): - At the pushed tree (run as 8fadc2ef8, the same tree before these bodies): go test ./internal/gui ./internal/davsync ok; sync-setup-text, i18n-keys and i18n-en-no-cjk in the 110 of 110 the commit before names. At the base |
||
|
|
a44da380b9 |
providers: a vendor's setup pasted in any form fills the custom provider (WJaunita45604 on X)
|
||
|
|
49d7adef74 |
lessons: 5b25d7e9e tagged with the core budget red; packing lines is not a move
|
||
|
|
e4ea313215 |
context: the last-cache fix fits the core script budget again
|
||
|
|
f07c5de1f0 |
wsl: a distro whose vEthernet path to Windows is firewalled reaches magpie at Windows' LAN address (H1_B1_K1 on X)
H1_B1_K1 on X: a company firewall (火绒企业版) that the user can't open blocks a NAT distro's path to Windows' address on vEthernet (WSL), the 172.x one magpie wires agents in WSL to. Windows' LAN address answers from WSL. Nothing told magpie to try it, and nothing should have to: - When the reach check from inside a NAT distro finds the gateway's WSL address shut (reachFrom's probe, told and not ok), wslFindVia asks the gateway (gateway.SetWSLVia, kept in settings.Dir()/wsl-via) to listen at each of Windows' other IPv4 addresses too. The LAN's addresses come first and Hyper-V's other vEthernets last. It then asks from the distro which one answers, keeps the first that does as the via and lets the others go. - A via listener lets in only Windows itself (peer == local address, which is how a NAT distro's connection to the LAN address arrives) and the WSL networks. A LAN peer is reset before HTTP. fromWSL takes the WSL key there as it does on vEthernet. - distro.host() is the via under NAT, so base(), the Claude Science relay and keptaway's wslHost use it. Every NAT distro's wired agents are set again (Rewire). WSL Codex now moves its own two URLs (codexMoveGateway), as on Windows, because openai_base_url wasn't moved by a rewire. The address left behind goes into the distro's Was, and the unreachable line offers "Use" for a config still on the old one (wslMovedFrom). - When the via shuts later and the WSL address answers again, the via is dropped and agents go back. Not changed: wslrun.Tool.proxy still turns a user's 127.0.0.1 proxy into the distro's vEthernet host (Tool.Host). That is the user's own proxy, which magpie can't make listen elsewhere. Filed as an issue. Run: - go vet for darwin, windows and linux of internal/agent, gateway and wslrun: ok (mica). - go test internal/gateway and internal/wslrun -run "WSL|Via": ok, on mica and on Windows (xiaomi-gpu). - go test internal/agent -run "WSL|Kept|Reach|Unreach|Codex| ClaudeScience": ok (mica, 104s). On Windows, -run "WSL|ClaudeScience|Kept|Reach|Unreach": every WSL test ok. Its first run was red in three WSL tests: a distro found shut searched the box's real addresses, 15s each, under wslViaMu, so the next test's probes waited. TestMain now gives the package no candidates. The four "kept" allocation reds there are red at base too (#4786). - Real, on xiaomi-gpu with the magpie-desktop distro (NAT, Windows at 172.17.32.1, LAN 10.0.0.132). A firewall rule blocked inbound on 172.17.32.1 at the test's port. A throwaway Windows test (not committed) started gateway.New().ListenAndServe and called wslFindVia with the real wsl.exe: - curl from the distro to 172.17.32.1: no; - candidates [10.0.0.132 192.168.77.1 172.28.224.1]; - via [10.0.0.132] kept in 0.66s, and the distro reaches magpie there; - curl to 10.0.0.132 from mote and from this Mac: reset by peer; - from the distro: an HTTP answer. The rules were removed afterwards. Broken by hand, each red: - dropping the wslFindVia call in reachFrom: TestWSLFirewalledFindsAnotherWay; - dropping fromWSL's via clause: TestWSLViaCallerServed; - dropping the peer == local check in viaPeer: TestWSLViaListenerLetsInWindowsAndWSLOnly. reach_test's reachForget now waits for a probe still out before it clears the answers. TestWSLFirewalledFindsAnotherWay's last driftSettled starts a probe for the address the agent was just set at, and clearing under it panicked (assignment to entry in nil map). That was once in 1 and once in 3 runs at -count=3 on mica, and 0 in 5 after the change. At the rebased head ( |
||
|
|
2f22cc7e80 |
redact: Settings › Privacy's masking rules are imported in bulk and copied out (hgk0x on X)
hgk0x on X had many fields to mask, and adding custom rules one at a
time was slow. The Masking rules row now has Import… and Copy beside its
words, as the word lists have:
- Import… opens a box under the row's fields. One rule a line: a name,
then a tab, =, : or comma, then the pattern; a bare pattern is CUSTOM.
The box's Regex/Prefix choice says how a pattern is read. A JSON list
(what Copy writes) is taken as it is, prefix and regex rules alike.
What was read is listed (the first eight, then "and N more"); a rule
the list has, or one pasted twice, is passed over. Import saves once,
after the rules there are. Escape and Cancel save nothing; a redraw
keeps the box, its text and its choice; a list the gateway refuses is
said in the box and the paste is kept.
- Copy writes the rules as JSON.
MaxRules stays 32. Measured on this machine: 32 rules took 83ms on a
190KB body, 100 took 343ms, and that cost is on every request. One
rule's regex with alternation (a|b|c) covers many fields, which the
reply says. There is no CLI for masking rules, so none was added.
Run (GUI, mote/mica, both engines):
- new redact-rules-import.test.cjs: 5 languages x chromium/webkit at
400px, 10/10 ok.
- the 56 GUI files that reach the privacy page, masking or i18n
(i18n-keys, i18n-en-no-cjk, plugin-own-words, redact-*, mask-*,
privacy-*, settings-*): 1333 tests, 27 red on loaded mica. The reds,
run again on mote at base
|
||
|
|
f9678cebe2 |
gui: Routing's quota bars are Usage's, and every account in a Usage card has a line over it
normalcoder_ on X: Routing's remaining/total bars were grey and black while the Usage overview's are blue, and in a Usage card with several accounts two accounts ran together with no divider. Routing's bars were never Usage's: |
||
|
|
5b25d7e9e8 |
context: a request under way in a long session shows the last cache, not "—" (shenggxhz on X)
shenggxhz's Codex session (T3 Code) on Routing showed "— 命中 · 供应商回答后可见" while a request was under way, and read it as the cache missing. The cache was there: Codex's rows record cache_read at about 32K of 34K. The card was dropping it for two reasons. - The card forgot the last cache whenever the first request in its session line changed (its key was opts.series[0].id). Routing keeps only the latest 60 requests. In a session longer than that, the first request moves on with every new request, so every request under way showed the dash. The key is now the caller's session key (opts.session: the Routing session key, else the conversation). - A card opened while a request was under way had no last cache to show, even when the session's answered requests were in the list. Routing now passes the session's last answered request with usage (opts.prev). Its cache is shown, dimmed and labelled "the last request's", until this request's own cache is read. Run (mote): - At the pushed head (rebased on |
||
|
|
83b8910388 |
gateway: TestRetriedRequestCountsOnce holds Failed to d370bef98's rule (#6466)
|
||
|
|
80c22eecba |
agents: Codex leaves a model unchecked in its provider's list (JNDliuliuM on X)
JNDliuliuM: after picking new models for a provider, Codex CLI didn't change, and after a restart it was still on the old model. magpie wrote the new list, but Codex's `model` (config.toml, or magpie.config.toml for `codex -p magpie`) stayed on the model the user had unchecked. Resolve still takes any provider/model, so Codex kept starting on it and asking the vendor for it. Tried with the real codex-cli 0.165.0 in a sandbox CODEX_HOME, profile wiring: the list was swapped from sub/old-a, sub/old-b to sub/new-x, sub/new-y. After a restart, /model listed only the new ones, but the status line still read sub/old-a, as the profile named it. What changed: - provider.Unpicked(id) reports a model the user has since unchecked: the provider has picks, its served models lack the model, and it isn't a decision model. This is the same rule ResolveRoute already applies to routing groups (#3911). - agent.pickedInstead moves such a model to the first model of that provider that magpie lists for the agent now. - Codex's Sync calls it before its other model branches, through set, as picking the model does. The profile's Sync calls it through put. The Codex app reads the same config.toml, so it follows too. - Left alone: - a provider with no picks, whose list is the vendor's and may lack the model (#2642); - a provider with none of its models listed any more. Run on mote: - TestCodexLeavesAModelUncheckedInItsProvider (as provider, beside a ChatGPT sign-in, profile) and TestCodexKeepsAModelOfAProviderWithNoPicks; - go test ./internal/agent/ ./internal/provider/; - go vet for darwin, linux and windows on both packages; - gofmt. Result: internal/agent ok (470s). internal/provider is red only on TestHostBuildsNoList (a Gemini provider's Host allocates 5 times), which is #6479 and was already red on main. Broken by hand: with the Codex Sync call disabled, the "as its provider" and "beside the sign-in" subtests are red ("model = sub/old after sub/old was unchecked"). With the profile call disabled, the "by its profile" subtest is red. Not tried: - the fixed magpie with a real Codex; - the Codex app. Not changed, filed as #6504: other agents' model fields, and Codex's subagent and compaction models. |
||
|
|
f4a73672ef |
routing: a ChatGPT API account is weighed by its Codex twin's reading, and its story lines wear its own logo
tmr11235 on X (v0.1.3924): a routing group of two ChatGPT accounts, each
added both as Codex and as ChatGPT API (chatgpt-api). The Codex rows read
their week and reset; the story below said "剩余额度未知,排在已知的之后"
next to the Codex logo, so it read as the Codex rows being unknown.
Two causes, both still on main:
- The story's lines were about the ChatGPT API accounts, but a line
named only an account's name, and logoed() put the logo of the first
member of that name in the order: the Codex twin. asides() now says
which member each line is about (by its place, as two lines may say
the same words), and renderSteps hands it to logoed(), as it did for
a skipped member's line only.
- OpenAI tells a ChatGPT API account's plan usage nowhere magpie can
ask, so Smart weighed it as unknown and put it after every known
account, though it spends the same plan as its Codex twin.
Allowances("chatgpt-api") now gives such an account the Codex
account's allowance (samePlanAllowances), matched as
SamePlanAccounts matches them: both tokens' chatgpt_account_id and
chatgpt_user_id, never the name, so two Team seats of one email stay
apart. One with no Codex twin stays unknown. The Routing card reads
the same figure, as it reads the gateway's.
What was run (GUI on the Linux box through wsl-run, mote over its load
then; Go on mote):
- go test ./internal/provider -run 'TestChatGPTAPIAllowanceIsTheSameAccountsCodexReading|TestRenewedAccountForgetsItsAllowance|SamePlan': ok
- node --test routing-twin-logo (new; chromium and webkit; en, zh,
zh-TW, ja, de; 1100 and 420): 20 of 20 ok.
- Every GUI file that opens the Routing page (199) plus i18n-keys and
i18n-en-no-cjk: 3533 ok, 61 red in 13 files (click-scroll,
ctx-head-narrow, ctx-route-align, ctx-session-line,
inner-scroll-contain, mobile-web, routing-ctx-sessions,
routing-many-keys, routing-pin-away, routing-pulse-composited,
routing-row-swap, routing-sky-under, routing-story-shrinks). The same
13 files at origin/main
|
||
|
|
2f1759c96c |
usage, catalog: the same catalog fetched again keeps the usage index
A Claude account's model list fetches models.dev again every 45 minutes (catalog.Asked), most often to the same bytes. Each fetch rewrote models.json, so its mtime changed, and usage keyed its request index, the index's file on disk (requests-v1.bin, heat, page, effort) and its priced summaries on that mtime: the next usage query dropped every chunk and read every session file again. On the acctp history (15.7k session files) a start that rebuilds takes ~15 s of CPU in its first 30 s, against ~2 s for one that keeps the index. Each fetch also forgot the parsed catalog and told every agent to rewrite its list (catalog.Changed), for nothing changed. - catalog.CacheKey names models.json and labs.json by a hash of their bytes, kept by their stat so a key costs a stat until a file changes. Usage's request meta and price key use it in place of the mtime, as liveListKey already did for the providers' lists. - Sync writes models.json and labs.json only when their bytes changed; the same bytes are dated now (Stale, Missing and Asked read the time), and Reset and Touched run only when either file changed. Tests: TestSameCatalogFetchedAgainChangesNothing (catalog) and TestRequestStateKeptAcrossACatalogFetchedAgain (usage). Broken by hand: with keepFetched always writing, the catalog test is red (told the agents on the same bytes); with usage keyed on statKey again, the usage test is red (meta and price key changed). |
||
|
|
cc42ec1d7e |
agent: an api set by hand in Pi's models.json stays (xiaomanweiman on X)
T3 Code's Pi puts all 71 of its tools into the context on openai-completions and only 3 on openai-responses, loading the rest when asked. The reporter set providers.magpie.api to openai-responses in ~/.pi/agent/models.json, and the next catalog sync wrote openai-completions back. piAPIsKept (pi_api_kept.go), called from piBlockKept (Pi, its forks and Aside), keeps an api the user set for magpie's provider or for one of its models. As with a maxTokens typed by hand (output_kept.go), the stash records the APIs magpie wanted per file (api:<path>:wanted), and an api in the file that is none of them is the user's. A model's keeps its baseUrl and compat with it. With no record yet, the provider's is taken as openai-completions, the only value magpie ever wrote there, so a file edited before this release keeps the user's value on its first sync. An api the file lacks is magpie's. A Chat model left on a provider the user put on Responses gets compat.supportsStrictMode, as magpie's own Responses models have it (#3055). magpie's default is unchanged: a model whose provider speaks Chat stays on Chat, relayed as Pi sent it, and no setting was added. Run (mote): go test -count=1 ./internal/agent/ ok (322s); go vet ./internal/agent/ for darwin, GOOS=linux and GOOS=windows; gofmt -l clean. TestPiKeepsAnAPISetByHand covers a value set before any record, set back by hand, a model's api with its baseUrl, and one taken out. Broken by hand: with the piAPIsKept call commented out the test goes red ("provider api = openai-completions, want the user's openai-responses"). Not tried: a real Pi or T3 Code (neither is installed here); the full suite runs after the push. |
||
|
|
37e3d4d45f |
LESSONS: a95a7a1cd is the ninth core budget raise on 11-13
+397 for per-key price rates; the day is now +3,028 bytes. Docs only; nothing run. |
||
|
|
5d54a990d4 |
usage: switched-off providers' accounts can be checked in, and Check in all (wxkwxk666 on X)
wxkwxk666 asked for two things on the Usage page. First, a provider switched off should still show its accounts, at the bottom and folded, so they can still be checked in each day. Second, one button should check in every account at once. - provider.OffCheckins (off_checkins.go) lists every account a checkiner reaches whose provider is switched off (Off, not Hidden). Each is a card with no windows. Nothing is read or asked for it. Its check-in result is matched by its own key, not by its name, since two sign-ins can share a name (plugins#254). GET /api/usage/checkins/off serves the list. - The Usage page (plugins/usage) adds a "Switched off · n" line after the cards and the hidden line. It is folded until clicked. Each account shows today's check-in, and a Check in button when it isn't checked in yet. The button uses checkinnow.js's ciNowSend, which POSTs /api/usage/checkin-account. - Check in all, at the head of the allowances, presses every account not checked in today, from the cards and from the switched-off line. It sends one checkin-account request per account, three at a time, shows "Checking in i/n…", then gives the counts (checkinPressSaid). When no account is due, it says so and sends nothing. - Nothing switches a provider back on. The new strings are in zh, zh-TW, ja and de. Plugin files only: app.js is unchanged. - docs/subsystems/provider-plugins.md says all of this. Run, on mote: - TestOffCheckinsListsSwitchedOffAccounts, in the fakeco plugin sandbox: - nothing is listed before the switch-off; - after it, two cards with distinct keys; - a press on one checks in exactly that account; - the provider stays off; - only the pressed card carries a result; - nothing is listed once the provider is switched on. - go test ./internal/provider ./internal/gui, at this commit on origin/main |
||
|
|
0fda3a1c12 |
cli: provider set resolve.<host>=…, the editor's Connect to from the CLI (quantum_lsfc on X)
v0.1.4012 added Advanced › Connect to (Provider.Resolve) in the GUI
only; the reporter asked for it from the CLI. `magpie provider set <id>
resolve.<host>=<IP or dns:name>[,…]` sets a host's connect addresses,
an empty value takes the host out, and `resolve=` clears them all (any
other resolve= value is refused, never saved). provider.Save checks
them as the GUI's do (netproxy.CheckResolve, TakesResolve), so a bad
place or a vendor's own host is refused with nothing written. `magpie
provider <id>` lists them as "connect". Usage and docs/reference.md say
how.
Run on mote: go test -count=1 ./internal/cli ok (166s);
TestProviderSetResolve ok; go vet ./internal/cli for darwin, linux
(-tags nogui) and windows ok; gofmt -l clean. A nogui build in a
sandbox HOME on mote: provider add + set resolve.api.corp.example=
10.0.0.5,dns:gw.corp.example saved and shown as connect; resolve=oops
and a bad place refused; resolve= cleared it; provider set --help
printed usage.
Broken by hand: not deleting the host on an empty value, and taking a
non-empty resolve=, each turn TestProviderSetResolve red.
Rebased on origin/main
|
||
|
|
a4cd61f77f |
claude: a turn refused for the account's limit keeps its session till the reset (#6292)
A Claude subscription turn refused for the 5-hour limit before any reply (429) ended its run through relay's abort, and the conversation's native session went with it. After the reset the turn was told whole to a new Claude Code: 354,900 tokens written to the cache again (recih). Now relay's abort is told the status and words (relayFailing); on a 429 keepForReset shelves a copy of the session cut before the refused turn (no user line, no synthetic error line), under the turn's key. Cut at backLine/backMsg for a resumed idle run, or at fromLen (the saved file's length at start) for a run started from a saved session that has answered nothing, so a turn refused again while still limited is kept again. It waits until the reset the refusal names, else the account's used-up window's reset from the rate_limit_event (KeptClaudeLimits), else 5h; plus 1h, at least idleLongest, at most longestQuota (8d). until goes into claude-shelf.json, so the entry survives a restart. Shelf still capped at shelfMost. Run (on mica; mote was over its cores): - go test -tags nogui ./internal/gateway/ -run 'Claude|Shelf|Relay|Bridge|Subscription': ok 93s - new TestClaudeTurnRefusedForTheLimitKeepsItsSessionTillTheReset (print and interactive: two refusals, restart, then --resume of the cut session told the turn alone) and TestQuotaShelfFor: ok - GOOS=linux and GOOS=windows go vet ./internal/gateway/: ok; gofmt clean Broken by hand, each red: - keepForReset call removed: "try 1: no session kept" - fromLen forced to 0: "try 2: no session kept" - fromLen cut at the file's end (refused turn kept): "try 2: the kept session isn't the conversation before the refused turn" Not tried: a real account hitting its real 5-hour limit; Claude's "resets 9pm" text is still not parsed by resetsAt (the rate_limit_event's resetsAt covers it). The full suite runs after the push. |
||
|
|
9572a2b4cc |
LESSONS: three more core budget raises on 11-13, eight in all
|
||
|
|
a95a7a1cd8 |
providers: each API key can bill at a price rate of its own (tnt12231 on X)
A relay sells keys in groups that bill at different rates against the
official price (0.5x on one, 1.2x on another) under one endpoint, and
magpie had only the provider's price rate. Now a key can have its own:
- provider.KeyPriceRates, keyed by key id like KeySpendCaps: cloned,
normalized on save, carried when a key is replaced. A key without one
bills at the provider's PriceRate. A price the user set for a model
stands as set, as it does under the provider's rate.
- Usage prices each call at its key's rate (usage.Pricer memoizes per
key id, BaseKeyPriceIn), so the Usage page, a key's spend cap and its
typed balance follow it. PriceAt, used to route by price, takes the
rate of the key the provider holds.
- GUI: the provider editor's Advanced has "Price rate per key" under
Price rate, shown only with two or more keys, folded past 8 keys like
the per-key proxies. An empty line shows the provider's rate as its
placeholder. Save sends keyPriceRates ({} clears, left out keeps).
The lines, the check and the placeholder live in keyrates.js,
imported when a provider with two or more keys opens. The core's
budget goes up 397 for what is left in app.js (the import, the
draft's copy, Advanced opening for it, the save's line, proxyLines
drawing another kind of line); app.js stays under its own.
- CLI: magpie provider key-rate <id> [key [rate|default]].
- docs/subsystems/providers-accounts.md: a Key price rates row.
Run, at this head (rebased on
|
||
|
|
287a1ffa26 |
gui: Hermes's other profiles are picked on the one Hermes row again (Norethcy on X)
Norethcy on X, v0.1.4022: "Hermes 其他 profile 的配置消失了,只有默认的 Hermes Agent". |