1ccacad63281094de8a3372d5a507d38f9969e5c
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ff7d84b9b2 |
gui: a built-in's switch, settings and page lead to each other (netube99 on X)
netube99 (X, 2119721422918742222): masking is switched on in Plugins ›
Built-in, set in Settings › Privacy and seen in Insights › Masking, and
none of the three leads to the others. Web search had the same split.
One pattern for every built-in whose switch, settings and page are apart:
- pluginrt.Manifest.SetAt ("privacy #redactList") says where Settings has
its settings: redact, search, gateway and otel set one. builtins.go
sends setAt and page (its nav.page Part).
- Its Built-in row (featGo): "Settings › <tab>" and, while on, its page
("Masking"). No settings link while off when those settings hide with
the plugin (Observability).
- Its settings, while off (featOff): a first row "Off in Plugins ›
Built-in", what being off means, and Turn on. Privacy and Web search
use it; search's own off row went.
- Insights › Masking's head: "Settings › Privacy", unless Turn off
already goes there. At 600px and under its buttons wrap below the title.
- docs/subsystems/plugin-runtime.md documents SetAt.
Proposal for the owner, not built: give each feature one home with its
switch, settings and page together. This commit only links the three.
Core budget: no raise. +~1.9KB of code is paid for by shortening six
app.js comments (logo mask shelf, copy, sidebar, account models,
fitSend, the hold room).
Run on mote at fe672ce69's tree (origin/main
|
||
|
|
ef0a03e137 |
otel: Langfuse is set up from its host and the project's two keys
A user on X asked for Langfuse built in. magpie could already export to Langfuse over OTLP, but Settings › Observability had the user type the endpoint .../api/public/otel and a percent-encoded Authorization=Basic%20<base64(pk:sk)> header by hand. Settings › Observability now has a Collector row: OTLP or Langfuse. With Langfuse, the user picks the host (Cloud EU, Cloud US, or Self-hosted with an address, which also covers Langfuse's JP and HIPAA regions) and fills in the public and secret keys. Once both keys are there, magpie saves: - the endpoint <host>/api/public/otel; - Authorization: Basic base64(pk:sk), in otel.headers as before, so the secret is stored where it was and a backup without keys leaves it out; - on a first setup, also x-langfuse-ingestion-version: 4, metrics off and export on. langfuse.com/docs/opentelemetry/get-started (read 10-26) gives the same header for every region and for self-hosted, and says that without it OTLP data can arrive up to 10 minutes late. A Langfuse endpoint set up by hand opens in this view with its keys decoded into the fields. Opening it saves nothing. Changing a key or the host keeps the user's other headers, their metrics and export choices, and an ingestion header they set or left out. Switching from another collector leaves that collector's headers behind and does not send them to Langfuse. The Observability page moved from app.js into the otel plugin (assets/plugins/otel/page.js, with i18n.js for its words, in Client), because app.js had 13 bytes of budget left. The app.js and core budgets are lowered to what is left (1,321,319 and 1,537,645; app.js is 1,321,313 after rebasing on |
||
|
|
8b89b2e36c |
tests: two waits that went red at load 80–100 leave room: the reasoning relay is timed by the vendor's clock, otel waits a minute for its export
Both went red in full runs of go test ./... on a machine at load 80–100.
Neither is a fault in what they test.
- TestChatReasoningRelayedAsItComes: "first thought after 924ms" against a
700ms bound from before the request, while the thought still came ~1s
ahead of the text. The bound timed the gateway's start, not the relay.
slowThinker now records when it wrote each event. The test checks that
the first thought reached the client before the vendor wrote the text.
That is the guarantee, and a slow start no longer counts against it.
- plugins/otel TestOnExportsOffSendsNothing waited 10s for the first export.
It now waits a minute, as other waits for a plugin's first work do.
Run: go test -count=5 for the relay test, all ok. Broken by hand:
refusesAfterThinking returns true, so the reasoning is held as Claude's is.
The test went red ("reached the client 489µs after the vendor wrote the
text"). Full go test ./... ran with the middleware point commit before this
one (see its body).
|
||
|
|
9916a94608 |
gateway, usage, plugins: OTel export is the first plugin on the gateway's observer point (P3)
P3 of docs/subsystems/plugin-runtime.md opens the gateway to plugins. The
observer point is first: it only reads, so it carries the least risk.
With plugins/otel off, the gateway exports nothing and does no observing
work. It keeps no reply whole and adds no request context.
- usage.Observer:
- Methods: Serve, Bodies, Begin(Request) Watch and Ledger(Record). Watch
has Attempt and End.
- Observe(o) registers an observer until its remove is called.
- ServeObservers is counted, and only Server.ListenAndServe calls it.
- ObservedBodies takes the most any observer wants.
- Record.SkipOTel becomes Watched, set by appendUsage for a request an
observer watched.
- The gateway's otel.go becomes observe.go:
- observeRequest asks each observer through Begin.
- attempt and end call each Watch. Bodies are added only when an
observer asks for them, and the whole reply only for WholeBodies.
- internal/otlp: the exporter (otel*.go) moves out of internal/usage, and
the gateway's per-request span state moves into request.go. otlp.New()
is an Exporter, a usage.Observer. What it sends is unchanged.
- plugins/otel:
- Apply registers otlp.New() and disposes of it when turned off.
- InUse is 1 while settings.OTelExport says to send. A user who exports
only through MAGPIE_OTEL_* keeps the plugin on under Essentials.
- pluginrt.KeepFresh: the process serving the gateway refreshes every 2s
when plugins.yml or settings.json changes. A switch made in the window or
the CLI reaches a running gateway, or a headless serve, without a restart.
- docs: plugin-runtime.md gets a P3 section, a gateway runtime path and an
updated failure section; reference.md says the export is the otel plugin.
Run at this tree on origin/main
|
||
|
|
3ccbe6bc15 |
plugins: a runtime for built-in plugins, and Plugins › Built-in to switch them (P0)
Lxxyx on X (https://x.com/Lxxyx_/status/2109506752656150974): magpie has too much in it. This is P0 of making magpie's parts plugins, as DeepSeek Harness does: a runtime, plugins.yml, and the first five built-in plugins the user can switch off. - internal/pluginrt: a registry (Register from init), a manifest (API caret range, Requires/Provides, Essential, InUse, Apply, Parts, Defaults) and Reconcile: the plugins no longer wanted, with whatever needs a service they provided, are disposed newest first; the wanted ones are applied once their services are there. A plugin that fails or panics is failed and the rest run. TestPluginsImportOnlyCore keeps the boundary: nothing outside plugins/ imports one, none imports another. - plugins.yml (appdir.Config()): default → preset (essentials | all) → the user's rows → in use. A new install is written Essentials, a magpie that ran here before (settings.RanBefore) All, so existing users keep everything. Writes are locked, whole and keep a .bak; a file that doesn't parse is an error, never empty, and is never written over. - plugins/groups, library, otel, sessions, warmups. In P0 a plugin off is the window's alone: its page, sections and rows (data-feature) leave the window; the gateway, TUI and CLI serve the same, nothing is deleted. One in use stays on. - The window: Plugins › Built-in, the first tab, a switch per plugin; GET/POST /api/plugins/builtin; boot.js says which are off before the first paint. CLI: magpie plugin builtin [on|off <id>], plugin preset, plugin dump [--json]. - docs/subsystems/plugin-runtime.md, gui-shell.md. Run: go test ./internal/pluginrt/ ./internal/settings/ ./internal/gui/; gofmt -l; go vet ./...; GOOS=linux go vet -tags nogui ./...; GOOS=windows go vet ./.... GUI: builtins.test.cjs in Chromium and WebKit, 5 languages, 1100/800/420; list-sort, mobile-web, routing-keys-fold, routing-sessions pass. By hand under a sandbox HOME: a new install gets essentials, an existing one all, a broken plugins.yml is refused and kept, dump works. Full suite results after the rebase are in the push notes. |