a71aa25d221e95e54d7fb2b34cc4341d058f9fbc
8243
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a71aa25d22 |
routing: a session's Avg. speed says the wait for the first token is left out, and gives the speed with it counted
@verymoes on X (tweet 2121533934332985393): an opencode session over the Command Code plugin read "平均速率 142 token/秒" on Routing's By session row, while CC Switch read ≈77 tok/s for the same 26-27 requests and opencode's footer 76.7 tok/s, and asked whether magpie counts wrong. It doesn't; the three divide by different times. magpie's average is Σ answer tokens over Σ (end − first token) of the timed replies (decodeOf; for a reply that reasoned, its answer from its first text), so the wait for the first token is left out. CC Switch's "≈" is its estimate from the session log's timestamps, which it documents as counting the wait for the first token (src/components/usage/format.ts, docs/user-manual 4.4). opencode's footer is one turn, not the session, and counted from the request until #63321 (11-11) moved it to the first streamed token, with reasoning tokens added in. With a ~28K-token prompt each and short agent replies, the wait is about half of a request's time, which is the gap. Nothing in the measurement is wrong, so it isn't changed; the tooltip now says what it measures: - "the time from each reply's first token to its end; the wait for the first token, and replies without usable timing, are left out" in place of "total decode time; excludes waiting"; - a line with the same timed replies over their whole time, the wait and the reasoning counted ("Over each request's whole time ...: N tok/s"), the number a tool that times the whole request reads. In zh, zh-TW, ja and de. The Usage page's speeds and a row's own speed already say "from its first token to its end". routing-request-metrics checks the tooltip's wording and its whole-time number (4,000 tokens over 82 s, 49 tok/s, beside the 133 average) in en and zh, both engines. Run on mica at this tree (mote was over its 18 cores): - node --test, Chromium then WebKit: routing-request-metrics, reasoning-speed, routing-burst-speed, routing-speed-first, routing-row-floor-speed, routing-sessions, routing-by-key, routing-session-title, i18n-keys, gui-ja, gui-de, gui-zh-tw. Chromium 191/191; WebKit 101/102, the one red reasoning-speed's cut-off fetch (#1350), fixed in the commit before this. - Broken by hand: the test against the old client.js and i18n.js is red in all four (chromium/webkit × en/zh) at "the tooltip says the wait for the first token is left out". No Go code changed. Not tried with the reporter's data: their session isn't on this machine, and the owner's Command Code account answers 401. |
||
|
|
ee4a4c7432 |
gui tests: reasoning-speed leaves WebKit's cut-off fetch out of its page errors (#1350)
The test goes from Routing to Usage, and WebKit reports the Routing
page's /api/gateway/session-titles fetch that the goto cuts off as a
page error ("... due to access control checks"), though the page
catches it. webkit zh-TW and zh went red that way in 2 of 7 runs on
mica. The filter is the one builtin-places, checkin-account and
checkin-at already use for #1350.
Run on mica: BROWSER=webkit node --test reasoning-speed 4 times, and
both engines once after it (results in the next commit's record).
|
||
|
|
683265e867 |
gateway: spawn_agent names every model in Codex 0.169's Lite and catalog requests
@m0eaki on X (Codex 0.169): spawn_agent listed only Codex's first five models, though a remote magpie's model could be spawned by its full slug. In Codex 0.169 a lead on one of OpenAI's own models (the Codex App's default) sends Lite requests (use_responses_lite), with no top-level tools: in multi-agent V2 spawn_agent sits in an additional_tools input item, and with features.model_catalog_in_context the models are in a <model_catalog> developer message, spawn_agent pointing there. magpie widened only tools and tool_search_output, so neither was reached. spawnAgentModels now widens additional_tools like a tool_search_output, and adds the rest of the catalog to a <model_catalog> listing ahead of its closing tag, under the same neutral spawnMore line (no magpie, Codex or count named). The listing is found escaped too (<model_catalog>): on CodexPath a followed or moved subagent's body goes through withModel, whose encoder escapes angle brackets, before spawnAgentModels sees it. Fixtures are real Codex 0.169.0 captures (second request of a turn, sandbox CODEX_HOME, gpt-5.6-luna): V2 Lite, model_catalog_in_context, Lite with a tool search, and a plain tool search. TestSpawnAgentNamesEveryModelInCodex0169 posts each at CodexPath with a lead on OpenAI's model, and calls spawnAgentModels with a lead on magpie's at CodexPath and /v1, the body as Codex wrote it and as withModel writes it again. Sibling left alone, filed: #6639 (a Lite request reshaped for a provider that takes neither Lite's items nor a tool search drops the tools its lead searched for). Run: - Old codex_spawn_models.go: V2 and model_catalog red on all 5 routes each (10 subtests); the two tool-search shapes passed before too. - Broken by hand: hasSpawnCatalog matching only the raw form: the three escaped-body model_catalog subtests go red. Restored, green. - gofmt -l clean. go vet ./internal/gateway and GOOS=windows go vet ./internal/gateway (./... needs Wails' cgo, which the VM lacks), and go test ./internal/gateway -count=1 -timeout 45m: vet clean, gateway ok (861s), at base |
||
|
|
69946f43c4 |
cli: POST /api/page-away is named as the window's own, so the route parity test is green
|
||
|
|
81825ed81d |
agent: fx gets each model's reasoning levels through magpie (@beillusyn on X)
fx through magpie had no effort to pick: magpie wrote its models into
fx's settings without levels, so fx sent no reasoning_effort and every
model ran at its vendor's default.
fx 0.0.17 reads a model's reasoning_efforts in model_metadata (level
name to request fields, listed in /effort and Ctrl+T). magpie now writes
each model's catalog levels there, weakest first, each asked as
{"reasoning_effort": <level>}. Levels fx refuses are left out: auto,
adaptive, default (its word for "none picked"), names outside
[A-Za-z0-9._-]{1,64}, duplicates, and past 16 a model. With no level
picked fx sends none and the vendor's default applies, as before.
fx 0.0.16 refuses an unknown model_metadata key (UnknownField) and with
it the whole settings file, so the levels are written only when fx at
the place says 0.0.17 or later (~/.local/bin/fx, else fx on PATH; a
version not 0.x is the JSON viewer also named fx). An unknown version
gets no levels, and a sync after fx is upgraded writes them. fx's own
effort setting (top level and per workspace) is the user's and stays.
Left alone: fx inside a WSL distro has no version probe, so it gets no
levels (#6636).
Run:
- go test ./internal/agent -run 'TestFx|TestWSL' on mica: ok.
TestFxEfforts (exact ordered JSON at 0.0.17, the user's effort and
workspace effort kept, levels gone at 0.0.16 and unknown, back at
0.0.18), TestFxEffortNames, TestFxVersionIsTheAgents.
- Broken by hand, each red: fxTakesEfforts always true (TestFxEfforts),
no 0.x check (TestFxVersionIsTheAgents), a sorted map for the levels
(the order checks).
- Real fx on mica, sandbox HOME, magpie-written settings, a fake chat
completions server: fx 0.0.17 dev (3c8fab37) --effort high sent
reasoning_effort high; no effort sent none; --effort xhigh on a model
without it said so and sent none; --effort none sent "none". fx 0.0.16
with the levels failed with UnknownField; without them it worked.
fxVersion read the real binaries as "0.0.17" (takes levels) and
"0.0.16" (doesn't).
- Full suite on mote (mica out of disk) at
|
||
|
|
75f872ef19 |
sessions: a page gone from view lets the parsed session files go in 30 s, not 3 minutes
v0.1.4150's away timer let the Sessions stats and the Requests chunks go 30 s after the app's page went from view, but a web page open 70 s and closed still held 92-93 MB 45 and 90 s on. A heap taken 45 s after the close (liveHeap 57 MB, 15 MB at +180 s) showed why: opening the page starts the warm-up (warmStart), which parses every session file, and those parses (decodeCache, the listings, Codex identities: ~40 MB live for the acctp history) go only by the sessions package's own cacheIdle, 3 minutes after their last read. forgetAwayPage now also calls sessions.ForgetParses, which is dropIdleCache without the 3-minute wait (dropCache(0)): it still keeps the parses while a save isn't on disk, the last failed, or a file is being parsed, and the next read has them back from sessions.json with no session file read. It runs only when the stats went too, so a range being read keeps them. Test: TestForgetParsesLetsGoAtOnce (red with ForgetParses waiting cacheIdle, broken by hand). Measured on mote (pageclose2.sh, acctp, page open 70 s and closed, footprint-overlay build like the release): v0.1.4150 (w90): close 122 MB, +45 s 93, +90 s 90, +180 s 55, +600 s 52 this (w92): close 125 MB, +45 s 64, +90 s 61, +180 s 56, +600 s 53 A debug build (w91) logged the away timer firing with no read since, so the 90 MB left was this cache, not a skipped let-go. Run: go test ./internal/sessions ./internal/gui ./internal/usage on mote (ok); GOOS=linux go vet -tags nogui and GOOS=windows go vet of the two packages (ok). |
||
|
|
3932d01acf |
provider: ZCode's mover min is 0.1.64, which queues a Start Plan request refused beside the account's others (JJLIN070414 on X)
Two sessions on ZCode's Start Plan showed 429s: an account ZCode serves one at a time refused the second request (3008), and the plugin handed it back after its 1s and 2s re-asks. 0.1.64 (plugins 8e19b6a0) narrows the account's gate and requeues that request until the other ends, as ZCode's own client queues a capped request. The min makes keepMovedCurrent update every moved user; it also carries 0.1.62 and 0.1.63 (plugins 3f37b858). Run: npm view --prefer-online shows 0.1.64; on mica, go test -tags nogui -run 'Moved|Mover|Migrat|ZCode' ./internal/provider ok; gofmt clean. Plugin: packages/zcode bun test 262 pass, 0 fail; the three requeue tests red with the requeue turned off. Not tried: a full go test ./... before the tag, a real Start Plan account with two sessions. |
||
|
|
b592c1fde1 |
masking: the page counts each agent's requests looked over, nothing masked in them or not
eiyuuzaki2333 on X: the Gateway page showed Pi's calls, the Masking page records from dsh alone, and nothing said whether Pi's requests were masked. They were: a Pi turn goes through the same masking as every agent's, on each API Pi uses (chat completions, responses, messages), with no agent or protocol scoping. But a record is made only for a request masking changed (noteMasked: hits or held values), and the page's agents came from records alone, so an agent whose requests carried nothing to mask didn't appear at all, the same as one never masked. Now, while masking is on for a request (redactionWantedFor, a key's own switch included), the gateway counts it under its agent (maskrec.Checked): looked over, and whether masking changed something, or sent as written to a model the user set to go unmasked. The counts hold no text: a small checked-<day>.json beside the day's records, written over through temp and rename at most every 5 s, read back after a restart, pruned at 30 days with the records and removed by Clear records. /api/masking/summary returns them as checked. Counted where a turn's masking is decided: serve (every routed chat turn, plugins and groups included), Codex's own sign-in's /responses turn, and the native API passthroughs (nativeArk, nativeAny). Not counted: searches, images, video, embeddings, System One's decisions and Codex's compactions, which are not an agent's turn; they keep their records as before. The Masking page's card lists each agent under the flow: "Pi · 128 checked · none to mask · 3 sent as written". A click narrows the list to it; the agent picker lists checked agents too; and a list with no records says "128 requests from Pi checked, and none carried anything to mask" instead of "Nothing masked matches these filters". Strings in zh, zh-TW, ja and de. Run (code at this head; first at base |
||
|
|
d987cc7d5a |
provider: Devin's mover min is 0.1.41, which sends a Gemini reply's thought signature back
devin 0.1.41 (magpie-community/plugins 191d94bf) puts a Gemini model's
thought signature, signature_type "gemini" and the model that wrote it on
the next request's assistant prompt, as the devin CLI sends it. The
plugin had dropped Gemini signatures, so Gemini 4 Hydrogen lost its
thoughts on every tool turn (liuzhengdong99 on X: 502 empty replies and
long waits in DSH). keepMovedCurrent brings every moved user to it.
Run: go test ./internal/provider/ on mote at this head (rebased on
|
||
|
|
8334f1e6e0 |
lessons: 11-14 a sixth budget raise; 11ddf076b ran chosen packages and left the eager-regexp guard red
|
||
|
|
c41fa8e478 |
sessions: an OpenMausBot conversation can be shown (@qingqingdilaiP on X)
@qingqingdilaiP's OpenMausBot rows in Usage → Sessions ( |
||
|
|
80a315a70a |
gui: a closed or hidden page lets its Sessions and Usage caches go in 30 s
What a visit to the app's page read stayed until each cache's own idle
timer fired: the Sessions stats after 2 minutes, the Requests chunks
trimmed at 2 and forgotten 5 after that, each chunk's derived keys at 3.
On a real history (acctp, requests-v1.bin 71.5 MB) a web page open 70 s
and closed held 123 MB at the close, 108 MB a minute on, 74-76 MB three
to five minutes on, and was back to the tray's 52 MB only at ten.
The page now says it has gone from view (POST /api/page-away, sent from
the visibilitychange listener every window already has, when hidden: a
browser fires it as a tab closes, and the Mac window's orderOut
dispatches it too). 30 s later (pageAwayFor), unless a Sessions or Usage read
was in flight or ended since, the stats, overviews and tags go
(letGoStats, split out of forgetIdleStats), the Requests chunks and each
chunk's derived caches go (usage.ForgetPages: trim(0) + dropDerived,
idle timers stopped) and the pages go back to the system. A second tab
still polling, or a tab looked away from for under 30 s, keeps them. The
beacon writes nothing, so held's provider.Changed passes it by. The panel
sends it as well when it hides; it reads no Sessions or Usage page, so
there is nothing of its own to keep.
Tests: TestPageAwayLetsStatsGo (red with the forget skipped, and red
when a read after the beacon is ignored, both broken by hand) and
TestForgetPagesLetsChunksGoAtOnce.
The core script budget goes up 83 bytes, with the reason in its
comment: the beacon is folded into the existing listener and packed to
its shortest form (335 over as first written, with a pagehide listener
and a panel check).
Measured on mote (pageclose2.sh, the acctp history, a web page open
70 s and closed, footprint-overlay build like the release):
before (w88): close 123 MB, +60 s 108, +180 s 76, +300 s 74, +600 s 52;
peak 154
after (w89): close 123 MB, +45 s 92, +90 s 90, +180 s 54, +600 s 53;
peak 149, 3.08 s CPU over 11 min
final (w90, visibilitychange only): close 122 MB, +45 s 93, +90 s 90,
+180 s 55, +600 s 52; peak 152
Run: go test ./internal/gui ./internal/usage on mote (ok);
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./... (ok);
16 visibility GUI files + i18n-keys in chromium and webkit: red only in
routing-pin-away (the same subtest red alone at origin/main
|
||
|
|
09aa60d4ae |
gateway: a test that Claude Code on a Codex account is asked as Codex asks
qingchen060106 on X: gpt-6-astra (Codex account) seemed to spend the
plan faster from Claude Code than from Codex. Their screenshot: Claude
Code, astra high, 1 subagent: input 121K, cache read 1.6M, output 12.1K,
~$3.44; Codex, 4 messages: input 58.0K, cache 213K, output 2.4K, ~$0.915.
Checked the Messages -> Responses translation against Codex 0.162's
request (testdata/workdir/codex-0.162.0.json) with Claude Code 2.1.296's
own request (testdata/workdir/claude-code-2.1.296.json) through a fake
ChatGPT backend. No gap:
- prompt_cache_key is the same on every turn, and session-id/thread-id
carry it, as Codex sends them;
- effort goes as picked (output_config high -> reasoning.effort high);
- the step's encrypted_content reasoning goes back before its call
(carried in the call id, reasoning_carry.go);
- the system prompt and the 23 tools go once each, the billing line is
cut, and nothing else is added to the input; turn 1's items are
turn 2's prefix byte for byte.
What accounts for the difference: the fixed prompt per call is ~24.5K
tokens for Claude Code (o200k: instructions 4.1K, Claude Code's 23 tool
schemas 16.8K, input 3.6K) against ~13.0K for Codex (tools 4.0K), and
the session made several times as many calls (1.72M prompt tokens read
against 271K). Cache hits were higher through magpie (93% vs 79%). At
$10 in / $1 cached / $50 out both screenshots' costs come out as shown
(1.21 + 1.60 + 0.61; 0.58 + 0.21 + 0.12).
This adds TestClaudeCodeOnCodexSpendsAsCodex, which holds all of the
above: no test covered a Codex account's sealed reasoning through
Claude Code (only Grok's).
Run (on mica, at
|
||
|
|
05d25d8dcb |
provider: the Qwen sign-in's status words are compiled when first read (TestNoEagerPackageRegexps)
|
||
|
|
0fa221b6ec |
vision: a describer whose every account has to sign in again is not magpie's first pick
@freefcw on X (tweet 2121512865970737221): images sent to Grok's
grok-4.7-build-fast were described by Claude Haiku, whose sign-in had
expired, and the request failed. AutoVision ranked describers by
allowance (spentModel: quota and credit rests, full windows) and then
by tier, a Claude account first, and never asked whether the account
could be used at all. A Claude sign-in Anthropic refused stayed the
first pick, ready, for every image.
smallReadyOf now calls a model not ready when every account of its
provider in use has to be signed in again (provider.SignInNeeded, the
same test the Providers page and the sign-in alerts use: needsSignIn).
Such a model gives way to any other model that sees. When nothing else
sees, it is still named, as a pick out of allowance is (#1801), so
agents are still told images are described. Every small-model pick
goes through smallReadyOf (the searcher and the decide model as well
as vision), so they all skip a signed-out account the same way.
The other half of the report doesn't reproduce: grok-4.7-build-fast
reads as seeing. The Grok plugin has declared input.image for every
model since its first version (0.2.7 now). On the live 0.1.4131 the
model's entry says image:true/imageSaid:true. With the owner's real
Grok account, Chat Completions and Responses images (including a
function_call_output image, Codex's view_image shape) reached Grok
undescribed and were answered. Grok's image refusals (invalid_image
for gif/tiff/heic, more than 26214400 bytes, an unresolvable URL, and
a 422 for a missing image_url) don't match imageRefusedWords, so none
of them marks the model blind. That was checked with a throwaway test
and not committed.
Run (mote, at 1a8fc99f4 = this commit plus the Qwen lazyre fix, on
origin/main 07a62b373; rebased after onto two lessons-only commits):
gofmt -l: clean
go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./...: ok
go test -timeout 45m ./...: every package ok (EXIT=0)
An earlier full run at 039025ac6 was red only in
TestNoEagerPackageRegexps (qianwen_plan.go, from
|
||
|
|
4739ec92cc | lessons: the counts of the 11-14 no-green stretch, measured (81 commits, 51 releases) | ||
|
|
5e7ce5d91d | lessons: 11-14 a fifth budget raise; 11 hours with no Test run finished green | ||
|
|
07a62b3739 |
providers: Copy all keys, and magpie provider keys, carry a provider's keys to another magpie
@emilochen on X asked to batch-export one provider's keys, to sync them between a local and a cloud magpie. Each key row could copy only its own key (#1480), and nothing printed them all. - A provider with two or more keys gets a "Copy all N keys" row under Add another key. It asks provider/key with allKeys (provider.AllKeys: the main key and every listed key, deduplicated, turned-off ones too) and copies them one a line, for the other magpie's Paste several (keys/import). The secret goes only to the clipboard on the click, through the page's copy(); nothing logs it, and the route sits behind the GUI API's existing local/origin guards. A signed-in account has no keys and is refused. - The row is drawn by keyrates.js (copyAllKeysRow), already imported when a provider with two or more keys opens; keyRateField now takes which of its parts to draw. It has its own class, keys-copy-all, not .add, since ~21 GUI tests take .acc.add as the one adding row. TestCoreScriptBudget's core budget goes up by the 72 bytes left in app.js (the placing line and the helper's new argument); app.js stays under its own budget. - CLI: `magpie provider keys <id>` prints the keys one a line; `magpie provider keys <id> add [key… | -]` adds them from words or stdin (SplitKeys + AddKeys), so `magpie provider keys relay | ssh cloud magpie provider keys relay add` works. A word starting with "-" is refused, never taken as a key. - Strings in en, zh, zh-TW, ja, de. Related: #5387 (sharing saved providers through magpie:// links), not closed by this. Run on mote (mote-run) at this tree on |
||
|
|
debc80271f |
lessons: 11-14 a fourth budget raise; vendored yaml.v3 left a guard red (fc75d90af)
|
||
|
|
11ddf076b4 |
usage: a Qwen AI platform Token Plan is read through a sign-in to the platform (@imthe99galaxy on X, #5829)
On v0.1.4137 a provider on the Qwen AI platform's Token Plan
(qwen-token-plan, token-plan.maas.qianwenaiapi.com) had no quota card at
all. The plan key (sk-sp-) only authorizes inference; the platform tells
the plan's usage only to a sign-in on the platform, and magpie had none.
Now each such provider can sign in to the platform, as the QianWen CLI
1.10.0 does (qianwen_plan.go, UA qianwen-cli/1.10.0):
- a device sign-in with PKCE S256 at t.qianwenai.com/cli/device/code and
/cli/device/token, approved in the user's browser; the editor's
"Sign in to the Qwen AI platform" opens the page and waits for it;
- the session is the provider's own, kept by provider id in
qianwen-auth.json (0600), moved on Rename and dropped on Delete;
- cli.qianwenai.com/data/v2/api.json (GenerateCLIAccessToken) mints a
console token, kept and minted once more when the gateway answers
NotLogined; ConsoleNeedLogin or a fresh token refused signs it out;
- the usage is the Alibaba Token Plan's BroadScopeAspnGateway call at
cs-data.qianwenai.com with consoleSite QIANWENAI, region cn-beijing,
read by the shared aliAskUsage/aliReadWindows (alibaba_usage.go now
takes the console per call). The sk-sp- key is never sent there.
- Plan windows (planquota.go) and routing's key allowance
(key_allowance.go, keyTag "qianwen") read it; not signed in, the card
says so with Open settings (NeedsAccessKey).
- GUI routes /api/qianwen/{id}/signin (POST start, GET state),
/signin/cancel, /signout; the editor's field lives in qianwenplan.js,
imported when such a provider's editor opens. The core script budget
is raised by 326 for the import and one quotaError line (its reason in
core_budget_test.go). The routes are in the CLI parity's notYet, as
StepFun's are.
Run, on mote at the base
|
||
|
|
fc75d90af7 |
yaml.v3: its two regexps are compiled on first use, not at launch
|
||
|
|
b507b5f692 |
sessions: OpenMausBot's conversations are read (@qingqingdilaiP on X)
@qingqingdilaiP asked for OpenMausBot's sessions in Sessions. OpenMausBot (milind-soni/OpenMausBot, npm 0.1.155) is already an agent in magpie, but its conversations were not read. It keeps its data in $OMB_DATA_DIR, else ~/.openmausbot on every system (server/config.ts): - bots.json: bots[].tasks[], one a conversation (threadId, title, "New thread" until named, and cwd once a turn pins it); - messages.db: SQLite in WAL mode (thread_id, at ms, role user|bot, kind text|activity|..., text, json; an activity's json holds tool.name, a bot text its turnId); - usage/<YYYY-MM>.jsonl: one row a turn (driverKind, model, input with cachedInput and cacheWrite included, output). internal/sessions/openmausbot.go lists each conversation as a read-only session, like Alma's and Hermes's rows: prompts, one reply a turn (a turn says a line before a tool and again after it), tools by name, title from bots.json (else the first prompt), folder from task.cwd, times from messages and usage rows. A conversation holding only a bot's greeting is left out. Its rev joins the thread's count, last time, bytes, usage rows, title and cwd, so a write to it, or a new title, reads it again while the database file looks the same. Tokens count only for API drivers (server/agents-bridge-switch.ts's CHAT_RUNTIME_DRIVERS): a bot on Claude Code, Codex, Pi or another agent CLI runs that CLI, which keeps the turn in its own session, so its tokens are counted there and would be counted twice. Fresh input is input less cache reads and writes. bots.json and the usage files are read again only when their size or time change. Dirs() and Reads/access cover messages.db. Delete refuses it: OpenMausBot keeps the database open. Tests (testdata/openmausbot is OpenMausBot 0.1.155's own data folder, written by the real app in a sandbox on mica with an OpenAI-compatible fake model, database checkpointed): - TestOpenMausBotSessions: titles, tokens, times, greeting-only threads left out, the Sessions page (2 rows, not deletable, 4 and 2 messages), Delete refused, stats (1 prompt, 1 reply, agents_list_bots once), Dirs(), the database's bytes unchanged. - TestOpenMausBotCountsCLITurnsOnce: the sample's rows with one turn on claudeAgent and one with cache read and write, cwd pinned. - TestOpenMausBotReadAgainWhenItChanges: a new title alone, then a new row with the file's time held. - skillsCounted: openmausbot says why its skills are not counted (a bot reads a SKILL.md with its file tools, and the sample has no such turn). Broken by hand, each red: CLI rows counted (claude tokens 1202/42), no turnId dedupe (team 3 messages, 2 replies), no rev check and title ignored (new title not read), cache left in fresh input (1203), greeting threads listed (4 rows). Run: gofmt -l clean. On mote (load ~20 on 18 cores, mica busier with a GUI run): go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go test -count=1 -timeout 45m ./... at 59c5b59ea (this and the yaml.v3 commit on |
||
|
|
79a30eb9cc |
perf: the remote-magpie follower reads providers.json's kept parse
KeepRemoteListsFollowed looks every minute (and on each write) for the Remote magpies to follow, and followedMagpies parsed the whole of providers.json again for it and normalized every provider in it. It now reads storedFile, the parse kept until the file changes, and normalizes only a provider that has an Anthropic address; what it returns is still each provider's own normalized copy. In the tray-only profile this was 3 MB of the 11 MB providers.json decoding allocated over seven minutes. Run: go test -race -run 'Follow|Remote' ./internal/provider on mote, then the whole package. |
||
|
|
c8d47121b4 |
perf: a TOML key's dotted name is built in one reused buffer
parseTOMLSource made a string for each part of every key, a second one for its raw text, two slices to hold them, then joined them: several allocations a key, over Codex's ~11k trusted projects on each parse of its config. Each name is now appended into a buffer every expression reuses and copied out once. Run: go test ./internal/edit ./internal/provider on mote; agent, library, sessions and cli on mica; tray-only real-account run on mote. |
||
|
|
5a02584476 |
perf: a TOML file is parsed from its own bytes, not a joined copy
tomlFileOf split the file into lines, then parseTOMLFile joined the lines back together and converted the result to bytes for the parser: two more copies of the whole file on every parse. Codex's config is 1.5 MB with the ~11k projects it trusts, and it is parsed again each time it changes. parseTOMLSource takes the bytes the caller already holds; parseTOMLFile keeps its signature for the callers that only have lines. Run: go test ./internal/edit on mote; tray-only run with the real Codex account (tray7.sh) on mote, numbers in the release note. |
||
|
|
ea6470cb75 |
gui tests: i18n-keys leaves vendored third_party code out
|
||
|
|
01c3efc4f7 |
library: billion-context's compression markers can be switched off (@JamesYu32 on X)
@JamesYu32 asked for a switch that turns off the markers billion-context adds after it folds: compress.visibilityMarkers. In bili 0.1.213 (CONFIGURATION.md, dist/index.js) it is a boolean, true by default; true appends the 📦/❌ line after a compress, decompress, search_context or acp_status call and re-injects it into the rebuilt history, false drops both, and the tool calls still run. Some models imitate the markers. The billion-context tab's Advanced fold gets "Show compression markers", on unless the file says false. Off writes compress.visibilityMarkers: false through edit.PatchJSON (comments and every other key kept); on takes the key out, back to bili's default, rather than leaving a value magpie chose. A provider's or model's own compress.visibilityMarkers is the user's and is left as it is; a non-boolean value (which bili rejects) is not read as off. The running bili is asked to reload, as for the other settings. Under Advanced because it is rarely changed. Run (mote, at this tree on origin/main |
||
|
|
df2b819c67 |
library: Antigravity and Crush get copies of skills on Windows (#6610, #5107)
On Windows without the right to make a symlink, magpie links a skill with a junction. Go 1.23+ lists a junction as ModeIrregular, neither a folder nor a symlink, and Antigravity (the app and agy: customizations' discoverInSubDirsFiltered) and Crush (internal/skills on fastwalk, which follows only a ModeSymlink) keep only folders and symlinks, so a junctioned skill never showed in them. dsh, pi and the other Node, Bun, Rust and Python agents follow a junction. Checked against the real apps on xiaomi-gpu (Windows 11) in a sandbox USERPROFILE: Antigravity 2.30.0's language_server.exe (--standalone) GetAllSkills lists a skill in a folder and one behind a symlink, not one behind a junction. crush v0.101.0's `crush run` request to a local capture server listed the folder and the symlink, not the junction. On macOS agy 1.5.8 (ACP session/new, available_commands_update) takes a symlink that leads out of ~/.gemini/config, so #6610's "confined to the folder" filter doesn't touch magpie's links there. - junctionBlind (agy, antigravity, crush) and skipsJunctions: on Windows these targets have Copy, so they get marked copies, made again when the library's changes, and the Library page shows "Only ever takes copies" for them. A junction an older magpie made becomes a copy. - inShared: a link in ~/.agents/skills is no skill to them, so Crush, which reads that folder too, gets its own copy. - A project's .agents/skills entry that one of them reads is a copy (syncFolder's per-entry flag); one no such agent reads is a link again. - takeEdits takes an edit made in a project's copy into the library, as one in an agent's copy is, so a copy a user edits isn't undone by the next sync (Project.Copy's copies too, which were made again over an edit before). - behind lists these agents' stale copies. Run: - go vet ./internal/library, GOOS=windows and GOOS=linux go vet, gofmt -l: clean (mote). - go test -count=1 ./internal/library: ok on mote (macOS) 107.9s and on xiaomi-gpu (Windows 11) 440.0s, at this change on |
||
|
|
8e1d3095a2 |
lessons: 11-14 yaml.v3 vendored for an allocation cut (0caa09b3d)
The review diffed third_party/yaml.v3 against gopkg.in/yaml.v3 v3.0.1 after gofmt: only the 7-line emitter change differs. Docs only; no code run. |
||
|
|
be7d22edda |
gateway: a pi 1.x run of the Claude bridge starts in pi's own folder
fysly on X: a Pi turn on a Claude subscription told the model two working directories, Pi's own and magpie's shared work folder under /private/var/ folders (magpie-claude-work-<uid>), where the bridge's Claude Code ran. Pi 1.x states its folder as a system prompt section with the path on a line of its own, "<cwd>\n/x\n</cwd>" (buildSystemPromptSections, joined by getSystemMessageText). clientSaidWorkDir and clientTurnWorkDir read <cwd> only on one line, as Codex writes it, so clientWorkDir found no folder and the run started in the shared folder: Claude Code's own environment then named that folder beside Pi's <cwd>. The folder rules' reader (workDirIn) already allowed whitespace inside <cwd>; the bridge's now does too. Sibling in the same reader: workDirIn decodes the path's &, < and > as entities (Codex escapes them in <cwd>, Claude Code < and >), the bridge's did not, so such a folder failed os.Stat and its run went to the shared folder too. Now decoded the same way. No text of Claude Code's prompt changes: only the folder it runs in, the existing clientWorkDir path for Claude Code, Codex and OpenCode callers (--setting-sources "", no auto memory, CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS). Run (mote, at |
||
|
|
3e38e4ba21 |
antigravity: Codex's GPT-5 line goes reworded in a user's turn too
@daoche_wuzui (X, v0.1.4131, Antigravity Cloak 0.1.7) still got 429s on
Antigravity. Since 11-14, Google answers a bare 429 "Resource has been
exhausted (e.g. check quota)" when either of Codex's identity lines
("You are Codex, an agent based on GPT-5" / "You are Codex, a coding
agent based on GPT-5") is in a user turn. The plugin, the cloak
middleware and the gateway reworded system/developer text only. A
mid-thread developer item becomes a user "<system-reminder>" message in
responses.go, and a pasted AGENTS.md does the same, so the line reached
Google in a user turn as written.
Real account, gemini-3.8-flash, plugin fetch directly:
- each Codex line in a user turn: 429 3/3; reworded "built on GPT-5": 200 3/3
- billing header, Agent SDK, Claude Code, Hermes and RFC lines in a
user turn: 200 3/3 each, so only Codex's two lines are reworded there
- Codex line in the model turn or a functionResponse: 200, left as is
- "You are Codex." alone, "based on GPT-5" alone: 200
So the refusal is about the content, not the account or the model.
Through a sandbox magpie (sandbox HOME, port 3476), plugin 0.1.12 +
cloak 0.1.7, /v1/messages with the line in a user turn: 429 3/3
"Antigravity: Resource has been exhausted". With 0.1.13 + 0.1.8 in place
and the plugin host restarted: 200 3/3. A real Claude Code and a real
Codex request capture still 200 2/2.
- gateway: codeAssistBody rewords Codex's two lines in non-model turns
for an Antigravity account (antigravityCloakMessages), on a copy; Gemini
CLI accounts and prompt=as-written go untouched.
- mover min 0.1.12 -> 0.1.13 (plugins fb7bbebd: plugin 0.1.13, cloak
0.1.8; both in the dist branch's index.json, checked after publish run
43566168677; its npm job is red on middleware-system-prompt only,
plugins#887).
Run on mica at e0f856ec0 (this change on origin/main
|
||
|
|
13cb07fde7 |
codexcat: an OpenAI model is compacted where Codex's own catalog holds it, GPT-6.1 Terra at 500K (@flower__daisy on X)
@flower__daisy: Codex compacts often after connecting to magpie, "don't Codex models have 500k now?". Codex's bundled catalog (rust-v0.165.0 to rust-v0.169.0, models-manager/models.json) gives gpt-6.1-terra a context_window of 500000; every other listed model 272000 (red-latest 372000). Long conversations' default, the working window, told Codex to compact every model with a longer window at 272K, "what OpenAI does with its own models". For GPT-6.1 Terra that is no longer what OpenAI does: - a ChatGPT account's codex/gpt-6.1-terra in magpie, with no entry in Codex's models_cache.json, got context_window 500000 and auto_compact_token_limit 272000; - an OpenAI API key, relay or found auto/ gpt-6.1-terra got models.dev's 922K and 272000. Codex's own entries, passed through beside a ChatGPT sign-in, were already as the backend gave them. codexcat.Working is now Long conversations' threshold, except that at its default an OpenAI model is held to the window official Codex holds it to (OwnWindow: the account's models_cache.json list, else the bundled catalog, matched by longest prefix as Codex does), never above the model's own window. A size the user set (CompactAt, Codex's own Long conversations) and Full window are as they were. Another vendor's model and a routing group keep 272K. A model whose window magpie doesn't know gets the same threshold. The Context tab's advice (tune.go codexWindow) and the Long conversations row (codexWindowUnder) read it too. Tests: - TestBundledWindowsAreCodexOwn: bundledWindows equals the context_window of every model in testdata's rust-v0.166.0 models.json. - TestCodexCatalogHoldsOpenAIModelToCodexWindow: terra on an API key, a dated auto/ id, a 400K relay, codex/ at 500K, a relay with no window; sol, DeepSeek, Claude and a group at 272K; the account's list before the bundled one; CompactAt 300K and Full window as set. Broken by hand: with entriesAt back on work.Working, 6 cases red (codex/gpt-6.1-terra told [500000 272000]). Run (mica, mote over its load): go test ./internal/codexcat; go vet codexcat and gui for darwin, linux (nogui), windows; gofmt -l; go test ./internal/gui -run 'Tune|CodexWindow|Codex.*Window|LongConv|Compact'; then -run 'Codex|Compact|Window|Tune|Catalog|Ultra|Relist' over gateway, provider, agent, gui and codexcat: all ok (gateway 280s). Full suite: queued on mica behind another session's suite.lock, not finished at push (the owner's ship-at-once rule). Not tried: a real Codex 0.169 session running past 272K on GPT-6.1 Terra through magpie. Claude Code and Grok Build keep the 272K working window for every model; no Anthropic or xAI catalog gives an OpenAI model a window of its own. |
||
|
|
0caa09b3d9 |
perf: yaml's event queue, TOMLWithout's buffer and the catalog's hash stop holding whole documents
A start with the owner's real accounts (release build, mote) allocated 279 MB in its first seven minutes; three of the largest were buffers the size of a whole document that nothing needed whole: - yaml.v3's emitter appends every event to a queue it never empties, so encoding dsh's route of a few hundred models held ~24 MB of events (dshPutProviders' Node.Encode and dshNodeLines). That round runs on the first start of each version and on each catalog change. yaml.v3 is vendored in third_party/yaml.v3 (replace in go.mod, as jsonschema is) with the queue started again once it is drained; MAGPIE.md says what changed. go.yaml.in/yaml/v3 v3.0.5 has the same queue. - edit.TOMLWithout made its output as large as the input: 1.5 MB per read of Codex's config, which five readers make, to keep a few KB around the projects tables. It now grows to what is kept. - catalog.fileKey read the ~6 MB catalog whole to hash it; it is now hashed as it is read. Measured with the owner's real accounts (~/r2278/acct, tray only, no window), release ldflags and the footprint overlay, a version new to the HOME so dsh's full round runs, on mote: - allocations in the first 7 minutes 279 MB -> 260 MB; yaml_emitter_emit 24.9 MB -> under pprof's cut (1.3 MB), dshPutProviders 23.1 -> 8.1 MB, dshNodeLines 12 MB -> under the cut, edit.tomlUnder 12.2 -> 4.0 MB - footprint at +300 s 59 -> 58 MB, live heap 5.5 MB both; peak 84 vs 89 MB, within the run-to-run spread seen before (84-88 MB) Run at this tree: upstream yaml.v3's own tests on the patched emitter (go test ., ok); go test ./internal/agent ./internal/cli ./internal/edit ./internal/library ./internal/pluginrt ./internal/catalog on mica (ok), and ./internal/sessions on mote before the yaml change (ok); go vet ./... (mac), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... ok; gofmt -l on the changed files prints nothing. Not run: the full suite. |
||
|
|
73ecef0b36 |
memory: each memory is a Markdown file of its own
memory.json held every memory in one JSON file, which grew without
bound, was hard to read or fix by hand, and was rewritten whole on every
change. Memory is now a folder, `memory/` beside where memory.json was:
- `<id>.md` is the memory: YAML front matter (kind, scope, status,
origin, pinned, tags, why, sources, times) and the text as the body.
The file is the source of truth.
- `meta.json` holds what isn't one memory's: projects, the digest,
dismissed texts, deletions, declined suggestions, when a search last
returned each memory (so a search never rewrites a memory's file), and
the hash of each file as magpie last wrote it.
- `index.json` is a cache of the parsed files by size and mtime only:
deleted or garbled, memory reads the same.
- `journal.json` holds a change to more than one file (a merge, a sync)
before any is written; the next read finishes one cut off halfway.
A file whose hash isn't the one magpie wrote was edited or added by hand:
it is the user's (origin user, Edited), so a tidy leaves it and an
agent's change synced from another computer never writes over it. A file
with no front matter is a global fact named by its file. A write leaves
any file that changed on disk since it was read (a hand edit made
meanwhile), and so does a remove. A file that can't be parsed is left
out and never written over nor removed, sync included; meta.json that
can't be read is unknown (an error), as memory.json was.
memory.json is moved in on the first read, all under one journal, and
kept as memory.json.migrated. One that can't be read is an error and
nothing is written.
The scope of a hand-written file keeps its case (a project's holds a
path); "global" in any case is global.
Ran at this head (rebased on origin/main
|
||
|
|
50d88f17ce |
sessions: the Claude subscription bridge's own runs are not local sessions
iwinux on X: a Pi request through a group a Claude subscription serves was listed twice in the request log, once as "Pi · Claude Code" and once as "Claude Code · Local session", with the same tokens and cost. Cause: a bridge run is the real Claude Code. It saves its session in the account's projects folder, in the caller's folder's project: the user's own ~/.claude or a saved account's claude-accounts folder, both of which appdir.ClaudeHomes lists. listCCFiles read it as a session of the user's, and the ledger's pairing (request id, then session and tokens) didn't match it with the gateway's record, whose session is the caller's. So every call was counted twice: request log, usage ledger, cost totals, the Sessions page. -p runs and interactive (TUI) runs alike, plus a branch's cut copy and a replayed transcript. Fix: every session a bridge run saves is named by the new internal/bridgesid. New is a version 4 UUID whose last six bytes are a keyed SHA-256 of its first ten, the key a random file of this computer's (<config>/claude-bridge-session-key, made once by temp file + link). To Anthropic, which Claude Code sends the session id to, it is as random as any, so it marks nothing upstream. startRun passes --session-id for a new run (-p and interactive; the TUI helper keeps a --session-id it is given and makes a marked one otherwise), replaySession and cutSessionWhere name their files with it. listCCFiles leaves out a .jsonl, and a session's sub-agent folder, whose id bridgesid.Is knows, for agent "claude" only. That one listing feeds calls, the ledger, the request log, Sessions, traces and WSL distros, so all of them drop the double count. Other bridged runs (warm-up, askClaude, /usage, WSL -p) use --no-session-persistence and write no session. Rows already counted twice: a bridge session already removed (a run's session is removed when it ends) is gone from the ledger already, as it is read from the files there are. One still on disk under an old random id (a live or shelved run resumed under it, or a stopped gateway's leftover in a caller's folder) can't be told from the user's and stays counted until it is removed; old ids carry no mark to fix it on read. Tests: TestNewIsKnown, TestKeyKept, TestKeyMadeOnce (bridgesid); TestBridgeSessionsAreNotLocal (sessions: a marked session in the user's folder, its sub-agent file, and one in a saved account's folder give no calls and no rows; the user's session beside them counts); TestClaudeRunSessionsAreTheBridges (-p and interactive, a new run and a replayed transcript) and TestClaudeCutSessionIsTheBridges (gateway). Broken by hand, on mica: bridged() returning false made TestBridgeSessionsAreNotLocal red (calls req_m1..m4, want req_m1 alone); newUUID back in startRun, replaySession and cutSessionWhere made both gateway tests red (print, interactive and the cut copy). Run on mica at this head (rebased on |
||
|
|
7ea1e6a4b3 |
usage: the tray panel and the TUI leave out what the Usage page hides
onkashiko on X: a provider whose allowance card was hidden in the main
window (Usage > Overview, "Hide from Overview") still showed in the menu
bar's panel. The panel's Allowances tab had only its own Arrange list
(panelUsageHidden) and read the full cards.
Now the panel leaves out a card whose cardHideKey is in usageCardsHidden
and the rows in usageWindowsHidden (withoutHiddenRows), as Overview does;
a menu bar cell's card still shows (panelPeek). A subscription whose
every card the page hides counts in the foot's "{n} hidden" and shows as
hidden in Arrange; Show there
also drops its keys from usageCardsHidden, since the panel follows the
page. All of it is panelPageCut in the Usage plugin's page.js, which every
window loads, so the core scripts get no bigger (TestCoreScriptBudget
unchanged). Hiding from the panel alone still leaves the page as it is. The
panel reads settings again each time it is shown (loadBack), so a hide or
unhide in the main window reaches it with no restart.
Siblings: magpie tui's Usage page leaves out the same cards and rows
(usageShown, read at every quota read). The menu bar's cells and tooltip
show only the cards picked in Settings, so they keep a hidden card as
before; routing, caps and counting are unchanged.
Run:
- panel-page-hidden.test.cjs (new): chromium + webkit, en/zh/zh-TW/ja/de,
10/10 green; red on the old app.js/panelarrange.js (cards still drawn).
- TestUsagePageLeavesOutWhatTheAppHides (new): green; red on the old
pages.go (balance, account and row still listed).
- GUI: the 128 files that read the panel, Usage or tray code, chromium +
webkit, every language, on mote: 17 files red, rerun alone at
concurrency 1 here 123/449 red and at origin/main
|
||
|
|
667ac8bd6f |
settings: a look at one setting takes the shared settings, not a copy
settings.Load() copies the whole Settings (clone + deepCopy of every map and slice) for each caller. 133 places read one field of it and threw the rest away: the proxy for every outgoing request (netproxy), the GitHub token, the China mirror switch, a model's output cap, wire or price on a gateway request. With a real account in the tray, Load's clone was 26.6 MB of the 318 MB the process allocated in its first seven minutes, most of it through netproxy.For on each request. Each of them now reads settings.Shared(), the read-only settings every caller is given for the same settings.json. Only reads were changed: a scalar field (string, bool, int, float) or a map field's index read. A caller that keeps a whole map or slice, or calls a method on the settings, still takes Load's copy. |
||
|
|
8a59e76165 |
memory: candidates and set-aside memories don't stay forever
memory.json grew from distilled candidates nobody reviewed and from the superseded members of merges, which nothing ever removed. memory.Prune now applies retention on every hourly tick of memdistill.Keep, with distilling and dreaming on or off: - a candidate unchanged for 30 days (memory.Keep) is archived; - an archived or superseded memory unchanged for 30 more is removed, recorded in removed (a sync doesn't bring it back) and, if distilled, dismissed (never proposed again); - what the user wrote or pinned (Fixed) is never archived or removed. Untidy keeps a merged memory when one of its members was removed since: it is all that is left of that member. Run on mote at base |
||
|
|
90ad90646a |
gui: black draws a black dark theme, not Graphite's grey (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS, on v0.1.4124 (tweet 2121468612238266666), with three dark-theme screenshots of Settings > General, one each with Default, Graphite and a custom black picked: 「这三个颜色……都显示是一样的」, 「尤其是黑色始终一直是灰色」. Their screenshots show the same page in all three: ground (25,25,27), card (32,32,34). Why: - v0.1.4124 tints the grounds with the pick's hue only (base + k*(c - mean(c))), lightness kept. Black and Graphite have no hue, so they changed nothing. Default draws no look at all (magpie's own). - accentOn lifts a dark pick toward white only until it reads at 4.5:1, so black's dark ink came out #8a8a8a, next to Graphite's #89898f. What changes (appearance.go): - ground(): on the dark theme, a pick darker than the theme's background darkens every dark ground by as much (depth()). Black draws a black page (#000003), with cards, pills, lines, menus and the tray panel the same steps above it as in app.css (card #08080c, line #18181e). Graphite, and any colour as light as the ground, draw as before. - lifted(): black's ink starts most of the way to white, so it is a light mono ink (#e0e0e0, dark text on its buttons), not Graphite's grey. On the light theme black is #000000, as before. The sibling, white on the light theme, now gets a dark ink instead of a mid grey. - The light theme's grounds keep their lightness: a white pick would melt its white cards into the page. - app.css: a swatch's edge and the chosen ring take a little of the text's ink, so the black swatch stays seen on the black page it draws. - Default stays magpie's own look (grey grounds, indigo accent) for every user. Not changed here. Tests: - TestBlackIsBlack: black's dark page is black and each ground keeps its step; Graphite moves nothing; black's ink is light in dark (>= 1.8:1 from Graphite's) and #000000 in light; white's light ink is dark; text reads >= 7:1 on black's grounds. - appearance-look.test.cjs: "Default, Graphite and black are three looks", light and dark, both engines: three different --accent values; Graphite keeps the grey page; in dark, black's page is black, Settings' list sits on black's card a step above it, its ink is light; in light, black is #000000 ink. - TestLookFixture's fixture gains #000000 and #52525b. Run on mote (mote was unreachable for ~20 minutes; the red check ran on mica), at this commit rebased on origin/main |
||
|
|
fc896a9f6f |
redact: a Bilibili BV id, an av number or a YouTube link's id goes as written, whatever the local model takes it for (jimlee0824v2 on X)
jimlee0824v2 on X: in a script's list of nine Bilibili videos
(bvs = ['BV1f94c6uEr3', …]), five BV ids went to the vendor as
{{SECRET_…}}, and the script the vendor's model wrote back could no
longer fetch them. A BV id (BV1 and nine base58 characters) is a public
video's id, not a secret.
Which finder took them: no rule. With Secrets and Personal on and every
kind on, the rules alone mask none of them (the "by the rules" checks in
TestPublicVideoIDGoesAsWritten). The local model did. Asked for real
(Privacy Filter and AstrLink Guard from mote's ~/evalcache) on the
reporter's script: Privacy Filter took all nine BV ids for secrets,
AstrLink Guard eight, and AstrLink Guard took av170001 for an account
number. That the screenshot shows five of nine is the model's score
around its threshold.
The class: a public video's id that the vendor's model needs as written
to look the video up. Now modelFits takes no span of any kind that is
- a BV id (^BV1[base58]{9}$) or an av number (av and up to 12 digits),
by its own shape;
- a YouTube video's, playlist's or channel's id (10 to 64 of base64url's
characters) only where its link is right before it: watch?v=, list=,
youtu.be/, /shorts/, /embed/, /live/, /channel/ on youtube.com,
youtube-nocookie.com or youtu.be. Eleven base64url characters alone may
be a key's piece, so no shape alone exempts one.
Nothing is keyed on a field's name. The rules are unchanged: a key in a
BV id's shape after its name (api_key=BV1…) is masked still. Numeric
public ids (a Douyin video's, an X status's) were already held back by
the model checks for bare digits (numberNamedSecret, accountCues).
Tests:
- TestPublicVideoIDGoesAsWritten (new): the reporter's nine BV ids in
the tool call's arguments as the screenshot shows them, a bilibili.com
video link, av170001, YouTube watch/youtu.be/shorts/embed/playlist/
channel links; none masked by the rules, nor as secret or
account_number from the model. Still masked: a 12-character secret
(Xq7vR2mK9pLs), BV1 with 0/O/I/l (not base58), a BV id with a 13th
character, a bare 11-character run, the same run after example.com's
watch?v=, a key after a YouTube link's &key=, and api_key=BV1VMnk68E9Q
by the rules.
- TestBVScriptToolCallKeepsIDs (new): the same through MaskJSON as an
OpenAI tool call's arguments.
- TestMaskEval: cases bilibili-bvids (the reporter's script) and
video-links, with both real models' recordings added (only these two
entries; the rest of the recordings were left as committed).
- Broken by hand: the publicID check taken out of modelFits.
TestPublicVideoIDGoesAsWritten FAILs with each of the nine BV ids
masked ('"BV1VMnk68E9Q" as secret: masked in "…'{{SECRET_ekl3f6pv}}'…"'),
av170001 as {{SECRET_…}} and {{ACCOUNT_…}}, the watch?v= id and the
playlist id; TestBVScriptToolCallKeepsIDs FAILs with all nine as
{{SECRET_…}}. Restored: both pass.
Run at 3f862a27c's tree (base
|
||
|
|
1248dc16c7 |
gateway: Gemini's own tools (Google Search, URL context, code execution) reach Gemini (daoche_wuzui on X)
daoche_wuzui (X, v0.1.4095): magpie's Gemini route ignored Gemini's built-in
tools. A generateContent body's googleSearch/urlContext/codeExecution were
dropped in parseGemini, so the model never searched and no
groundingMetadata came back.
- ir.Request carries GoogleTools. parseGemini keeps googleSearch (and
google_search_retrieval), urlContext and codeExecution; chat's tools
read them in both shapes ({"googleSearch":{}} and {"type":"url_context"}).
- buildCodeAssistSent, shared by Code Assist, AI Studio, Vertex and plugins
spoken to on Code Assist, sends them when no function is declared
(Google refuses built-ins beside functionDeclarations), Gemini models only.
- A plugin whose API is googleapis.com (Antigravity) now searches itself
for Anthropic web_search, like the built-in Gemini accounts.
- The Gemini reply carries groundingMetadata (chunks + webSearchQueries),
streamed and not; executableCode/codeExecutionResult parts are read
as text instead of being lost.
Run:
- mote-run at 3dc1f13ed (before rebasing onto 27 newer commits):
go test -tags nogui ./internal/gateway ./internal/provider ok (916s, 139s);
go vet both; GOOS=windows go vet ./... ok; GOOS=linux go vet -tags nogui
./... ok; gofmt -l clean.
- At 80f1e05a3 (the rebase after it only took agent, claude and davsync commits): go vet and GOOS=windows go vet of gateway and provider ok; go test -run "Gemini|CodeAssist|Search|Google|Antigravity|AIStudio|Vertex|Chat|Plugin" ./internal/gateway ok (83s); go test ./internal/provider ok (136s).
- Broken by hand, each red: googleToolsFor, googlePlugin, the reply's
grounding, the ranCode decode, chatGoogleTool.
- Real account, sandbox HOME (Antigravity plugin, gemini-3.8-flash-low),
the plugin patched in the sandbox to log what magpie sent it:
- generateContent with googleSearch+urlContext+codeExecution: the three
tools reached the plugin, the reply had groundingMetadata (3 chunks,
webSearchQueries).
- streamGenerateContent: groundingMetadata in the stream.
- /v1/chat/completions with {"googleSearch":{}},{"type":"url_context"}:
both reached the plugin, a grounded answer came back.
- /v1/messages web_search_20250305: googleSearch sent, the reply had
server_tool_use + web_search_tool_result.
Not tried: an AI Studio key or Vertex account (unit tests only); the
Gemini CLI account (Google refuses individual Code Assist now); real
code-execution parts (Antigravity's model wrote code as text); whether
Antigravity honours urlContext (a fetch gave the same stale page with and
without it). Anthropic web_fetch is not mapped to urlContext. The full
./... suite is queued behind six runs on mote's suite.lock and had not
run when this was pushed.
|
||
|
|
6cc70b2b3c |
agent: deskCatalog cleans an absolute /-spelled path too (#4785)
Dopetaiga's 3751d6cb3 made ownCatalog clean an absolute catalog path, so a /-spelled one names magpie's list on Windows. deskCatalog, the same predicate for the Codex app's list, still joined dir onto an absolute path and never matched one. With the app gone, Sync left model_catalog_json naming a list it had removed. It now has the same shape; the WSL spelling keeps its branch. Run on Windows 11 (xiaomi-gpu, win-run, -tags nogui): TestCodexSyncMendsGoneCatalog, TestCodexDesktopListSlashSpelled (new), TestCodexOwnCatalogGoneNotPutBack and TestCodexDesktopList.* are ok at this tree. With main's codex.go, not_the_provider and the new test are red. With 3751d6cb3's codex.go (ownCatalog fixed, deskCatalog not), only the new test is red. On macOS the bug is not visible (/ is the native spelling there). Batch record (ggbdpq's five patches #3254 #3356 #4258 #6391 #4785 and the two follow-ups), on mica through suite.lock: - At 8c58d9b0b (base |
||
|
|
f62e93b8aa |
agent: Claude's Unwire gives up the stashed model in every case (#4258)
The #4258 patch kept the model in the stash until the write that puts it back or takes magpie's out has gone through. When neither write runs (the stash kept one of magpie's models and the user has picked their own since), the model stayed stashed after the Unwire. Before the patch, unroute's unstash always took it out. It is now forgotten after the switch in every case that returns nil, which is main's behaviour with #4258's ordering. Run (mica, at this tree): TestClaudeDisconnectLeavesNoModelStashed is ok here and ok at main's claude.go, codex.go and stash.go. With 46b365337's claude.go alone it is red ("the stash still holds a model after the Unwire: relay/glm-4.6"). TestDisconnectFailureKeepsStashedOriginals is ok. gofmt -l clean; go vet of internal/{provider,davsync,agent} on darwin, GOOS=windows and GOOS=linux is ok. Not changed: the other agents' restore paths, filed as #6601. |
||
|
|
f12a1f79d8 |
agent: ownCatalog cleans an absolute /-spelled catalog path on Windows (#4785)
A config.toml naming the catalog with an absolute /-spelled path was not recognised as magpie's own: the raw string matched neither the base-name ref nor the \ spelling, so Sync left the key in and Codex could not load its config once the list was gone. Clean the absolute path too; on Windows that turns its slashes into the native ones. The WSL spelling keeps its own branch. |
||
|
|
8cd8cf31bc |
claude: a saved account's directory sign-in older than the saved one is not taken over it (#6391)
A spare handed to Claude Code comes back from the switch signed out when its own config directory was made again meanwhile (#4750): the directory keeps the sign-in from before the hand-over, Claude Code refreshes its own copy while it serves on the account, and the switch back saves that as the account's. The next run on the account then took the directory's older sign-in over the fresh saved one — takeClaudeDir takes whatever tokens differ — so the spent copy replaced the fresh one in logins.json, the refresh in the directory was refused and emptied, and every request on the account failed till it is signed in again. The directory's sign-in is now left to the saved one when it is older (the later expiresAt is the newer, as the imports' newer-wins, #4532): has=false has claudeSavedDir make the directory from the saved sign-in again, so the account comes back usable whichever way the directory came to hold an older copy. What was there is cleared first, so an older keychain item cannot shadow the fresh file on a Mac. Run (-tags nogui, GOCACHE private, parent |
||
|
|
1dbd3bb07c |
agent: a Disconnect whose restore write fails leaves the originals stashed
skygunner (#4258): Claude and Codex unroute took the stashed originals
out of the stash before the config write that puts them back, so a write
that failed (a full disk, a file a watcher held) lost them for good, and
a retry had nothing to put back. The same shape was in Claude's
putClouds, and the model's original was taken out before the write that
restores or replaces it, which comes after unroute.
The originals are read with peek and taken out by forgetValues only once
the write has gone through, each only while it is still the value peeked:
one a concurrent change wrote since stays stashed. The model stays stashed
for the caller: Unwire takes it out after its write, and picking a model
of the agent's own after it.
A file that doesn't parse is copied aside before it is written over, as
it was (lastgood.KeepUnparsed); a change reports nothing new. The same
take-out-before-put-back shape in the other agents' restore paths (agy,
antigravity, cline, claudedesktop, astrbot) is left as it is.
Run (worktree at base
|
||
|
|
4082f6d00e |
davsync: a part re-enabled on a state with no Off mark joins again
kupakupar (#3356): re-enabling the library (or an agent's models) on a
computer that synced with the part left out sent that computer's older
content up over the server's newer one. What #6428 fixed for states
since it writes — a part left out is marked in Off, and one synced again
joins like a first sync — did not reach the states older magpies wrote:
they carry no Off mark, so the join saw a real hash against the
nothing-hash the last sync left and took it as a change here, against a
server it had already seen.
A part that syncs now, whose baseline is the nothing-hash a left-out
part carries and that holds something of its own here, joins again the
same way: each side's own counts as changed there, the newer stays. A
state since #6428 already names such parts in Off and takes the old
path; a first sync has no baseline to compare and is the join already.
Run (worktree at base
|
||
|
|
284b221727 |
claude: a forget waits for runs in the account's directory (#3254)
switchSavedLogin waits on the run marks another magpie's process leaves beside a saved account's directory (#4532), but ForgetLogin removed the directory with no look at them: another process's run in it (a /usage, a warm-up, a keep-alive) had its directory taken from under it, and the switch ForgetLogin does first handed nothing over — the removed account's run may still refresh its sign-in there. ForgetLogin (claude) now takes the account's in-process run mutex and waits on every other process's run mark up to claudeRunWait, refusing with errClaudeRunning past it, before it switches away or removes anything: nothing is removed under a run, and the saved sign-in stays. Left: forgetClaudeDir's two other callers keep their shape — a fresh sign-in's replacement of an older saved directory (signin.go) rebuilds one at once, and the switch hand-over's removal runs behind switchSavedLogin's own wait. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
aba6aeac22 |
lessons: the third raise landed by 13:00, not 11:00
Docs only; no code run. |
||
|
|
2a8e77f99d |
lessons: 11-14 a third core budget raise (27c998aba)
Docs only; no code run. |