@Luxzinw on X asked for three things: sync billion-context's config,
edit its settings in the Library's billion-context tab, and have running
bili proxies reload after a change.
Sync. billion-context.json goes in the library part (library.Bundle.Bili),
by sync and backup file alike. magpie finds it the way bili's
src/paths.ts does: BILI_CONFIG_FILE, else $XDG_CONFIG_HOME (or
~/.config, %USERPROFILE%\.config on Windows), then
billion-context/billion-context.json.
- The text is carried as written, comments kept.
- magpie's summary recipe is carried at the canonical gateway address
and localized to this computer's gateway when written, so two
computers on different ports don't trade it back and forth.
- A newer local file is never blindly overwritten. Before a carried file
replaces a different one here, this computer's copy is kept with the
backups.
- An unreadable file, or one over 1 MiB, counts as unknown and is never
carried as empty. A bundle without the file leaves this computer's
alone.
- A file naming a DSN is left out of keyless backups.
- The credential store (<config>.summary-credentials.json) never
travels.
- A library with no such file hashes as before.
- The new sync preview names the file when it would be added, changed
or removed.
Settings. GET/POST /api/library/bili/settings, and a Settings section
under the agents in the tab:
- In front: "Summarize with a fast model" (externalSummary), picked from
the app's menu, never a <select>. It offers magpie's served models and
the file's own recipes. "Fold only when nudged" (requireNudge) and
"Nudge every N tokens" (nudgeGrowthTokens).
- Under Advanced, collapsed: the compression philosophy
(prompts.compressPhilosophy with acknowledgePromptsRisk, which bili
needs before it reads a prompt override).
Writes go through edit.PatchJSON and temp+rename, so unknown keys,
comments and the BOM are kept. bili disables its whole compress section
on one bad value, so magpie writes only values bili accepts. A magpie
model becomes a providers.magpie recipe whose key is saved in bili's own
credential store, the way bili writes it (0600, O_EXCL .lock,
temp+rename). A user's own providers.magpie is never taken over. A file
bili can't read is said so and left alone.
Reload. After a change, and after sync writes the file, every running
bili on loopback is sent POST /__bili/config/reload. bili reloads routes
and compress there. The status line says whether it did, or that the
agent needs a restart.
Also: agentenv.Vars clears BILI_CONFIG_FILE in sandboxes, and the
settings-parity list names the two routes for stage 3, as the other bili
routes are.
Run (mica, macOS):
- At abcbc632e, this change on origin/main 9a8219237. The three commits
main gained before the push (e8001f73a, 7af7a3aba, 005178104) touch
none of these files:
- go test -count=1 -timeout 45m ./internal/agentenv ./internal/agent
./internal/cli ./internal/library ./internal/gui ./internal/davsync:
all ok;
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./..., go build: ok;
- gofmt -l: nothing;
- library-bili-settings, library-bili, i18n-keys and sync-scope
.test.cjs, Chromium and WebKit, every language, 1100 and 420 wide:
ok;
- library-bili-settings was red in WebKit 1 run in 4: the tab was
clicked by its index in a list read before the sidebar drew its own
list, in another order, so the click reached another tab. A dump of
the page at the miss showed Instructions still open. Both files now
click the tab by its name. library-bili.test.cjs did the same twice
and is changed with it. After the change: WebKit 6 runs in a row and
both files in both engines, all green.
- Full go test ./... at an earlier base, 7eecbcc56: only
TestFolderVarsAreListed and TestEveryRouteHasACommandOrIsNamed went
red, both guard tests for this change. They are fixed here and pass in
the run above.
- Whole GUI suite at that base: 71 reds, none in the Library, i18n or
sync. Each also fails without this change on origin/main 459d668b3
(68 there, and the rest pass at this head):
- agent-details-ready: #6369, #6373
- api-key-theme: #6444
- account-arrange: #6010
- agent-switch-accounts: #5925
- aside-native: #6212
- agent-menu-label: #6371
- account-refresh-holds: #5814
- bark: filed as #6543
Broken by hand:
- Collect not carrying the file: TestBiliFileCarried red.
- The model pick without summary, or Advanced not kept open: the GUI test
red (22 of 32).
- On the old code the new Go tests don't compile, and the route test
gets 404.
Not tried: a real bili proxy reloading. The reload is tested against a
fake /__bili/config/reload, and bili's source was read, not run. Not
tried with a real WebDAV/S3/GitHub server between two computers either:
the davsync tests use the fake server. When a running bili doesn't reload, the status
line says to restart the agent.