Paseo (getpaseo/paseo) starts the same Claude Code, but builds its own model
list: first-party models plus settings.json's `model` and a few
ANTHROPIC_*_MODEL variables (providers/claude/models.ts). It never reads
Claude Code's modelPicker, where magpie writes every model, so the rest were
not selectable in Paseo. Paseo's own ~/.paseo/config.json takes
agents.providers.claude.additionalModels ([{id,label,description}], checked
against protocol/src/provider-config.ts) and passes each id to Claude Code as
written.
New agent "Paseo" (detected by ~/.paseo or PASEO_HOME): its switch writes the
models Claude Code's /model lists (same ids, [1m] marks, names; only the ones
picked for it) there, marked "via magpie" in the description; the user's own
entries and keys stay, off takes out only magpie's, a sync refreshes when on.
Claude Code must be connected to magpie as well.
Run (mote-run, sandbox HOME in tests): TestPaseoAdditionalModels,
TestStateListsPaseo, internal/agentenv, internal/gui full package ok;
internal/agent full run red only on TestPiGroupEntryKeepsItsMembers, which is
red the same on origin/main 12cd456f2 (passes alone; filed). gofmt clean,
vet darwin, windows and linux nogui on internal/agent. Broken by hand: Set
writing no models goes red.
Not tried: a real Paseo daemon reading the file (checked against its schema
source only); GUI browser suites.
inlinePage wrote each script as "<script>" + body + "\n</script>" but hashed
body alone. A CSP hash covers the exact text between the tags, newline
included, so the browser blocked every inlined script (the bridge too) and a
plugin page opened in magpie web was blank. The hash is now taken from the
text that is written, in the one place that writes it. The siblings: no other
code hashes an inline script (grep sha256- in internal; the stylesheets go
under style-src 'unsafe-inline').
Run (mote): TestPluginPageWebComesAsOneDocument now hashes every served
<script> body and looks each up in the policy; red on the old pageinline.go
(all three scripts, the bridge included), green on the fix. internal/gui
package, vet on darwin, windows and linux nogui. New GUI file
plugin-page-csp-hash.test.cjs (chromium and webkit: hash of served bytes runs
with no securitypolicyviolation; hash of the body alone is blocked), with
plugin-page, plugin-page-cookie-proxy: green.
Not tried: the full suite before the tag (started after it); a real browser
against the live Go server behind a proxy.
55dff77b4 compiled seven package-level regexps in pageinline.go with
regexp.MustCompile, so TestNoEagerPackageRegexps was red on main. They
now go through lazyre.New, like the rest of internal/gui.
Ran on mica at this tree (origin/main 817ccb56f + this change):
- go test -run TestNoEagerPackageRegexps . : ok (red in the full suite
log at 6b4513082 before)
- go test -tags nogui ./internal/gui -run 'Inline|PluginPage|Page': ok
- GOOS=linux go vet -tags nogui ./internal/gui, GOOS=windows go vet
./internal/gui: ok; gofmt clean
Not run: the full suite or GUI suite (the change is a constructor swap).
Fixes#6145
A plugin page's frame is sandboxed (opaque origin), so its stylesheet and
scripts are cross-site requests that carry no SameSite=Lax cookie. Behind
Cloudflare Access they were redirected to the sign-in page and the page
said it "didn't answer" (Day card). index.html's manifest link also
fetched without credentials.
In magpie web the page's HTML now comes as one document (pageinline.go):
classic scripts (bridge included) and url()-free stylesheets are written
in, scripts allowed by sha256 in the policy, deferred ones moved to the end
of body. A script the page adds later is fetched by the window (asset call,
folder-checked, window carries the cookie) and loaded from a data: address
(WebKit finds no blob made in a sandboxed frame). The manifest link has
crossorigin="use-credentials". Modules, url() stylesheets, images and
fonts loaded by the page itself still ask the proxy.
Run on mote at this tree: go test -run PluginPage ./internal/gui; node
--test plugin-page, plugin-page-idle, plugin-page-cookie-proxy in
chromium and webkit; gofmt; vet. Broken by hand: inlining off turns
TestPluginPageWebComesAsOneDocument red, the bridge shim off turns the
cookie-proxy test red in both engines.
Not tried: a real Cloudflare Access tunnel; images/fonts behind a proxy.