Why: the filter matched only titles, folders, ids and models, and a
session the gateway recorded was listed under its bare ses_… id, so one
couldn't be found by anything a person remembers about it.
What changed:
- sessions.GatewayTitle: the first user text of a recorded session (not
a <…> context tag, # AGENTS.md or an image), made one line. It reads at
most 8 complete turns of the oldest file of it, caches a finished
file's answer by path, and costs one stat when nothing is recorded.
gatewayListed applies it in every list (/api/sessions, /manage, /one,
the stats summaries); ExternalSession gained Title.
- GET /api/sessions/search?agent=&q= (searchSessions): an agent's
sessions, newest first, read by up to 4 workers, each only to its
first match. Native files go through a byte prefilter (mayHold: the
query's longest word, ASCII case folded without a copy, 1 MiB chunks,
skipped for zstd and for queries JSON may escape), and of a Claude or
Codex file only the lines holding every word are decoded
(readTranscriptOf; claudeContentOf/codexContentOf take an optional
line test, nil for every other caller); gateway sessions, and an
unreadable agent's sessions (unread: true), through their recorded
transcript. System prompts, tool definitions and images never match.
It stops at 200 hits or 8s (cut, searched of total) and when the
request's context ends. Each hit carries the match with 36 runes
before and 120 after.
- sessions.js: the field says "Search sessions"; title/folder/id/model
matches show at once, the server is asked 300ms after the last
keystroke, a new query aborts the request in flight and its answer is
dropped, under 2 letters asks nothing. A session found shows a line of
the words round its match with the match in <mark> (text nodes, no
innerHTML). A note says when it is searching, cut short, failed, or
limited to recorded text. New strings in zh, zh-TW, ja and de.
- docs/subsystems/gateway-sessions.md describes both.
Run:
- Go: TestSearchSession* (snippet, case and line breaks, said text
preferred over a tool call, cut ends, cancelled context, a Codex file,
only matching lines decoded: 1 part of 3), TestContainsFold,
TestMayHoldSkipsAFileWithoutTheWords (incl. a match across chunks),
TestGatewayTitleAndSearch (context tag and system prompt skipped),
TestSessionsSearchFindsGatewaySessionsByWhatWasSaid (endpoint + manage
titles), TestSessionsSearchStopsWhenItsRequestEnds. Without the
endpoint/title they fail (404, id as title).
- GUI: new sessions-search.test.cjs in chromium and webkit, en/zh at
1100, zh-TW/ja at 560, de at 420: title shown, one letter no request,
one debounced request, snippet mark, cancelled earlier request never
shown, cut note, empty state, Escape, every language's strings, no
overflow; 12/12, and 0/12 with the old sessions.js. The sessions-*,
sess-*, session-* and i18n-keys tests pass in both engines
(sessions-manage's placeholder updated to "Search sessions").
- gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./..., the builds: clean. go test -tags nogui
./... at load ~25-60 (other sessions' runs): every package passed but
internal/agent and internal/gateway, which hit the 30m timeout; run
again alone, agent passed and gateway's only red was
TestOTelWaterfallIncludesUnbilledFallback, filed as #1794 (passes
alone, -count=3).
- Real data, read-only (a temporary probe, not committed, pointed at
the owner's ~/.claude and ~/.codex; one worker, 8s, load ~50):
Claude, 58 sessions / 3 GB: before the line filter one 1.3 GB session
took the whole 8s ("redis": 1 of 58); after, all 58 in 4.7s ("redis",
13 hits), 7.4s ("gateway session"), 2.8s (no match). Codex, 11534
sessions / 65 GB: 245-656 sessions in 8s either way, which is what
the cut note ("latest n of total") is for.
Not verified: the endpoint and page against a real recorded gateway
store (only fixtures and temp homes); the timings above were taken on
a machine at load ~50 and vary run to run.
With thousands of sessions the Sessions page drew every row of the open
folder, 17,000 elements for 1,000 sessions, and drew them all again on
switching to the page or to another agent, on each keystroke in the filter
(every folder opens while filtering: 51,000 elements for 3,000) and on
opening a session. Switching and scrolling stuttered.
Now an open folder draws a page of 100 and a "Show N more" (data-unrolls)
that adds the next page under the rows already drawn. A filter or another
agent starts again at a page. A session opened from the Usage page is drawn
however far down its folder it is. Opening a session replaces only that
item and the one it closes. The folder box and the bar still pick every
session, drawn or not.
Measured with 3,000/2,500 sessions, before → after:
- open the page: WebKit 449 → 159 ms, Chromium 312 → 165 ms
- open a session: WebKit 287 → 67 ms
- filter keystroke: WebKit 546 → 64 ms
- elements drawn: 17,073 → 1,774
Run: sessions-manage-paging.test.cjs (new; Chromium + WebKit, en + zh,
1000px + 380px) and every sessions-*/session-* test, click-scroll and
old-webkit, all green.
What changed: c9b82633 (#1355) put a bare "Record gateway conversations"
checkbox and an unlabelled trash icon on lines of their own under the agent
tabs, on every agent. They are now one card in the list's column, as wide
as the list: a switch (the app's lib-switch), its title, and a line that
says what is kept and where ("on this computer only, for up to 7 days
(256 MiB)", worded for on and off). "Delete saved conversations…" sits in
the card, says what it deletes, and asks in magpie's own dialog as before.
The card shows only where it applies: on an agent whose list has gateway
sessions, in gateway mode, or while recording is on or text is kept; not on
an agent without gateway sessions, nor in the Trash. The delete shows only
while some text is kept.
To know that, /api/sessions/manage marks gateway-only rows `gateway` and
says `recorded` (sessions.HasGatewayConversations: any file under
gateway-conversations; a folder that can't be read counts as holding some,
so it can still be cleared). New strings in zh, zh-TW, ja and de.
docs/subsystems/gateway-sessions.md says where the switch is and when it
shows.
Why: lee (Discord feedback, 1558248607751344220) said the controls' look
and place need a redesign: they read as stray, unaligned controls, and the
icon didn't say what it deletes.
Run: gofmt -l (nothing); go vet, GOOS=linux go vet -tags nogui,
GOOS=windows go vet (with and without -tags nogui) on ./internal/gui/...
./internal/sessions/...; go test ./internal/gui/... and go test -tags nogui
./internal/gui/... ./internal/sessions/... under a sandbox HOME: ok.
GUI: gateway-conversations (both tests, en/zh/zh-TW/ja/de, 1000/1400 and
390px) plus checkbox-look, click-scroll, gateway-mode, i18n-keys,
old-webkit, sess-agent-strip, every sessions-* test and
usage-sessions-agents-fit: 221/221 (default run) and 114/114 with
BROWSER=webkit. Not run: the whole GUI suite.
Fails without the change: with origin/main's sessions_manage.go,
TestGatewayConversationAPI fails "listing: …" (no gateway/recorded); with
origin/main's sessions.js/.css, every gateway-conversations case fails
(no .sm-record switch; "no bare checkbox bar under the tabs 2 !== 0").
What changed: the Sessions page lists sessions seen only through the
gateway (from the usage ledger, read-only, a native session of the same id
wins), and shows in gateway mode. A Sessions switch, off by default and
confirmed before it turns on, records each gateway exchange's text under
the config dir (scrubbed, at most 7 days and 256 MiB, cleaned hourly).
Settings sync and restore can't turn it on; POST /api/sessions/recording
turns it on or off and can clear what was kept.
Why: users of magpie as a gateway (gateway mode, LAN clients) had no way
to see their conversations; the owner chose this design on the PR.
Squashed from PR head 6a343ba1 onto origin/main. Conflicts: gui-shell.md
(kept main's placeMenu text, took the PR's Sessions in gateway mode) and
settings_keep_test.go (main's fields plus GatewayConversations).
Run: go build ./..., go vet on gateway, gui, sessions, settings, usage;
go test -race -timeout 900s on those five packages: all ok.
Beside Show conversation, Export Markdown saves the whole conversation
(Claude Code, Qoder, Codex, Pi, oh-my-pi: every agent whose transcript the
page can show) as a Markdown file: a heading with the session's agent, id,
folder, times, models and file, then each turn under User / Assistant, a
tool's call by its name and arguments, its result, thinking and the agent's
own notes folded in <details>. Parts are kept whole (the page's 8000-char
cut doesn't apply), fences grow past any backticks in the text. In the app
it goes to Downloads (never over an earlier export) and the status says
where; in magpie web the browser downloads /api/sessions/markdown. The
session is found as listed, never a path from the page; the file is only
read.
Verified: TestMarkdownClaude, TestMarkdownCodexAndPi, TestMarkdownUnsupported
(sessions) and TestSessionExportMarkdown (gui) under a temp HOME. Without the
routes TestSessionExportMarkdown fails "export: 404 404 page not found";
with the page's per-part cut TestMarkdownClaude fails on the long part.
sessions-export.test.cjs (Chromium+WebKit, en/zh, app and web, 560px) fails
on origin/main's sessions.js waiting for .sess-export; passes with it, as do
sessions-talk, gui-ja, gui-de, gui-zh-tw and i18n-keys. Exported real
Claude Code, Codex and Pi session copies: fences balanced, turns in order.
go vet (darwin, GOOS=linux, GOOS=windows) -tags nogui on both packages.
* gui: choose installed interface and code fonts and styles
Discover installed styles through DirectWrite, CoreText and Fontconfig. Keep choices per computer, apply them before paint and notify both desktop webviews after saving; defaults retain platform and Omarchy fallbacks.
Verified seven focused Go tests, including real Windows discovery (90 families, 276 styles), 14 font browser cases in Chromium/WebKit, 68 settings/zoom/Omarchy/web cases, go vet, Windows amd64/arm64 and Linux nogui builds. Against the original assets, the new UI test fails with Settings must offer an interface font picker (0 != 1). Full Windows suites have separately reproduced upstream failures; macOS/Linux native discovery is covered by the added CI step.
* gui: retain bundled Mac fonts and variable style precision
Only filter an undownloaded CoreText face when it is explicitly downloadable; bundled fonts are installed without being downloaded. Use resolved font names when descriptors omit them. Preserve fractional weights and nonnegative CSS widths for named variable styles.
* gui: restore the authored font cascade when returning to defaults
Apply family-only trait overrides only while a custom face is active. The browser regression catches code under a bold parent becoming 700 instead of its original 400. Keep the compatibility shim first, and apply boot fonts before visible content.
* gui: keep font picker review separate from CI integration
Leave the native test sources and manual verification command with the feature. Move the added workflow step to a follow-up so the font picker can take the normal review path requested on PR #1007.