e4e9eb0928becfa4e48484dde85ef5032671d582
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
459d668b35 |
sync: pick what syncs, preview a sync, undo the last one (#6428)
jinpwng (#6428, on X) syncs two computers and wants only Library and memory to go between them: each keeps its own providers, settings and models. They also want to see what a sync would change before it applies, and to roll the last one back. What syncs: providers, settings and profiles now have switches like agents' models, library and memory (Config.Providers/Settings/Profiles, *bool, nil = synced as before, so an existing setup syncs exactly what it did). The sync form shows Providers (and its API keys), Settings and Agents' models up front; Profiles, usage and sign-ins sit under Advanced, closed unless one is set away from its default. The form sends a part's choice only when it is or was off. A part left out stays as it is here and on the server; turning it back on joins it like a first sync (st.Off, rejoin). The sync's line says which parts each computer keeps ("Stays as it is on each computer: ..."). The setup text and the CLI carry it: magpie <webdav|s3|github> set providers=no settings=no profiles=no. Preview: davsync.Preview (plan.go) says, per part, what syncing now would bring in, send up, or leave; library items and memory files by name, sign-ins and plugins gone. Preview... in Settings > Sync shows it, and Sync now from there runs SyncPreviewed(token): if the server or this computer changed since, it says so and shows the new plan instead of syncing something else. CLI: magpie <kind> preview. Undo: a sync that brings parts in records them (st.Applied) and keeps a sealed copy of this computer first (keepSealed, as Restore does). Undo the last sync puts those parts back from that copy, on this computer only (st.Local, so the next sync sends it up rather than fetching the server's again). If one of them changed here since, it asks first (409 changed, Undo anyway). CLI: magpie <kind> undo-sync [anyway]. Restore's own Undo is unchanged. docs/subsystems/sync-backup.md and the site's sync docs (en, zh, ja) have a section on it. i18n: zh, zh-TW, ja, de. Run (worktree at base |
||
|
|
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 |
||
|
|
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). |
||
|
|
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. |
||
|
|
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. |