1ccacad63281094de8a3372d5a507d38f9969e5c
51
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
662546e78d |
usage: a cache hit rate reads 100% only when all of the prompt was cached (ZhangXiaof48473 on X)
Routing's request list showed "缓存 100%" for Codex requests of 77.5K
tokens that read 77,200 of them from the cache (99.6%), beside rows at
99%, and the route line said "请求缓存命中率 99%". Every hit rate was
Math.round(100 * h) + "%", so anything from 99.5% up read 100%.
One formatter now says every hit rate: hitPct(h, d) in app.js, whole
percents (d decimals) unless rounding would say 100% or 0% of a prompt
not all or none cached, then one or two decimals (99.6%, 99.95%; never
past 99.99% or under 0.01%). Its callers: Routing's request rows, their
route line and a session's Avg. cache (plugins/routing/client.js); the
tray panel's Cache hit rate and the ranking rows' hit rate (app.js); the
Usage page's tiles, agent rows, Requests table, request detail and its
KPI strip, which keeps its one decimal (plugins/usage/page.js); the
context card's Prompt cache and the session traits Cache-friendly,
Cache misses and Cache hit (context.js). The TUI's and CLI's sessions
line, which floored the integer, use usage.HitPct, the same rule in Go;
it rounds now, so the TUI test's 67% (25.2K of 37.3K, 67.6%) reads 68%.
No new strings; app.js pays its bytes with six ledger comments cut, so
the core scripts are 15 bytes smaller than at its parent, no raise. Main
is over the core budget already (1,534,476 > 1,533,802 at the parent,
#5918); this commit doesn't add to it.
Run on mote:
- new internal/gui/tests/cache-hit-pct.test.cjs (Routing rows 99.6% /
100% / 99%, the route line, hitPct at its edges) in chromium and
webkit, en and zh: green; with the escalation line removed by hand,
red (99.99% where 99.6% is wanted).
- cache-hit-pct, panel-usage, context-window, i18n-keys, usage-ledger,
tray-totals, ctx-route, ledger-cache-hit, usage-hit-rate,
routing-request-metrics (both engines; ledger-cache-unknown and
ledger-cache-tokens in an earlier run): 186 pass, 6 red, all in
usage-ledger's 'newest live route needs no return-to-live button',
red the same on origin/main
|
||
|
|
f418edffc3 |
sessions: a session's details show how full its context was, request by request
liang_yongxiang on Discord: Routing tells how full one request's context window was; does Sessions have the same, each turn's share? A session's details on the Sessions page (and in Usage's Sessions list, which draws the same details) get a Context line when the gateway sent calls of it (s.via): the Context tab's spark of its prompts, request by request against its window, and the fullest one's share beside it, toned as the tab tones it. A point's tip says "Request 2: 80K of 200K (40%)" (the tab's spark says it too now, where the window is known); a point clicked opens that request in Routing with its card. A session the gateway never saw asks nothing; one it kept no prompt of shows no line. The data is the routing history the Context tab already reads. A new GET /api/context/session?agent=&id=&from=&to= reads only the days from the session's first to its last (30 at most), through the tab's per-day cache (daysRecsLocked, split out of contextRecsLocked, so the tab's cached days are not evicted), and keeps that one session (contextOfRecsFor), with up to 1000 of its requests. The tab keeps the latest 80 sessions and would leave an older one out. Subagent and side calls are left out as the tab leaves them out; the same id under another agent is that agent's. The line's code is in plugins/usage/page.js (sessCtxLine). context.js only exports spark and health, and pays for its tip by cutting comments, so the core's scripts are 10 bytes under main's, no budget raise. Run at this head (rebased on |
||
|
|
f78d6b0d95 |
tune: gateway mode leaves Tuned for you out
/api/tune replays this computer's Claude Code and Codex files, and a ~/.claude folder alone makes a Claude Code card. In gateway mode the agents are on other computers, so the card said Claude Code made 0 requests while the harness card counted the gateway's. /api/tune now says gateway: true with no agents, Use and Undo answer 409, and context.js draws no section. Run (mote): go test ./internal/gui -run 'TestTune|TestGatewayMode' ok; node --test context-tune-gateway, context-tune, context-tune-shapes 334/334 (Chromium and WebKit, en and zh, 900 and 420 wide); vet both OSes and gofmt clean. Broken by hand: with the ownSessionsOff checks taken out the Go test shows the reported Claude card with 0 calls; the GUI test fails 20 of 30 (every gateway-mode case) on the old context.js. Not tried: a real Docker magpie; the full suite (mote rebooted mid-run). Reported-by: linkaww on Discord |
||
|
|
784113472d |
gui: motion answers sooner: strong ease-out, folds and popovers under 300ms, no scale(0)
The owner asked for every animation to follow Emil Kowalski's "make your app feel faster" rules (x.com/emilkowalski/status/2118687605776597482): ease-out for anything the user starts, a strong curve over the stock one, and UI motion under ~300ms. Spinners, attention flashes, decorative loops and the chart intros are left as they were. - New token --ease-out: cubic-bezier(.23, 1, .32, 1); --morph-ease is now the strong ease-in-out (.77, 0, .175, 1). - Agents' fold, and the panel's edge that moves with it (UNROLL/ROLLUP): .62s/.42s -> .34s/.26s on --ease-out; its rows .56s with a 48ms stagger -> .32s with 24ms. - An agent row's details (ROW_OPEN/ROW_CLOSE, .ag-open, .ag-body): .48s/.40s -> .32s/.26s. The curve stays the gentle-start spring the comment chose so the panel's edge keeps up; only the time is shorter. - Hover reveal of a row's menu: up to .52s -> .28s. Chevrons .3-.5s -> .22-.32s. - Popovers: pop-in .42s -> .24s; pop-out was .22s on an ease-in curve, now .15s ease-out. - The new-dot started from scale(0); it starts at scale(.5), opacity 0. - Sheets, sidebar sub-lists, modals (.57s -> .44s open, .38s -> .30s close), Context tiles and fades, plugin cards: 460-620ms -> 240-400ms. - Theme crossfade .35s -> .25s; copied/new-account pops .36-.5s -> .26-.3s. Run on the Linux VM (magpie-desktop, WSL), both engines, every language: - Whole GUI suite at this change: 21559 pass, 431 fail of 21990. The run overlapped another session's suite (15-minute load 39). #5559 has 478 of 21666 red on this VM at main. - 17 files that touch the changed motion (model-chip-steady, page-width-steady, zero-priced-free, segs-press-redraw, rest-try-now, provider-fetch-again, codex-predictions, side-toggle, tray-cell-click, menu-input-scroll, agent-details-ready, agent-expand-steady, held-animations, group-morph, header-centre, inner-scroll-contain, recovered-file), concurrency 2, at the parent |
||
|
|
30ae0e3f92 |
context: Tuned for you draws only the advice rows it knows (Linka)
Linka on Discord (v0.1.3199, a Docker magpie added as a Remote magpie): Usage › Context showed "undefined is not an object (evaluating 'r.cost')". Cause: since v0.1.3120 ( |
||
|
|
fcc0daa23e |
usage: Tuned for you tells Claude Code's cache here with no calls, and an hour of the user's has Use 5 min
linkaww (Discord, #help) set Claude Code's prompt cache to 1 hour from Usage > Context > Tuned for you and asked how to go back to 5 minutes. On the computer that sends its requests to a Remote magpie the card was empty, so there was nothing to see or undo. Cause: the card's rows came only from advice, which needs 50 calls read from this computer's session files, or from a knob tune put in itself (TuneKept, v0.1.3120). A Remote-magpie client with too few calls read here, or a 1 hour it didn't put in through magpie (set on the other computer's card and copied, set by hand, or stashed by a version before 3120), had no row. The setting itself is Claude Code's settings.json on the computer where Claude Code runs (promptCacheTtl, subagentPromptCacheTtl); a Remote magpie's requests read B's, not A's. Now: - agent.TuneCacheHere reads Claude Code's two cache lifetimes on this computer whoever set them: the main conversation's always, the subagents' when something sets it, nothing when there is no ~/.claude. adviseOf adds them to the kept knobs, so Claude Code's card shows with no calls at all, each row's Now saying 1 hour, 5 minutes or Default. - A row with too few calls at 1 hour that magpie didn't put in has Use 5 minutes (tooltip: Replaces your 1 hour; Undo puts it back); after it, Undo gives the hour back from the stash. A variable that comes first (CLAUDE_CODE_PROMPT_CACHE_TTL, FORCE_PROMPT_CACHING_5M) still locks it. - A row with too few calls no longer reads "Already the leanest". - The three Use buttons share one helper, which pays for the new one: context.js is 82 bytes smaller, TestCoreScriptBudget's budget untouched. No new strings. Run (mote, via mote-run): - go test ./internal/agent ./internal/gui -count=1: agent ok; gui's only reds are TestMainWindowCorners/macOS_26_SDK (#3949, macOS 27 on mote) and, before the helper, TestCoreScriptBudget (fixed as above); after: -run 'CoreScriptBudget|Tune' ok. - context-tune.test.cjs in Chromium and WebKit, all five languages, 360 and 1100 wide: 24 of 24 ok. i18n-keys: every test ok but "a plugin's words are its own", red on main for three strings in other files (#5332, #5426, #5482). - gofmt -l clean; go vet darwin (touched packages), GOOS=linux -tags nogui ./... and GOOS=windows ./... ok; builds for all three ok. Broken by hand: - old internal/gui/tune.go: TestTuneTellsTheCacheHere red ("the user's own 1h, no calls: rows []") and TestTuneKeepsWhatItPutIn red. - old context.js: the new GUI test red in both engines (Now read "—" where Default is expected). Not tried: a real Remote magpie pair (two computers) with linkaww's settings, and a real Claude Code session reading the 5m after the press; the whole GUI suite ran after the push, not before (suite lock held). Reported-by: linkaww (Discord) |
||
|
|
6b91c2ea5b |
usage: a cache or window Tuned for you put in keeps its Undo with too few calls
linkaww on Discord (11-06): "之前在用量 - 上下文把Claude Code缓存改成了1h 请问在哪里改回5m". Usage › Context › Tuned for you is the one place in the GUI that sets Claude Code's promptCacheTtl, subagentPromptCacheTtl and a model's autoCompactWindow, and its row (with Undo) came only from advice, which needs 50 calls in the range. On Today, or a quiet week, the row and the way back were gone, and an agent with no calls had no card at all. agent.TuneKept lists the knobs tune put in (its stash, read back as ours, not under Long conversations). /api/tune adds each one that has no advice row as a few row, and keeps an agent with none of its own calls when it has one. The card draws a few row as In use with Undo and "Not enough calls in this range to tune on", and no curve; the card's totals skip it. A value the user wrote themselves is not listed. Codex's compact is left out: Settings changes it. Run (mote, at this tree): - go test ./internal/agent ./internal/gui -count=1: agent ok. gui is red only in TestMainWindowCorners, which is red the same way on a fresh origin/main |
||
|
|
775630dac9 |
usage: the compaction picker says each window against the setting now
hayden4608 on Discord (#feedback): "上下文压缩阈值建议这里应该以当前选中的为
基准更直观 而不是以最省token的为基准". Usage › Context's "Other window…"
menu said every value's tokens past the leanest, so the window one had
set (ticked in the menu) read "+N tokens" like any other, and choosing
between them meant subtracting two notes in one's head. The reader
picks away from the setting in use, so that is the baseline now:
- each value says "−N tokens (−x%)" or "+N tokens (+x%)" against the
setting now's own point on the curve (the replay's cost at the current
value when the curve has no point there);
- the setting itself says "Your setting now";
- "Fewest tokens" stays, beside the leanest value's numbers (timed: the
cheapest, as before), so where the minimum is is still shown;
- the menu head says it: "Compact at · against the setting now, from
your calls of the range".
The chart and the "{pct} fewer tokens" line already compare with the
setting now and are unchanged. New strings in zh, zh-TW, ja and de; the
old head's key is replaced. docs/subsystems/agent-wiring.md says the new
baseline.
context-tune.test.cjs: the menu notes in every language at 360 and
1100 wide, against 300K set (−150M/−11% at 250K, −420M/−30% plus
Fewest at 160K, "Your setting now" at 300K), and again after 250K is
put in (250K is the setting, 300K +150M/+12%); the timed case against
120K set (100K −90M/−9% plus Fewest, 240K −20M/−2%).
Run on mote (mote-run), this tree before the rebase:
- context-tune: 120/120 chromium, 120/120 webkit
- i18n-keys 4/4 and compact-one-value 6/6 in each engine
- go test -run 'Budget|Script|Asset|I18n|Lang' ./internal/gui: ok
Broken by hand: the old context.js under the new test fails 20
subtests in chromium (both menu tests, every language and width).
Not tried: the real app with a real replay; the full GUI suite and
go test ./... (run after the push).
|
||
|
|
e4bc3eeb6f |
gui: the context window card's head keeps its title, icons and model apart at every width
packinggoods on Discord, in #feedback: in a narrow window the Routing page's "Context window" head drew the provider's icon over the end of the title. The mono model id (remote-magpie/claude/cla...) and the Live pill sat beside it. The cause was .ctx-fold, the title's button when the card can fold. It had min-width:0, so it shrank under the route, and the title's nowrap text ran on under the icons. The title no longer shrinks (flex:none). The route and the state now go together in .ctx-end, and the head wraps. Where the title leaves them too little room they take a line of their own, ending at the right, and the model id is cut there with an ellipsis. A folded card stays one line. At 520px and below it drops the agent's name and the lab part of the route. At 420px and below it drops the route and the state's word, keeping the state dot and the bar. The fold button keeps an outer height of 20px (margin -1px), so opening the card doesn't move the page. New test, ctx-head-narrow.test.cjs. It uses the reporter's model, live and counted, with and without the agent, with and without a known window. It runs en, zh, zh-TW, ja and de, at 1100 down to 340px, open and folded, in Chromium and WebKit. It checks that the title's text is whole, that no drawn parts overlap (boxes clipped to their overflow ancestors), that an icon is never part-cut, and that nothing runs past the card. Run at this head (rebased on a fresh origin/main), on mote, both engines: ctx-head-narrow, ctx-route, context-window, routing-context-fold, routing-ctx-still, routing-ctx-fold, routing-live-patch and i18n-keys: 188 pass, 0 fail. The whole GUI suite is running on WSL (Linux, both engines) and had not reported when this was pushed. Mote was busy with three other sessions' full suites. The owner's rule is to ship a verified fix at once. Any red it finds that this change caused gets an issue. Broken by hand: ctx-head-narrow on the old context.css/js is 52 of 52 red (e.g. "open at 580px: the title is whole ... cut:true", "title and lab icon overlap"). Not tried: the real Wails app (WebKit on macOS, WebKitGTK on Linux, WebView2 on Windows). |
||
|
|
0872bc2a0e |
context: a request's text and reply from the request archive (wangbinyq)
wangbinyq on Discord: with the request archive on, clicking a block of
the context window card still said "只保留最近 10 个请求的原文", since the
card read only the last 10 bodies magpie keeps in memory.
What changed:
- /api/context/text tries memory first, then the request archive's copy
when the route names one (Route.Archive, the route found in the trace
or in the history file of the card's ?day=, HistoryRoute looks a day
either side). gateway.ArchivedPromptText parses it as PromptText does
and masks it through maskedCopy, as the body in memory is; it is
marked from "archive" and the card says so.
- New /api/context/reply: the reply to the request, from the Recent
calls (Server.ReplyBody) or the archive's Response. gateway.ReplyPieces
reads it into thinking/assistant/call pieces (conversationOutput, split
out of conversationTurn) after redact.ScrubJSON, and masks every piece
through maskedCopy. The card's text view has a Reply button beside
Close that shows it and goes back to the part.
- What is shown is what the archive stores, masked as the memory copy
would be, nothing more. A body or reply that can't be masked shows
nothing (404 "unread"); one the archive cut short isn't parsed ("cut");
one it names and doesn't have says so ("missing"), and one with no
archive copy keeps the old "only the last 10" line ("off"). A failed
bucket read is an error, not "gone".
- The archive read is capped at archiveReadMost and the last copy read is
kept 5 minutes, so the items opened one by one read it once.
- ctxtext.js takes the route (id and time) instead of the id; context.js
passes it (its one-line change paid for by a comment cut, core budget
not raised). New strings in zh, zh-TW, ja and de.
- docs/subsystems/gateway-routing.md (Prompt) and gui-shell.md.
Run on
|
||
|
|
a63766b071 |
context: Use on Codex's window reads "In use" over 7 and 30 days too (hoobnn)
hoobnn on Discord (#general, after v0.1.2572): on Usage > Context, Use on Codex's Compact at showed "In use" with Undo over Today, but over 7 or 30 days the card never said "In use". Cause: adviceRow checked `same` (Now equals the advice) before `applied` (magpie put the advice in). Over 7 and 30 days the moved models' Now reads the advice after Use, so the chip said "Already the leanest for how you work". Today's calls were Codex's own models, so Now stayed and `applied` won. Now `applied` is read first, in every range; adviceRow is the only place the verdict is drawn (Claude rows and TTL rows go through it too). Test: context-tune's new "Use on Codex's window is In use with Undo over Today, 7 and 30 days" (every language, 360 and 1100 wide), and three existing assertions that wanted "Already the leanest" after Use now want "In use". Run: - Red on the old code (mote, base |
||
|
|
c903c3a411 |
usage: Use on Codex's window lands over 7 and 30 days, a model's own Compact at named apart (hoobnn on Discord)
hoobnn on Discord (11-01): "观测-用量-上下文里,在7天或者30天的选项里,点击
应用codex的上下文,没生效。" Over 7 or 30 days the range held calls on a
model whose provider has a Compact at of its own (430K); today's didn't.
Tuned for you's "Now" was the largest compaction point over every model
in the range, so it came from that model. Use put the advice in Long
conversations, which did move Codex's other models (Codex's list had
them at the advice), but the card still read 430K and then turned held
("compacts at its own 430K, which comes first"), so nothing seemed to
happen. And with Long conversations at magpie's default, a range of
only such models offered a Use that could move nothing.
codexWindow (internal/gui/tune.go) now reads "Now" from the models Long
conversations moves, and lists each model with its own Compact at as
Apart (largest first). Only a range whose every model has its own is
held (Own), whatever Long conversations says. The card names each
model kept apart under the row: "{model} compacts at its own {value},
which this doesn't move", in en, zh, zh-TW, ja and de.
provider.CompactSetIn is CompactSet with the caller's settings and
group finder, as CompactFor takes them.
Siblings: Claude Code's knob is per model (no max over models), so it
has no such mix. 1, 7 and 30 days go through the same codexWindow;
the GUI test covers 7 and 30 and the Go test the 1-day sample.
Run on mote at
|
||
|
|
4794767846 |
routing: back on Routing from another page, the page isn't laid out and drawn again whole (#4652)
xisdumpling (dumplings04605 on Discord), Windows, 0.1.2507: with a
history day of 180 to 298 requests picked, coming back to Routing
stalls the page and the sidebar's highlight. Measured first, with
routing-return-cost.test.cjs (250 rows, a picked day, a request's story
open), which counts what the return does, not how long it takes.
Causes found, each fixed and each red by hand when put back:
- The request list was windowed only from 300 rows, so a day of 180 to
298 had every row in the page. Now from 100 (WIN_MIN); the live list
keeps 60, so it is never windowed.
- Out of sight a view is 0 wide. The ResizeObservers in the routing
client (byWidth, the meta width) and context.js's card sizes took that
as narrow, flipped the narrow layouts while away and flipped them back
on return. A 0 width now keeps the layout it had.
- A hidden list re-windowed itself for a 0-high view, so the return
placed rows and ran metaFit again. It keeps its window while hidden.
- resume rebuilt the whole stage on return. sync("back") rebuilds only
when what the stage was built from (route, pin, day, purpose, lang,
the requests and their accounts) changed, and records it after the
rebuild.
- The visibility observer's group reload was not quiet and redrew the
groups. It is quiet now.
- A providers refresh while on Routing redrew the hidden Providers page.
It is read and drawn when Providers opens (providersBehind).
Not a cause: the nav highlight's rAF reading offsetTop only waited on
the busy main thread; it is one small layout now.
Before and after, the "back on Routing" step (Chromium layout metrics
from CDP; class flips and redraws from MutationObservers, both engines):
- mote, macOS: 25 layouts / 34.9ms of layout, 24 class flips, Providers
redrawn 13 nodes, groups 4, stage kept 0 of 3, 250 rows, 7818 nodes
-> 9 layouts / 3.2ms, 0 flips, 0, 0, 3 of 3, 11 rows, 1367 nodes.
- Windows (xiaomi-gpu, win-run): 25 layouts / 146.4ms, 24 flips
-> 9 layouts / 7.1ms, every check passes. WebKit's counts match.
The test asserts no flips, no redraws, the stage kept, under half the
rows in the page and at most 12 layouts; wall time is logged, not
judged. The page looks the same: no CSS or markup change.
Run:
- routing-return-cost: red on origin/main
|
||
|
|
e1aec53895 |
routing: each session sending at once has its own context window, named by its title (tjhhhh on Discord)
tjhhhh runs several agent sessions at once. The Routing page's context
window card followed whichever request came last, so it jumped from one
session's prompt to another's. The card still tells of the request it
picked. Under it, while two or more sessions are live, a strip now
shows one small block per session (renderCtxSessions):
- keyed as the card's line of prompts is (sessionKey, else the
conversation);
- named by the agent's title for the session (sessionName), else its
folder's last level, never a bare id;
- holding that session's newest reading through context.js's stack bar,
exported as window.ctxStack.
A session is live while a request of it is under way, or while its
newest request is within 15 minutes of the newest overall. At most six
blocks show, newest session first. A block keeps its place while the
sessions take turns, because blocks are ordered by each session's first
request. The block the card tells of is lit (aria-pressed), and a click
on a block picks that session's newest request. The card's footer names
the session by its title too. New words are in every locale in
plugins/routing/i18n.js. The strip reuses the card's tokens: no select,
no coloured border, no gradient.
The strip sits under the card, not over it. Over it, the strip's first
appearance moved the card, and routing-ctx-still ("the cache kept its
place") went red in both engines. It is green at base
|
||
|
|
80af3b86a4 |
context: the card's head names the agent and the model's lab
The owner asked for the agent's name and the model's icon on the context window card, and picked design A from a mock-up: in the head, right of the title and before the state pill, [agent icon] Claude Code › [lab icon] anthropic/claude-sonnet-5-5 - context.js: the head's model is now a route (.ctx-route): the agent's icon and name (agentIcon, agentLabel, as the Usage page names it), a ›, then the model's lab icon before its id. labIcon picks the lab from the id after its provider prefix (Claude, OpenAI's gpt/o-series/codex, Gemma, Gemini, DeepSeek, Qwen, Kimi, GLM, Grok, MiniMax, Doubao, Mistral, Llama, MiMo, Step, Hunyuan); an id it doesn't know gets no icon, so a wrong logo never stands for a model. - context.css: the name in --fg-2 at 500, the › in --faint, the agent's icon 14px and the lab's 12px; the model id keeps its ellipsis. In a card 420px or narrower the agent's name and the › go and its icon stays; folded and that narrow, the model goes as it did before. - core_budget_test.go: lowered to 1,532,958, the core after this and the text viewer's move to ctxtext.js (the commit before), on origin/main |
||
|
|
9a9967ac28 |
context: a part's text viewer is loaded when a part is first opened
The context window card opens a part to the text the request sent there (readText, longText, picture, pieceView, openCtxText). That viewer is a dialog the user opens by a click, yet its 7KB were in context.js, which index.html loads on every page as part of the core. It moves as it is to ctxtext.js, which context.js imports on the first open, as signsheets.js and navlamp.js are imported; the card hands it the helpers it shares (fmtK, partName, itemName, itemLabel, tagOf). A failed import says so in the status line. The core is 7,005 bytes lighter, which makes room for the next commit (the card's head naming the agent and the model's lab); the budget is lowered there, to the total after both. old-webkit.test.cjs lists ctxtext.js among the scripts loaded later. Run at this tree ( |
||
|
|
5d955a4d4b |
tune: Codex can take the compaction advice in the background, its own limit kept (herman_hong)
herman_hong on Discord: Tuned for you advises Codex compact at ~120K.
A foreground compaction kept them waiting, so they had set 384K by hand.
Now that Codex compacts in the background, they want the advice there
and the 384K kept as the backstop.
Codex has this since 0.163.0 (checked in codex-rs at rust-v0.166.0, not
in 0.162.1): [features.async_compaction] enabled and
model_async_compact_threshold_percent, an integer share (1 to 100) of
the model's window, 65 by default. It is Stage::UnderDevelopment, runs
only with remote compaction v2 (which magpie already sets on its
provider), and starts none once the foreground limit is reached. magpie
already writes it from Settings' Background compaction (#2490), with
the version gate and the user's own keys kept. This drives that setting
from tune:
- agent: knob TuneAsync ("async_compact") on codex. TuneRead gives the
share, TuneApply turns Background compaction on at it (stashing what
Settings had the first time), and TuneUndo puts that back unless the
user changed it since. The foreground limit (Long conversations, or
the user's model_auto_compact_token_limit) is never touched. Async
keys the user wrote in config.toml come first (codexAsyncOwn): the
row says so and Apply errors. A table magpie wrote itself doesn't
count as the user's.
- gui/tune.go: advice.async holds the advice as a share of the window,
rounded down. With timed compactions it uses the token-cheapest
window, since a background compaction keeps no one waiting. It is
offered only when it would start before the foreground limit (the
lesser of the limit now and 90% of the window). held lists Codexes
too old for a share.
- context.js: the row gets a text button, "Use 120K in the background",
whose tip gives the share and says the foreground limit stays. After
Use a chip says so, with Undo background. A config.toml of the
user's, or a Codex too old, gets a one-line caveat and no button.
The too-old line is shared with Settings' row (codexHeld). No select,
no layout change. zh, zh-TW, ja and de are in i18n.js.
- The core script budget goes up by 1,571 bytes for the row
(core_budget_test.go says why). app.js is 278 bytes smaller.
Run (at this change on origin/main 6893cfbe3; rebased on
|
||
|
|
6d154ef1e1 |
context: scripts (curl, Bun, python-httpx…) are one Scripts card, not an agent each
A request whose User-Agent names only an HTTP library or an SDK (curl, Bun, node-fetch, undici, python-httpx, requests, aiohttp, Go-http-client, okhttp, the OpenAI/Anthropic SDKs, …) or nothing at all got a Context scorecard of its own, as if it were an agent (theforeveriris on X: "Bun", "curl", "python-httpx" cards). usage.IsLibrary names those clients; contextOfRecs folds them and "other" into one "Scripts" card at read time, so older history reads the same way, and the card's meta line and tooltip list the libraries by count. The cached day records are not changed. No setting: it works as is. The Usage page's Agents list still shows each library by name, with its Hide and Count-as-agent controls. i18n for zh, zh-TW, ja, de. Existing context.js comments were condensed so TestCoreScriptBudget holds without a raise (core scripts -28 bytes). Run, at this head (rebased on |
||
|
|
dfc08e8824 |
gui: one NO_SCROLL for 90 focus calls, one statusErr for 68 failed calls (#3685)
Room for #3685, which did not fit the core script budget. The budget is not raised; two repeated forms move into one name each. - NO_SCROLL: `{ preventScroll: true }` was written out at 90 focus calls (89 in app.js, 1 in plugins.js). It is one const at the top of app.js now. - statusErr(e): `status(e.message, "err")` was written out for 68 failed calls (app.js 61, plugins.js 3, context.js 4), 15 of them as a `e => status(e.message, "err")` callback that now passes statusErr. renderSync is left alone: `status` is a local string there (#4066). Saves 2,016 bytes: core 1,536,751 of 1,537,034 and app.js 1,312,975 of 1,315,316 with #3685 on top. quota-refresh-order.test.cjs evals parts of app.js in a vm and gets both names as stubs. The idea is Coffemon's (JoeyWu-tech) e7af88774, which no longer applied to main; it was redone on the current tree. Landed by yetone in a batch of Coffemon's patches from the issues. What was run, go1.26.8, on origin/main |
||
|
|
5143bf593a |
tune: Codex's "Now" is read the same way in every range, and a model's own Compact at is not "In use"
hoobnn (Discord #feedback): Usage > Context's Codex card read differently
for Today and 7 days. 7 days: "Now 380K", "Not the leanest" and a Use
220K button. Today: "Now 430K -> Fewest tokens 170K" with a green "In use".
Two causes:
- codexWindow dropped what magpie tells Codex (told) for the whole range
as soon as one call was on a model outside the catalog or with an
unknown window (Codex's own gpt-5.x beside a provider's). "Now" was
then guessed from the prompts' peaks (380K) over 7 days, while today's
calls, on catalog models only, read told (430K). told is now the
largest value over the models magpie knows, in every range.
- Long conversations held magpie's 170K and the advice was 170K, so the
row said "In use", but a provider's or model's own Compact at (430K)
comes first and is where Codex runs. The advice now carries Own
{model, value}; the card shows "{model} compacts at its own {value},
which comes first" in place of "In use" and hides Use and Other window,
as it does for a locked setting. Undo stays. New string in en, zh,
zh-TW, ja, de.
Run (at this tree, rebased on origin/main
|
||
|
|
a4e929212f |
context: a part of a few tokens on the map is a tile one sees, not a strip under the gap (AIGCFREE on Discord)
The floor under a part's tile was an area (700px²), so a part laid in a long row beside large ones met it as a strip: 49 tokens of memory beside 72K, the window unknown, came out 193×3.6px, under the tiles' 3px gap, and hidden. A part's tile is now 16px across both ways: one thinner has its value raised by as much and the parts are laid again. |
||
|
|
a0ba8e1f2e |
grok: each model's context_window follows Long conversations, and one set by hand stays through a sync (uk.jent)
uk.jent (Discord #feedback) reported that magpie writes every Grok Build model's context_window as the model's whole window. They wanted about 300K without editing dozens of models, and they lost hand edits on each sync, because SetTOMLTables replaces the [model."magpie/..."] tables whole. Grok Build now uses Long conversations, the mechanism Codex and Claude Code already use. grokWindow gives: - min(window, Compact) when the model or provider has its own threshold; - otherwise settings.Working(window): 272K by default on longer windows, the typed size, or the whole window with Full context. What magpie wrote is stashed under grok:<path>:windows, and grokOwnWindow uses it to tell a hand edit apart: - A value that differs from what magpie last wrote is the user's, and it stays. - In a config written before the record, a value other than the model's whole window is the user's. - Disconnect forgets the record. The agent sheet's Long conversations row now shows for Grok Build (AGENT_PREFS). Its texts, the provider editor's hint, the Context tab's note and `magpie model compact` now name Grok Build, in en/zh/zh-TW/ja/de. setCompact and setAsync now share prefWrite. That dedupe keeps app.js under its budget, which is not raised. Behaviour change: a Grok Build model whose window is over 272K now gets 272K by default, as Codex does, unless Full context is on. Run on mote, at this head (c893c2229, rebased on |
||
|
|
f201183047 |
tune: the compact window is Long conversations, one value for both agents
7eleven (Discord #help): the Usage page's "Tuned for you" compaction
value and the agents' sheet "Long conversations" window were two values
that could disagree. Codex's tune wrote model_auto_compact_token_limit
into config.toml beside the catalog's context_window that Long
conversations writes; Claude's read its own env.
One source of truth: settings.CompactAt / FullContext. Tune's compact
row for Codex and Claude Code now has source "long": its Current is
settings.Compact(), Use calls provider.SetCompactAt (Sync writes Codex's
catalog and Claude's CLAUDE_CODE_AUTO_COMPACT_WINDOW as before), Undo
puts back the CompactAt/Full it stashed under tune.long.compact. So a
value set on either page shows on the other and writes the same config.
writeCompact marks claude.compact_long when the env value came from
settings, so Claude's row reads it as ours, not as the user's.
Migration (Codex Sync, local place): an old tune.codex.compact stash
whose limit is still the one tune wrote moves into Long conversations.
At default or Full it takes tune's value; with a value the user set it
takes tune's only when smaller. config.toml gets the user's earlier
limit back or loses the key; the stash is forgotten. A limit the user
changed after tune wrote it, or wrote themselves, stays and reads
Locked. A provider's Compact at or the user's own Claude env stays
Locked too.
Run (mote, at this tree):
- go vet on agent, provider, gui, tune; GOOS=linux go vet -tags nogui
./...; GOOS=windows go vet ./...; go build ./... and -tags nogui: ok
- go test -tags nogui ./internal/agent ./internal/provider
./internal/tune ./internal/gui: ok (TestCoreScriptBudget within the
budget, not raised; context.js is 33 bytes smaller)
- GUI: compact-one-value.test.cjs (new; Chromium and WebKit, en zh
zh-TW ja de) and context-tune: 104/104 at the rebased head
Broken by hand: the Codex long branch, the Claude long env check and
the Sync migration call each turned red TestClaudeCompactAt,
TestCodexHomeEnvTakesThePick, TestTuneCodexCompact,
TestTuneCodexOwnLimit, TestTuneCodexMigrate (4 subtests),
TestTuneClaudeLong and TestTuneCodexMigrateOnSync. Old context.js and
i18n.js turn compact-one-value red ("You set 272K").
Not run: full suite, Go or GUI (shipped at once per owner; the GUI suite
is still running on mote, reds get their own issues).
Not tried: a real Codex or Claude Code session reading the written
config; the migration on Windows/WSL places (it runs for the local
place only).
|
||
|
|
f1537d9f95 |
context: the map counts on as a live request grows, and keeps its tip
The owner asked for the rest of what flohoeller's context map on X does,
keeping the A1 colours. On a live request's redraw:
- Every token count (the big number, the short head, the legend, each
tile's value) counts on from what it said to the new value over 620ms
(ease-out), instead of jumping. morph rolls any element with data-n;
a tile's value rolls as the tile glides. With motion reduced, or on a
first draw, the value is simply set.
- A tile pointed at keeps its tip through the redraw: the tip is told
again with what the tile holds now and kept over it while it glides
(followTip). Before, every redraw closed it.
- A tool's gathered results say how many ("exec_command ×20"), and the
small files gathered into one tile name the folder they share
("api/ · 6 files") where they share one; otherwise "N more" as before.
"{n} files" is translated (zh, zh-TW, ja, de).
A frame's time can be before the roll's start, which made the first
frame count back (40K, 39.8K, 40.7K); the progress is clamped at 0.
coreScriptBudget: 1,530,631 to 1,533,445: 2,810 bytes of context.js
(which the Routing page draws as well as Usage) and 4 bytes
|
||
|
|
3a47e377e0 |
usage: a call whose vendor counts no cache is left out of every hit rate (#3464)
#3464 (zeewell on X): Kiro caches on its side, but its replies give only credits and a context share, never cache tokens. Every hit rate outside the Routing page read those calls' CacheRead of 0 as a miss. A Kiro-heavy day showed "hit rate 6%" when the counted calls hit 90%. The plugin already says so (opencode-kiro-auth 0.1.16 sends usage.magpie_cache_unknown), and the gateway already kept it as RouteUsage.CacheUnknown for Routing. This carries it the rest of the way: - gateway: Usage.cacheNotCounted() (the vendor said so and no try reported a cache token) goes into usage.Record.CacheUnknown on every path that records a call: the gateway's own record, the OTel attempt path in observe.go, and trace's routeUsage. - usage: Record.CacheUnknown is kept as ledger row flag 8192 (rowCacheUnknown; grepped, no other flag uses that bit). Totals sums such calls' prompt into cache_unknown and counts them in cache_unknown_calls. Totals.HitRate leaves that prompt out of its denominator, and gives no rate when nothing is left. - Old records: calls kept before the plugin said so carry no flag. A Kiro call (provider kiro or kiro-plugin) with no cache counted is read as uncounted (usage.CountsNoCache): in the ledger's row read, in Totals, and for Routing's history in internal/gui/trace.go (cacheCounted). The rule is scoped to Kiro's two ids, so another vendor's 0 stays a miss (tested). - GUI: cacheHitOf in app.js drives the tray panel's card, the Usage page's agent rows and cache tile, the requests' Cache hit rate card and each ranking row. When only uncounted calls are left it shows "—" or nothing instead of 0%. Otherwise it says "{n} requests left out: their vendor doesn't count the cache". A request row's cache cells show "—", and its details say the vendor doesn't count the cache. The Context page (context.go, context.js) shows no cache for such a call and doesn't score it as a miss. - No budget raised. This adds 625 bytes to app.js (1,320,224 to 1,320,849, under its 1,321,336); |
||
|
|
83234fe920 |
gateway, gui: the skills an agent lists are their own part, not memory
The owner (10-24, on the Routing context map's "技能 / 记忆 · 9.6K"):
为什么这里又叫技能,又叫记忆?Skill 跟 Memory 应该是不一样的东西. The
gateway put Codex's <skills_instructions> in the memory part beside the
instruction files and reminders, so the tile said Skills of Memory.
Claude Code's skill list wasn't seen at all: it sat in its environment
message, counted as the system prompt.
- gateway: PartSkills ("skills") comes after tools. Codex's
<skills_instructions> goes there. So does Claude Code's list, from
"The following skills are available for use with the Skill tool:" to
the next blank line, taken out of whatever text holds it: its own
prompt, a harness message or a reminder.
- Routes kept before this (routing history) are read with an item
tagged skills moved out of memory into the skills part, so old
requests read the same way. The text view re-reads the body and finds
them under skills too.
- Usage's context baseline counts skills, as it did inside memory.
memory-heavy is now instruction files and reminders alone.
- gui: the card has a Skills part (slate, --c7), with its note in en,
zh, zh-TW, ja and de. The text view's "no longer kept" line is one
helper instead of two copies of the sentence, which makes the room for
it under the core script budget, with no room added.
Run (darwin):
- go test ./internal/gateway -run 'Text|Prompt|Context|History|Skill|Route'
ok; go test ./internal/gui ok; go vet both, gofmt clean.
- New: TestPromptOfClaudeCodeSkills (on testdata/workdir's real Claude
Code 2.1.296 body: 1502 tokens of skills out of the 2130-token
environment item), TestSplitSkillsEnds, TestSkillsApartOfKeptPrompt.
Broken by hand (splitSkills and skillsApart made no-ops): all three
red.
- GUI, chromium and webkit: context-map 22/22 (new: the skills tile's
tip names Skills and not Memory in every language, and it isn't
memory's colour), context-window 24/24, context-text 20/20,
context-scroll-end 14/14, routing-context-fold 24/24,
routing-ctx-still 16/16, i18n-keys 4/4.
Not run: the whole GUI suite (load ~400 on the box); a live Codex or
Claude Code request through the real app.
Not changed: the "system prompt, tools and memory" wording of the
baseline's tags, which now count skills too.
|
||
|
|
7edf5b0a3d |
gui: the context window is a map of tiles by default, the block grid a switch away
After flohoeller's "Context map" on X. The Context window card (Usage ›
Context, and Routing's request card) drew its window as 400 cells. It now
draws it as a map:
- Each item is a tile sized by its tokens, inside its part's area
(squarified, parts in their usual order).
- The tile has a soft fill of its part's colour, its name, and
"tokens · part".
- The free space is a hatched tile that names its share.
- The used share is drawn on a gentle curve (share^0.35), so a window
8% full still has tiles to read. The free tile states the real share.
Small items:
- Items too small to read go in one "{n} more" tile.
- A part whose items would leave a strip thinner than 14px is one tile.
- No tile is laid under 700px².
Hover and click:
- A hovered tile tells its item, part, tokens and share (a part's tile
lists its largest five) and dims the others.
- A row or the legend lights its tiles.
- A clicked tile opens its text, as a cell does.
Motion:
- Tiles come in with a short stagger (opacity, scale .94, blur), over
560ms with the iOS ease.
- A live update keeps the same nodes and glides them to their new rects.
- Tiles that are gone fade out.
- With motion reduced, or on a still pane, nothing moves.
The block grid is kept. A small segmented switch at the end of the legend
(Context map / Block grid) picks the look for every card, remembered in
localStorage magpie.ctxLook. The card eases to the other look's height.
The new look is the default, and the old one stays one click away (UI
restraint, owner's ask).
The text view shows an image the request sent inline (the gateway's Src,
previous commit), where it said "An image: magpie doesn't show it here".
It fades in, and a click opens it larger with a FLIP scale. An image with
no Src, or one that fails to load, keeps the old note.
Words: "Context map" and "Block grid" in zh, zh-TW, ja and de.
The core budget goes to 1,549,478, the new size with no room added:
context.js is drawn by the Routing page as well as Usage, so it is the
core's own (+14.4KB).
Tests:
- Seven existing tests read the grid's cells. They now pin
magpie.ctxLook=grid.
- New context-map.test.cjs, in both engines, en/zh/zh-TW/ja/de, at
1100 and 420px:
- The map is the default, with a free tile.
- Every tile is inside the map, none overlap, and none is a sliver.
- Hover gives the tip and dims the others.
- A refresh keeps the nodes.
- A click opens the text.
- An inline image loads (naturalWidth 2) and opens larger. One without
Src is named.
- The switch to the grid survives a reload, and the map comes back.
- With motion reduced, nothing animates.
Run at this head (rebased on
|
||
|
|
1acd79cdfc |
usage: a compaction window picked past the leanest band isn't called the leanest, and offers the band (yapechan on Discord)
yapechan (Discord #general, 10-17 05:21Z): after picking another auto-compact
threshold outside the cheapest range, Context still said "已是最适合你用法的
最省配置"; they asked for the hint to change and for a button that sets it.
Cause: /api/tune does read the value the user set (TuneRead -> Current). With
the agent's compactions timed, tune.Compact's advice never waits longer than
the window now, so a larger window comes back as its own advice (best ==
current) and the row's chip said "Already the leanest". A probe of
tune.Compact on TestCompactTimedWaitsLeast's fixture: 400K picked -> best
400K at +16% tokens over the cheapest (250K); 1M -> best 1M at +96%.
Fix (context.js, adviceRow): the leanest band is the curve's windows within
3% of its cheapest, tune's own sameCost. A timed row whose window costs over
3% past the cheapest now says "Not the leanest: {band} spends the fewest
tokens" (info chip, not the green one, also when magpie set the value), keeps
the caveat, and has a "Use {value}" button for the band's largest window, the
one of them that compacts least; its tooltip says it means more compactions
to wait on. A window inside the band still says it is the leanest, with no
button. Untimed rows are unchanged: their "same" already means within 3%.
New strings in zh, zh-TW, ja and de.
What was run (macOS, load average 300-375 throughout):
- New test context-tune.test.cjs "a window picked past the leanest band isn't
called the leanest": both engines x 5 languages x 360/1100px, 92/92 pass
for the whole file at this head. Broken by hand: old context.js -> FAIL
"expected 'Not the leanest: 230K–270K…' actual 'Already the leanest…'";
band test made unreachable -> same FAIL in WebKit; chip class back to
"applied is good" -> FAIL "expected 'ctx-chip info' actual 'ctx-chip good'".
- GUI files run one at a time, all ok: context-picks, context-scroll-end,
context-text, context-tune, context-window, gui-de, gui-ja, gui-zh-tw,
i18n-keys, usage-range, account-alias, account-arrange.
- Whole GUI suite NOT completed: a combined run of all 794 files died
partway (2358 test points, 37 not ok, all page.goto/90s timeouts in
unrelated pages under the load); a per-file rerun did ~33 files in 30
minutes and was stopped. Its two reds (account-alias, account-arrange,
timeouts) pass alone.
- gofmt -l: clean. go vet ./..., GOOS=linux and GOOS=windows go vet -tags
nogui ./...: clean.
- go test -tags nogui -timeout 45m ./... under pipefail at 161030972 (this
change on
|
||
|
|
3c7ec4ba24 |
gui: Usage is a plugin's page, its code, markup and words in plugins/usage (P2)
P2 of docs/subsystems/plugin-runtime.md, the fourth page after Sessions,
Library and Routing, and the largest part of app.js.
- The Usage page's code (~3000 lines: the Overview's cards, the
Requests ledger and heatmap, the Sessions tab, the Agents list) moves
from app.js to assets/plugins/usage/page.js; its markup, index.html's
<main id="view-usage">, is client.js's part html. app.js 25756 →
22675 lines (1,355,376 → 1,198,239 bytes).
- page.js builds on app.js at the top level (its timers, ?view=usage's
tab and filters), so it is the one plugin script that loads after
app.js. index.html: kernel.js, the plugins' other scripts, app.js and
the scripts beside it, each page.js, then start.js, which is app.js's
old tail (magpie.start(), navHides, OPEN_VIEWS, the first page shown,
load()), so the first page has its code. TestBuiltinClientsLoaded
holds that order.
- Hooks: open loads it, refresh(again) is load()'s read of it, reload is
Refresh now, costs redraws costs on a currency change, tab says the
tab for focusQuotaCard. app.js calls those through magpie.call. The
allowance cards, quotasOpened, panelQuotaFocus and panelUseFocus stay
in app.js: the tray panel draws them too.
- plugins/usage: Essential, Requires window, no InUse. Off, its nav tab
goes and so do the ways to it (data-feature="usage": the panel's Open
Usage, Routing's View usage); show("usage") gives way to Agents; the
panel's Allowances tab stays. builtins.test.cjs switches it off and
checks each.
- The 173 strings only Usage says move to plugins/usage/i18n.js;
i18n.js 15032 → 14344 lines. "{n}s" and
"All sessions" stay: context.js says them too since #1591.
- context.js: with context.js now in before the first page is shown,
the page's open and load()'s first refresh both reached loadContext,
and the second drew "Reading…" again over the advice the first had
just drawn, so its curves never played their entrance (context-tune,
3 of 3 red). loadContext draws the waiting pane once for the same
days. Its dead last line, which loaded the tab once context.js came
in late, goes.
- context-window.test.cjs's "arrives after the state" becomes "loads at
once though context.js is slow": start.js now waits for it.
usage-stale-answer reads page.js beside app.js. quota-refresh-order
(#1630) cut app.js at the period picker's comment, now in page.js; it
ends at the next comment that stays (5 of 5; without keepRefreshedQuotas'
call, 2 of 5 red).
- docs: plugin-runtime.md, gui-shell.md.
Run, at this tree on origin/main
|
||
|
|
eb7199e120 |
gui: Routing is a plugin's page, its script, style and words in plugins/routing (P2)
P2 of docs/subsystems/plugin-runtime.md, the third page after Sessions and Library. - routing.js and routing.css move to assets/plugins/routing/ (client.js, routing.css). Its part's html is the page's head and boxes that were index.html's <main id="view-routing">; the rest is drawn by routingPage, run at mount since it builds on app.js. It keeps itself after that as it did (its own hidden, the language, focus), so its hooks are dirty and discard, a routing group being edited, which show() and the window's close ask through magpie.call: window.routingDirty and discardRouting are gone. - plugins/routing: Essential, Requires window and gateway, in use while the user has a routing group (not Auto, not Hidden), since the page is where it is edited. The gateway routes the same with it off. - With it off, what leads to the page goes too: the nav and panel tabs and the panel's section (data-feature="routing"), the guide's Open Routing, Providers' "Make a routing group of …", the Usage list's View routing and its time as a link, the context card's Latest request. A panel left on its Routing tab shows Agents. - What other pages use of it stays on window: openRoute (context.js), kindName, swapWhy, routedWhy (Usage's Requests), newGroupWith (Providers), panelRoutingShown (the panel). - The 505 strings only Routing says move from i18n.js to plugins/routing/i18n.js (4 languages); i18n.js 17048 → 15032 lines. The plugin's own name and line stay in i18n.js: the Plugins page says them with the plugin off (TestBuiltinsTranslated). - Tests and comments that named routing.js name the new path (gateway's antigravity_rest and loop_guard, codeassist.go, usage.go, web_compress, group_member_info, assets_revalidate, font-cascade, win-fonts, three routing-*.test.cjs). builtins.test.cjs and builtins_test.go count seven built-ins and switch Routing off: its tabs go, the page shown stays. - docs: plugin-runtime.md, gui-shell.md, gateway-routing.md. Run, first on origin/main |
||
|
|
e1dcd1e1d7 |
tune: a compaction window advised never makes you wait longer on compactions, and says the wait (HirotaNagai on X)
Tuned for you advised the compaction window by tokens alone, so a smaller
window that compacts far more often could be advised however long each
compaction keeps the user waiting.
What changed
- sessions: a call now carries how long a compaction took (Call.Compact).
Claude Code's compact_boundary line gives compactMetadata.durationMs,
which goes on the first call after it that isn't an error. Codex compacts
by a call of its own (the token_usage_record a compacted line names), and
that call's own time is the compaction's. Older rollouts with no such
record stay untimed. callCacheVersion is now calls-v13.
- tune: with 3 or more compactions timed for a model (minTimed), Facts.took
is their median in seconds, and each window's Point.wait is its
compactions x took. When compactions are timed, the advice never takes a
window that compacts more often than the current one. Of the windows that
don't, it takes the cheapest, and of those within 3% of that (sameCost)
the one that compacts least. Tokens and seconds share no unit the files
measure, so magpie doesn't trade one for the other at a guessed rate. The
token-cheapest window is reported (cheapest, wait_cheapest) so the user
can pick it. A model with fewer than 3 timed compactions is advised as
before, with no wait shown.
- GUI (Usage > Context): when timed, the advice is labelled
"Tokens + wait". The explanation says what a compaction took, the wait at
the advice against the window now, and the cheaper window that would wait
longer (if it saves 3% or more). The caveat says tokens and waiting only.
The picker shows each window's wait, with "Fewest tokens" on the
cheapest. Untimed rows are unchanged. The new strings are in zh, zh-TW,
ja and de.
- docs/subsystems/agent-wiring.md describes the timing sources and the
rule.
What was run
- go test -tags nogui ./internal/sessions ./internal/tune ./internal/gui
./internal/agent pass.
- internal/agent ran before the rebase. It took 1416s under a load
average of 120-300 and passed with -timeout 40m (the default 10m timed
out mid-suite). Its Tune/Compact/CacheTTL tests pass on their own.
- sessions, tune and gui ran again after rebasing on origin/main
|
||
|
|
bfef5d51b5 |
gui: Routing is back to v0.1.1231's layout; reverts dae2618ad (#1354)
v0.1.1233 shipped community PR #1354 ( |
||
|
|
dae2618ade |
gui: make the Routing context lazy and align wide cards (#1354)
* gui: make the Routing context lazy and align wide cards (#1354) Rebuild the context and wide-layout change on main |
||
|
|
f2c30a8859 |
usage: the tags over the Context curve's dots never print over each other either (#1549)
The previous commit keeps the axis labels apart. The tags over the dots
had the same fault: a setting one step from the advice printed its
"+3%" on "Leanest", and a setting one step from the costliest value
printed "+147%" on "+150%". The tags now go by the same rule, "Leanest"
first, then the setting now, then the costliest: one within 16% of the
axis of a tag that matters more and at about its height (20 of the
plot's 100 units) keeps its dot and tooltip but not its tag.
Run: context-tune's overlap test gains a row whose setting sits one step
from the advice, checks the tags' boxes as well as the axis labels', and
runs in German ("Sparsamste", the widest "Leanest") as well as English,
at 360 and 1100px. With the previous commit's context.js it fails in
chromium and webkit ('en 360px: tag "+150%" overlaps "+147%"'); with
this one it passes. The axis test alone failed on main before the
previous commit ('360px: "160K" overlaps "170K"'). context-tune,
compact-at and context-window: 80/80. 56 context/usage/language GUI
files in both engines: 652/654; the two reds are usage-ledger's route
export (passes 3 of 3 alone, filed as #1876) and, in an earlier run,
usage-sum-whole at 780px in German (#1864, noted there); neither reads
context.js.
Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com>
|
||
|
|
9f54b6428e |
usage: the Context tab's curve no longer draws the leanest value's label over the axis's first one when they sit a step apart (#1549, Ti800)
The axis labels the advice's value, the setting now and the range's two ends. One that sits within 16% of the axis of one that matters more (the advice first, then the setting now, then the ends) is left off, so two labels are never drawn over each other: 170K one step from 160K read as "1170K". |
||
|
|
0102915fe0 |
gui: Tuned for you lets a compaction window be picked, each with its estimated extra tokens and compactions (#1860)
MrMengJ applied the advised 200K auto-compaction window and wanted 250K or 300K instead, seeing what each costs against the cheapest. A compaction row now has "Other window…", which opens the app menu (never a native select) with every value of the curve the card already replays. Each says its estimated extra tokens over the fewest (or "Fewest tokens" / "As few tokens") and about how many compactions it would have made over the range. The head says it is estimated from the reader's calls. The one picked is put in through /api/tune/apply like Use, with Undo. tune.Point gains compacts, counted by the same replayCompact that prices the point, so tokens and compactions come from one model. Run: go test ./internal/tune ./internal/gui; TestCompactCurveCountsCompactions (compactions fall as the window grows; the last point is close to Facts.Compacts). gofmt -l; go vet internal/tune on darwin, linux -tags nogui, windows. GUI: context-*, gui-zh-tw/ja/de, compact-at, click-scroll, i18n-keys in chromium and webkit, 144 pass. The new context-tune test covers 5 languages at 360 and 1100px: menu inside the window, 300K ticked, notes for 250K and 160K, picking 250K posts apply with no page scroll, Escape posts nothing. On HEAD~ assets context-tune fails 22 of 23. Not run: against a real Claude Code settings.json (the apply path is unchanged from Use). |
||
|
|
6e5f4fc97f |
gui: Tuned for you names its advice "Fewest tokens" and says a compaction window is a token estimate, not what the agent keeps (#1854)
cnlove7777777-art: the card called 230K -> 150K "best for you" on token savings alone, while compacting sooner may lose more of a long coding task. A retention benchmark isn't built now; the card says what it measures instead: - the advised value's label is "Fewest tokens", not "Best for you"; - a compaction row that advises a change adds "A token estimate only: it doesn't measure how well the agent keeps the task after a compaction. The lower the window, the more often it compacts." Not on a window already the leanest, nor on the cache lifetimes. - zh, zh-TW, ja, de translations; agent-wiring.md says the same. Run: context-tune.test.cjs (new assertions on label and caveat) passes in Chromium and WebKit, 360 and 1100 wide, en/zh/zh-TW/ja/de; on origin/main's assets it fails 11 of 12. context-*.test.cjs, gui-zh-tw, gui-ja, gui-de, compact-at, i18n-keys: 99 pass, 0 fail. Not tried in the real app window. |
||
|
|
31c1e3ab1c |
gui: dates, times and numbers read in the GUI's language, not the system's, so a Chinese Mac set to English no longer shows Routing's days as 10月11日 周日 (#1843)
What changed: intlLang() was the GUI's tag for Intl, but returned
undefined for English ("the system's own formats"), and about 60 calls
in app.js, routing.js, library.js, plugins.js, caller-keys.js and
context.js formatted with no locale, [] or undefined anyway. All of
those follow the system's locale, so with magpie set to English on a
zh-CN Mac, Routing's day pills read "10月11日 周日" (the report), and so
did request times, reset/until titles on Accounts and Usage, plugin and
library dates, the restore notice, and key rest times. Now intlLang()
always returns a tag: zh-CN, zh-TW, ja-JP, de-DE for those languages,
and for English the system's own English (en-GB keeps day-month) or
plain "en" on a system in another language. Every date, time and number
formatting call in the assets takes intlLang(); the `intlLang() || "en"`
and `documentElement.lang || undefined` variants are folded into it.
<html lang> stays "en" for English. Routing's clock formatters, made
once, are made again when the language changes.
Tests: dates-gui-lang.test.cjs runs English on a zh-CN browser, English
on en-GB, and zh, zh-TW, ja, de on en-US, in Chromium and WebKit at
1100 and 390px: Routing's day pills (in the bar and under its menu) and
a request's time must read in the GUI's tag and not the browser's.
TestDatesFollowGUILanguage (Go, so CI runs it) fails on any formatting
call in the assets given no locale, [] or undefined.
github-token and reset-each-title computed their expected text in the
browser's locale, i.e. they encoded the bug for zh/ja/de; they now ask
intlLang().
Run: with routing.js put back to origin/main the new GUI test fails 10
of 12 (all but en-GB, where the system's English is right either way);
with intlLang() returning undefined for English the English cases fail.
TestDatesFollowGUILanguage fails on origin/main's routing.js (lines 244,
688, 1925, 2230, ...) and passes on the fix. gofmt -l clean; go vet
./internal/gui on darwin, GOOS=linux -tags nogui and GOOS=windows ok;
go test -tags nogui ./internal/gui ok. Full GUI suite (621 files,
concurrency 6): 51 failures in 21 files; rerun alone, the same 8 files
fail the same way on an origin/main
|
||
|
|
18e82adc62 |
gui: the window's pages down a sidebar in groups, the open page's tabs under it, and a button to have the header's tabs instead
From 1024 points wide (SIDE_AT) the window lays its pages down the left as a Mac app's sidebar: Work (Agents, Sessions, Library), Models (Providers, Routing, Gateway), Insights (Usage), Extend (Plugins), with Settings and the gateway's address at the foot. The open page's own tabs (Usage, Library, Plugins, Settings) are listed under it, opening and folding on an iOS-like spring, and the page's strip is hidden. The header becomes a breadcrumb, and pages whose head held only tools have them in the title bar. Graphite: the open page is in the text's ink, not purple. A pressed row darkens and never shrinks. The selection under the tabs sets off as the row is pressed, on a 0.3s curve (it felt behind the finger), and is the list's only shape: a sub-row hovered or pressed has no ground of its own, which showed a block under the finger before the selection slid there. The page's tab is clicked at once, so what is typed next goes to it. The title bar's button (or ⌃⌘S, Ctrl+Shift+S), there at every width, picks the sidebar or the header's tabs. The choice is kept in localStorage magpie.navLayout (side or top) at every width, so it is laid out from the first frame; picked in a narrow window the sidebar is 184 points under 860. The two trade places in a view transition: the sidebar slides, each tab flies to its place, and the page slides as one. Without view transitions or under reduced motion, the change is at once. With nothing picked, narrower than 1024 the page beside a sidebar would be narrower than Usage's requests table needs, so the header's tabs come back. A resize drops what a click held (heldWidth). Usage's KPI strip goes two to a line by the room the page gives it (a container query), and Japanese counts wrap there. Tests whose window is 1024+ were updated for the sidebar, and docs/subsystems/gui-shell.md says how it works. Run: sidebar.test.cjs and side-toggle.test.cjs 16/16 in chromium and webkit, in en, zh, zh-TW, ja and de. Each was broken by hand (press shrink, address cut, press glide, sub-row ground, view transition, kept choice) and went red. Every page at 560 points with the sidebar picked, zh and de, both engines: nothing scrolls sideways. session-identity's ledger row sits under the footer beside the sidebar; WebKit's click doesn't scroll to it, so the test wheels it up first. Animation frames were checked from a recorded video. The 105 affected GUI files in both engines; their reds were rerun alone and fixed (filter-ime: the sub-row's click now at once; session-identity, above) or fail the same on main (tray-logos). The full GUI suite in chromium, on the rebase onto |
||
|
|
a98ab77fde |
gui, gateway: a context window's part, cell or item clicked opens the text the request sent there (masaka)
masaka on Discord asked to see the whole context behind the context window
card: click the agent's prompt, or any other part, and read it.
What changed:
- gateway: the trace keeps the last 10 request bodies in memory only
(promptBodies; at most 32 MiB each and 64 MiB together, oldest dropped
first), masked as the vendor got them. For a model the user let have
the request unmasked, the masked copy is kept all the same. Never
written to disk, never in telemetry. Route.Prompt and the routing
history keep names and sizes only, as before.
- gateway: Server.PromptText re-reads a part's items and their text from
that body (prompt_text.go). promptBuilder gains a keep mode that records
each item's pieces: system text, tool definitions laid out as JSON, each
turn's user/thinking/assistant/call pieces, tool results, and images
or sealed reasoning named with their size. Sizes are unchanged.
- gui: GET /api/context/text?id=&kind=[&item=] (no-store; 404 "not kept"
when the body is gone or another process serves the gateway).
- gui: in the card, a legend part, a waffle cell or a content row
(click, Enter or Space) opens a wide modal: one item alone with "All of
{part}", or the part's list 100 rows at a time, each item's text
fetched when it is opened and shown 20000 characters at a time, with
copy buttons. Strings in zh, zh-TW, ja and de.
- docs: gateway-routing and gui-shell subsystem pages; the site's start
page (en, zh, ja) says the text is kept for the last 10 requests in
memory and sent nowhere. The README Privacy is unchanged, since nothing
more is sent.
What was run:
- go test -tags nogui ./... (temp HOME). internal/gateway hit the 10m
default under the full parallel run, in TestRequestTailAfterOldLimit,
which takes 57s alone on the base commit too; the package run alone
with -timeout 30m: ok (700s, the machine shared with other runs). Every other package: ok.
- New tests TestPromptTextIsWhatWasSent, ...KeepsOnlyTheLastBodies,
...ChatPieces, TestContextTextAPI. Broken by hand: keeping the unmasked
body fails (the key shows), and dropping keepBody fails ("not kept").
- gofmt -l; go vet, GOOS=linux and GOOS=windows go vet on internal/gateway
and internal/gui.
- GUI: tests/context-text.test.cjs in Chromium and WebKit, en/zh/zh-TW/
ja/de, at 1100 and 420px: legend, row, cell and keyboard open the text,
long text grows on demand, the page never scrolls, and a gone body is
named. It fails with the click wiring removed. Under a load average of
~140 one case failed once: the test read the list while the dialog
still said "Reading…". Reproduced with a 400ms reply, fixed by waiting
for the list; the mock now always answers after 200ms. A second case
("a click doesn't move the page", 662 vs 605 on the contents row) came
from taking the page's top while a wheel scroll was still easing: the
test now wheels to the row like the other cases, and wheelTo waits for
three equal looks. Four full runs at load ~150 then passed (80 cases). context-window,
i18n-keys, held-animations and the modal tests (dialog-backdrop-drag,
editor-short-window, readable-focus, ux-safety, whats-new, add-sheet,
api-key-theme) pass in both engines.
- Real use: a sandbox magpie (own HOME, ports 3486/3487, the Codex login)
served a real `claude -p` (Claude Code) request on codex/gpt-6-luna
that read a file. In its web UI, Usage > Context: each of System
prompt, Tools, Memory, Files and Conversation, a waffle cell and a
contents row opened the request's real text (Claude Code's system
prompt, 21 tool definitions, the CLAUDE.md reminder, main.go's Read
result, the turn with its thinking and call). No page errors.
|
||
|
|
05ed5e69ba |
context: Tuned for you's curves draw themselves once, not again each time the pane is redrawn
The Context tab redraws the whole pane whenever the advice answers, the routing history answers, the state changes or a setting is put in. Only loadContext marked the pane "still", and only when a new history replaced an old one, so on opening the tab every curve played its entrance two or more times (the owner saw them play "好多次"), and the history's cards replayed theirs when the advice came in after them. renderContext now remembers whether its last draw showed the history and the advice: what was on the pane already holds still (.still for the history, .tune-still for the advice), and only what is new plays. A range change clears both, so the new range's draw plays once. Run: - new test "the advice's curves play their entrance once" (chromium, webkit): red without the change (8 draws of 4 curves in both), green with it. - context-tune, context-window, context-scroll-end, group-context, routing-ctx-fold, routing-ctx-still: all pass in both engines. - routing-context-fold: 2 WebKit failures, the same on origin/main without this change (the sticky header covers the fold button), filed as #1529. |
||
|
|
27e69702e1 |
context: Tuned for you draws each setting's cost as a curve over the advice, its waste shaded, the window set now saying how much more
The small sparkline had no scale: it couldn't show how much a setting costs over the one advised. The curve is now the row's width and measured from the advice's own cost (tune takes the largest window within 1% of the cheapest, so the cheapest point is not the level): the area over the advice's dashed level is what the other settings spend past it, the window set now and the costliest say how much more (+%), and the advice is marked Leanest. The cache lifetimes get the same chart for their two choices, and it shows at a phone's width too. The section note sits closer to its heading and further from the cards. Run: context-tune.test.cjs in Chromium and WebKit, every language, phone and desk widths (22/22), with checks on the set window's +% and the advice's level; a shot of the owner's real 7-day /api/tune. |
||
|
|
9e665491ec |
context: Tuned for you — each agent's settings worked out from the user's own calls, for the fewest tokens, put in on a click and undone on another
The Context tab now replays the period's calls of each agent against the
settings that decide what they cost, and shows, per agent and per model,
the value that would have used the fewest tokens for how this user works:
Claude Code's auto-compact window per model (modelSettings.<model>.
autoCompactWindow), its main and subagent prompt cache lifetimes
(promptCacheTtl, subagentPromptCacheTtl: 5m or 1h), and Codex's
model_auto_compact_token_limit. Each row says where the value comes from
now (the agent's default, the user's own setting, one magpie set, or a
variable that comes first and locks it), why (how fast conversations grow,
what a compaction leaves, how long the user pauses), the cost curve, and
the saving. Nothing is written until "Use …" is clicked; what was there is
stashed and Undo puts it back, unless the user changed it since. A window
the user set past the model's own is shown capped, as Claude Code caps it
(min(setting, model window)), so no saving is claimed that wouldn't happen.
Advice under a 3% saving is "already the leanest".
On the owner's 7 days (88K Claude Code calls, 956 Codex): opus keeps 200K
(their 500K is capped to it), fable 5.1 200K → 160K saves 5% (2.56M
tokens), both cache lifetimes and Codex's 272K are already the leanest.
Run: go vet ./... and go test ./... pass (internal/tune, internal/agent
TestTune*: user-set values kept, env locks, undo after a user edit, TOML
key order). context-tune.test.cjs passes in Chromium and WebKit, en/zh/
zh-TW/ja/de, at 360 and 1100px (22); context-window, context-scroll-end
pass. Full GUI suite: library-servers-bulk and market-have failed once
under load and pass alone; market-have fails on origin/main
|
||
|
|
666c0fa4fd |
routing: the context window holds still while requests stream in, and the prompt-cache card shows the last request's hit, dimmed, or a dash with the reason instead of "——命中" and an empty bar (dumplings on Discord)
dumplings reported that on Routing, every new request made the context
window jitter and flash, and that the prompt-cache card read "——命中",
glued together, with an empty bar under it.
Causes, measured with a frame sampler while requests stream through
start/read/done:
- A live request's story is shorter than a finished one's. "Is
answering…" becomes "answered in 4.0 s…", which wraps onto two lines
at phone width. The log head also gains View usage and Replay once the
request is done. So the card under it moved up and back down on every
request: 45px at 420px wide, 6px at 900px.
- The state pill ("Live" or "Counted") changed width, which moved the
model name beside it by about 11px.
- While a request was under way the cache card dropped to "—" with a
0% bar, then came back. That was the flash.
- A flex item's leading space is dropped, so " hit" and " / 272K" were
glued to the figure before them.
Fix:
- routing.js holdStory keeps the log head and steps at the tallest
height seen while following live, at this width and language. A
picked request, a replay or a past day is drawn at its own height. A
ResizeObserver on the steps measures again as soon as the width
changes. Without it, a scrollbar appearing before the first request
left a stale height and a 6px shift (seen in WebKit under load).
- context.js stacks all three state words in one grid cell and shows
only the current one, so the pill keeps one width.
- While the next request is under way, the cache card keeps the last
request's figure, dimmed (.was), with "The last request's · this one
is on its way". When there is nothing to show, it gives a faint "—"
and the reason ("Read once the vendor answers" or "The vendor didn't
say"). The bar stays hidden but keeps its space. The remembered
figure resets when the agent or session changes.
- .ctx-big gets a gap. Width and opacity transitions are turned off
under reduced motion.
- The three new strings are added in zh, zh-TW, ja and de.
Verified:
- The new tests/routing-ctx-still.test.cjs streams two requests and
checks that the card, model, state, used, cache, figure, bar, grid,
legend and foot rects never move by more than 0.5px. It also checks
the figure-to-word gap and both empty states.
- It runs in Chromium and WebKit, at en 420/1100, zh 420/1100,
zh-TW 900, ja 900 and de 420. It narrows the viewport by 10px after
load.
- On the old assets it fails 16 of 16 (the card moves 6–52px). It also
fails with only the ResizeObserver removed.
- routing-live-patch now expects the held figure ("97%") on live steps
instead of "—".
- Under --test-concurrency=4 in both engines: 578/578 pass across
routing-*, context-*, click-scroll, group-context, panel-routing and
gui-de/ja/zh-tw.
- go test -tags nogui ./internal/gui passes.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui are
clean.
|
||
|
|
c17cbfa161 |
routing, gui: the folded context window shows a thin bar of what fills it beside how full it is, one line high whatever a live request puts in it, and a request opened from the Usage page's Context tab shows its card unfolded, it alone (PILIPALA @NXirg2 on X, Jeremy.Zhou on Discord)
On af798bd1's fold: folded, the head carries a bar of the window's
parts (system, tools, memory, files, results, chat), morphed with the
head so a live request changes its widths only; the folded head is
pinned at the open head's 20px and doesn't wrap. "Latest request" and a
point of the session line on the Usage page's Context tab open the
request with { context: true }: its card shows unfolded for it, the
next request takes the reader's choice (magpie.ctxShut) again, which is
left as it was; folding that card by its title keeps it folded.
routing-context-fold (new): folded at 1920x1080, 1440x900 and 440x900
in en, zh and de, one line with the bar, the stage and (at 1440 and
wider) the request list in view, nothing running over; opening doesn't
move the page; the Usage page's request opens unfolded for itself only.
routing-live-patch's folded cases: the card, head and bar are the same
nodes across live requests and the card's height never changes. Both
fail on af798bd1's assets. No new strings.
|
||
|
|
af798bd1bf |
routing, gui: the context window's card folds to its head, with how full it is beside the title ("114K / 272K · 42%"), and stays folded for the next request and after the page comes back, so the request list under it has the room (0xBCD18E on X: 这个"上下文窗口"的板块非常占"上下"高度,还不能折叠,下面只能展示三行)
ctxCard takes opts.foldable (Routing passes it; the Usage page's cards don't): its title becomes a button with a chevron, aria-expanded, and a click toggles .shut on the card, which hides all but the head. The choice is kept in localStorage (magpie.ctxShut). The head is morphed in place, so the click reads the button from the event, and the card that is there keeps .shut across live patches; a new card takes it from the saved choice. Verified: routing-ctx-fold.test.cjs (new), at 420 and 1100 wide in Chromium and WebKit, 3/3 each: open, then folded to one line (<60px) with the figure, the list under it up by >200px, nothing runs over at 420px; another request picked is still folded; after a reload still folded; opened again, 400 cells and the same height as before. It fails on the old code (no .ctx-fold). routing-*, context-*, usage*, group-context, click-scroll, panel-routing, old-webkit, gui-ja/de/zh-tw: WebKit 371/371; Chromium 370/371 once at --test-concurrency=4, routing-blocked's "picking the request moved the page", which passes 3/3 alone and in two more routing-* runs at the same concurrency (196/196 each). Not filed as caused by this change; seen once under load. |
||
|
|
3d34c2d747 |
routing: live, the next request is patched into the context window that is there, so its cells don't come in again and the card no longer goes and comes back, moving the request list under it (Zhenzhen on Discord)
Each new request in a session emptied the card while the gateway read its prompt (the box collapsed to 0, everything under it jumped up), then drew a new card whose 400 cells scaled in again, then a third card when it was done; a request under way had no Prompt cache stat, so the grid moved again when it came. Now ctxCard returns a card with ctxUpdate: the grid's cells are made once and only their classes change, the head, stats, legend, contents rows and foot are morphed in place, and an under-way request keeps the cache stat's place with "—". Routing patches the live card, keeps it in place while a live request has no prompt yet, and still draws a request the reader picks afresh. Verified: routing-live-patch.test.cjs (new) feeds two requests in three steps each, at 420 and 1100 wide, in Chromium and WebKit: the old rows, card, grid, cells, legend and contents rows stay the same nodes, the grid and card keep their height on every ResizeObserver frame, the view never scrolls. Without the change it fails: the card reads '' while the request is under way, the card/grid are new nodes, the box goes 884 -> 0 -> 789 -> 884. routing-*, context-*, click-scroll, panel-routing, old-webkit, gui-ja/de/zh-tw, usage* pass in both engines; go test ./internal/gui and GOOS=linux/windows go vet pass. |
||
|
|
0b7a740ee6 |
gui: Usage's Context tab names its agents when the state answers after the routing history, not by their ids until the history changes
context.js draws each agent card and session row with the agent's name and
icon from the state (agentLabel, agentIcon). When /api/context answered
before /api/state, the cards were drawn by the agents' ids ("claude", a
generic icon). The state's arrival calls loadContext again, but a read that
brought the same history returned early ("the same answer keeps the pane"),
so the ids stayed until the history itself changed.
The "same answer" key now holds what the pane is drawn with besides the
history: each agent's id, name and icon from the state. Once the state is in
the pane is drawn again (still, without its entrance animations); a refresh
with the same history and the same agents still keeps the pane.
This is one of context-window.test.cjs's failures under load and alone: its
Claude Code card is found by hasText "Claude Code", which the card titled
"claude" never matches (":129 locator.innerText: Timeout 5000ms ...
.ctx-agent hasText 'Claude Code' .ctx-grade-word"). "codex" matched "Codex"
since hasText ignores case, which hid it on the other card.
New test in context-window.test.cjs: /api/state is held until the two cards
are drawn, then they must read "Codex, Claude Code".
Run:
- New test on origin/main
|
||
|
|
6485f5ecb5 |
gui: the Routing page, and Usage's Context tab with a session open, scroll to their end in WebKit: their narrow and wide layouts go by classes set from each box's width, not container queries (#1249)
In WebKit (the macOS app's WKWebView, and Playwright's WebKit) the Routing page stopped well short of its bottom (wizzy-yang on #1213). Each time the page was drawn again while it was scrolled near its end, WebKit cut its scrollTop back to a shorter range. The page has query containers in it (.rt, .rt-accts, .rt-more, .rt-col), and the cut happens during a redraw. Seen at 440x620: 575 of 585, and up to a whole screen short when a part was redrawn. Chromium is unaffected. With container-type set to normal on those boxes the page reaches its end, and the cut goes away. Replacing a container with its clone at the end reproduces it in WKWebView too. Each box's width now sets a class, the same way container queries would have chosen a layout: - routing.js sets the classes from a ResizeObserver: max560 on .rt and .rt-accts, max460 on .rt-accts, max520/min1150 on .rt-more, and max440/max760 on each .rt-col. - context.js does the same for each .ctx-card: max520 and max420. - A rule that names the box goes through :where(), so it keeps the specificity it had inside its query. - The class is set on the next frame, as quotaFit does: set in the observer's own call, it changes the box's height, and WebKit reports that as a ResizeObserver loop. - A redrawn ctx-card starts with the width the last card in its place had (routing or session). It doesn't lay out wide for a frame and then narrow, which would itself pull the page up. - The Safari 15 @supports fallbacks are dropped. They chose a layout by the window's width, and ResizeObserver covers that Safari. Sibling: Usage → Context, with a session open, has the same bug. Each timed read redraws the card, and WebKit pulled the page up by up to 946px at 420 wide (682px at 1100). It is fixed the same way. The other query containers were checked at their end with a synthetic redraw and were not affected: Library's .lib-row.with-agents and Agents' .row.agent .who. Sessions (.sess-pane) also jumps in WebKit as it refreshes, but it still does with its container removed, so the cause is something else. It is left alone here. Run: - routing-scroll-end.test.cjs (new): 440x620, 600x700, 900x500, 1200x600 and 1400x700, en and zh, Chromium and WebKit, with the trace redrawing the page. It also checks the stage, request and column layouts. On the old CSS all 10 WebKit cases fail (twice); with the fix it passes 22/22 (four runs). - context-scroll-end.test.cjs (new): 420, 700 and 1100 wide, en and zh, across a timed read. On the old CSS the WebKit cases fail ("958 of 1891"…); with the fix it passes 14/14. - Layout compared with the old CSS: every element's rect on the Routing page (group editor closed and open) and in the Context card. Widths 360–1700, en/zh/zh-TW/ja/de, Chromium and WebKit: 220 + 100 configurations, none differ, and there are no page errors. - The macOS WKWebView: a part redrawn at the end left the page 200–238px short before the fix and 0 after, at 440 and 1100. - gui-ja, gui-de, gui-zh-tw and i18n-keys pass. - Full GUI suite (concurrency 4): 3719/3733. - Pass alone: azure-endpoint, remote-magpie, signin-again and routing-sessions. - mobile-web compares with origin/main, which had moved on; against this commit's parent it passes. - panel-arrange fails the same way on the parent. - context-window's chromium 1100px hover flakes under load on the parent too: 5 of 16 parallel runs, against 1 of 16 here. - go test ./internal/gui; GOOS=linux and GOOS=windows go vet ./internal/gui. Not run: the reporter's own machine, or an old Safari 15 WebKit. |
||
|
|
fd29653d4e |
context: a window opened on the Context tab loads it at once, not at the refresh's first tick five seconds on
context.js comes after app.js, and app.js shows ?view=usage and reads the state before context.js is there: when /api/state answered first, both paths called window.loadContext while it was undefined, the TypeError went to the status line, and the tab stayed empty until the 5s refresh (found as context-window's webkit de 1100px flake, 2 of 6 runs). The calls are optional now, and context.js loads the tab itself when the page opened on it, as plugins.js and library.js do. The new test holds context.js until the state has answered: it fails on both engines without the fix and passes with it; context-window passes 22/22, the case that flaked 10/10. |