Commit Graph
4 Commits
Author SHA1 Message Date
yetone e0cadc3124 memory: goes with backups and sync, and suggests what holds everywhere or is a skill (P5)
Backups and sync. memory.json goes in every backup and in the WebDAV,
S3 and GitHub sync, under its own toggle (on unless turned off, as the
library is). A sync merges memories one by one (memory.Combine): the
newer change wins, a memory the user edited or pinned is never taken
over by one they didn't, an archived one is kept 30 days and the
suggestions turned down are joined. Settings > Sync has a Memory tick,
and the description lists memory.

Promotion. Library > Memory (In use, no search) shows what memory
suggests: a project memory that says the same in two or more projects
(the same text, or 60% of its words with 6 or more on each side), or
whose sources came from two or more, is offered as global; a procedure
searches returned 5 or more times is offered as a skill. Taking a
global one keeps the user's own or pinned memory first, then the most
used, makes it global and supersedes the rest (into a global with the
same text when there is one). Making a skill writes a library skill
from its text and why, named from its first words (procedure-<id> for
one in Chinese), for the agents ticked for instructions, and archives
the memory. A suggestion declined isn't made again, and that goes with
sync too. Routes: POST /api/memory/promote, /skill, /decline.

Docs: docs/subsystems/memory.md (Backups and sync, Promotion),
docs/subsystems/sync-backup.md.

Pushed on origin/main 14be7f69d, whose 5 commits since 8b2fb6b08 share no
file with this one (not run again). At 8b2fb6b08: i18n-keys, library-memory-suggest and
webdav-settings-refresh on WSL in both engines, and -run
"Memory|Skill|Market|ThirdParty|Promote|Suggest|Sync|Combine" of
library, memory and backup on Windows: ok. One rebase before, at
origin/main 69453574d: go vet of gui,
memory, library and -run "Memory|Settings|Parity|Budget|Skill|Promote|
Suggest" of gui and memory on Windows: ok; i18n-keys, library-memory*,
the five sync files below and sync-own-fields, library-backups-top on
WSL in both engines: ok but webkit s3-sync (below).
Before the rebase, Go code the same as at the run on the Windows box
(xiaomi-gpu, win-run; mote's disk is full, every run there stalled):
- go vet ./... (windows) and GOOS=linux go vet -tags nogui ./...: ok.
  gofmt -l: clean.
- go test -count=1 ./internal/memory ./internal/backup ./internal/davsync
  ./internal/memdistill ./internal/memembed: ok.
- ./internal/library: ok but three tests red on Windows that are red the
  same on origin/main d936be763 run alone there and are filed:
  TestPluginImportCarryOnOffRemove (#6065), TestGoneAgentListedToTakeOut
  and TestCheckMixedServerEachSide (#4115). -run "Memory|Skill": ok.
- ./internal/gui ./internal/cli -run
  "Memory|Settings|Parity|Budget|Distill|Dream|Skill|Promote|Suggest": ok.
GUI on the WSL box (magpie-desktop), chromium and webkit:
- library-memory-suggest (new), library-memory, library-memory-select,
  i18n-keys, sync-own-fields, sync-not-backup, auto-backup,
  library-backups-top, library-bar-more, login-export, login-import: ok.
- every sync-*.test.cjs, github-sync, s3-sync, usage-computers,
  webdav-settings-refresh, refresh-page, old-webkit: ok but
  old-webkit's two reds, the same on main and filed (#6030, #5919), and
  webkit s3-sync's "picking S3 must not scroll the page" (the page is
  at 0 after the click), red the same on origin/main 1ccacad63 2 of 2 at
  --test-concurrency=2 one step later ("picking S3 again", #3413).
  github-sync, s3-sync, sync-signins, sync-other-kind and
  webdav-settings-refresh were rerun after their expected bodies and
  descriptions took memory: ok in both engines.
Broken by hand: Suggest without the Declined filter turned
TestSuggestSkillAndDecline red, and keptFirst without the Fixed order
turned TestPromoteKeepsTheUsersOwn red; restored.
Not tried: a real sync between two computers with real memory, and the
GUI on macOS (mote's disk is full).
2026-11-11 15:08:58 +08:00
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone d26c5b14df gui tests: github-sync wheels to the first row's Edit and the form's Turn on, which WebKit never scrolls to (#1130)
magpie moves the page only for the reader (scrollOnPurpose), so in WebKit
the click on a row scrolled out of the window found it "outside of the
viewport" and timed out: 8 of 15 WebKit cases failed on the PR as
submitted. The test now wheels back up before Edit and down to the bar
before the refusal case's Turn on.

Run: github-sync in WebKit 15/15 (8 red before), and with the other sync,
i18n and language tests in Chromium and WebKit 72/72.
2026-10-13 15:25:11 +08:00
bingqilinweimaotai 1af326806f sync: magpie's setup syncs to an encrypted file in a GitHub repository, beside WebDAV and S3 (#1130)
A third sync kind: github://owner/repo[/folder] keeps the same sealed
backup WebDAV and S3 keep, as <folder>/magpie/magpie.magpie-backup in a
repository the user already has, written through GitHub's Contents API
with a fine-grained token of its own (Contents read and write), kept in
sync.json apart from the library's GitHub token. The token goes only to
api.github.com: a redirect anywhere else is refused, and the passphrase
may not equal it. Each update is a commit; an empty repository is
initialised by the first backup. Settings › Sync gets a GitHub kind with
Repository, Branch, Folder and token; magpie github mirrors magpie s3.
Inactive servers of every kind are kept in Config.Servers (Other stays
for older clients).

Squashed from yetone/magpie#1130 at 6b5b1c693e1a3a23e177b4d376f3f7f70f3bc23d
onto main. Merge resolutions: the CLI moved to internal/cli since the PR
was cut, so github_cli_test.go moved there (package cli) and the github
command, its help line and `magpie help github` were wired in
internal/cli/main.go and help_cli.go; README's Sync row kept main's
links and took the PR's wording; i18n.js zh-TW kept both sides.
2026-10-13 15:25:06 +08:00