billion-context's README lists Zed, but Library's billion-context tab
offered only Pi, omp, OpenCode and Claude Code. Zed has no plugin of
bili's. Upstream gives it two routes: `bili zed`, a Linux-only launcher
that leaves a provider on loopback direct (so it never passes magpie's
gateway), and, on every system, the /bili/ prefix its docs give any
client whose model address can be edited, with `bili start` answering
on 8787.
Zed is now a URL lane (biliURLLanes, internal/library/bili_url.go).
Switched on, magpie has bili start answer (one the user runs is used;
else magpie runs its own under KeepLinked's context, logged to
bili-start.log, and starts it again at magpie's start while Zed is on),
then agent.ZedThrough sets the magpie provider's api_url to
http://127.0.0.1:8787/bili/<gateway>/v1 and saves the key for that
address in the credential store, where Zed looks it up by address. A
pick and a sync keep the prefix while magpie answers through it
(zedReach, #1985's proxy recognition). Off puts api_url back on the
gateway and ends magpie's bili start when nothing goes through it.
Zed must be on magpie first; the error says to pick a magpie model.
Run:
- bili 0.1.213 on mote: bili start --port N, then
/bili/http://127.0.0.1:<fake magpie>/v1 forwarded GET /, GET
/v1/models and POST /v1/chat/completions with Authorization kept and
bili's tools injected (repro/zedroute.sh).
- mote: go test -tags nogui ./internal/library ./internal/agent (full
packages), go vet darwin, GOOS=linux -tags nogui, GOOS=windows.
- mote: library-bili, i18n-keys, i18n-en-no-cjk GUI tests (chromium
and webkit).
- win-run: go test ./internal/agent ./internal/library -run
'TestZed|TestBili'.
- gofmt -l clean.
Broken by hand: SetBili without the URL-lane dispatch, and zedReach
without the proxy keep: TestBiliZedThroughPrefix and TestZedThroughBili
go red; restored, green.
Not tried: a real Zed app through bili (no Zed on mote), and the real
keychain write (zedCredential stubbed in tests, as before). Other
clients upstream lists (Cline/Roo/Kilo, Continue, OpenHands, Void,
Cursor, Warp, launcher-only lanes) are not added here.
Keep Zed's known input and output limits independent when building its
combined token budget. A 64K prompt limit no longer truncates a 128K reply.
Preserve the existing fallback reply cap when the input limit is unknown.
Cover larger reply limits, manual settings and synchronization, and
assert the prompt room left after Zed reserves its reply allowance.
* agent: configure Zed models and gateway credentials automatically
Add Zed to the CLI and Agents page with an OpenAI-compatible magpie provider, a synced model catalog and default model selection. Preserve existing JSONC settings and restore the previous provider and default model on reset.
Store the gateway credential in Secret Service, macOS Keychain or Windows Credential Manager so Zed needs no manual API key entry. Cover config preservation, catalog sync, model limits, Flatpak paths and credential failures.
Verified with the full nogui test suite, go vet, macOS and Windows cross compilation, and a local Zed conversation through the gateway.
Amp-Thread-ID: https://ampcode.com/threads/T-01a0fd03-00d7-75fd-956f-c505e07ba60d
Co-authored-by: Amp <amp@ampcode.com>
* agent: store Zed credentials directly through Secret Service D-Bus
Replace the Linux and FreeBSD secret-tool subprocess with the existing godbus client. Open a session, create the default collection when needed, unlock it and replace the matching Zed credential. Handle collection, unlock and item prompts, dismissal and timeout.
Verify the protocol on isolated D-Bus instances with no helper executables on PATH, including immediate completion signals and failed writes. The full nogui suite, targeted vet and race checks, macOS and Windows cross compilation pass; local credential readback confirms replacement without duplication.
Amp-Thread-ID: https://ampcode.com/threads/T-01a0fd03-00d7-75fd-956f-c505e07ba60d
Co-authored-by: Amp <amp@ampcode.com>
* docs: remove the separate Zed configuration paragraph
Amp-Thread-ID: https://ampcode.com/threads/T-01a0fd03-00d7-75fd-956f-c505e07ba60d
Co-authored-by: Amp <amp@ampcode.com>
* agent: fix Zed reset, keychain access and translated notices
Avoid restoring magpie’s own provider after a model change in Zed, and cover reselection followed by reset. Remove the unsupported Flatpak config path.
Authorize the installed Zed app and security command to access the macOS gateway credential. Translate Zed’s notice and apply translation when selecting or reapplying an agent model.
Verified with the full nogui test suite, go vet, Zed race tests, cross compilation and browser checks. macOS keychain behavior still needs runtime verification on a Mac.
Amp-Thread-ID: https://ampcode.com/threads/T-01a0fd70-98a1-737f-93bd-77e181f904c1
Co-authored-by: XYenon <register@xyenon.bid>
* agent: preserve Zed model picks when resetting magpie
Restore the stashed default model only while Zed still selects magpie. Preserve a model chosen in Zed itself and discard the stale model stash, while restoring the previous provider.
Find Zed Preview in Applications folders and Spotlight without requiring a CLI, and use any in the isolated D-Bus tests.
Verified the reset regression fails before the fix and passes afterward. The full nogui suite, go vet, Zed race tests and macOS/Windows test cross compilation pass.
Amp-Thread-ID: https://ampcode.com/threads/T-01a0fd70-98a1-737f-93bd-77e181f904c1
Co-authored-by: XYenon <register@xyenon.bid>
* agent: retain Zed provider backup when reselecting magpie
When Zed’s provider already points at the gateway, update only the model stash and preserve the original provider backup. Reset can then restore the user’s provider after a native model pick followed by another magpie pick.
Add a regression covering the full sequence and checking the restored provider, model catalog, custom headers and latest native model. Confirm it fails before the fix and passes afterward; all Zed tests, the full nogui suite and go vet pass.
Amp-Thread-ID: https://ampcode.com/threads/T-01a0fd70-98a1-737f-93bd-77e181f904c1
Co-authored-by: XYenon <register@xyenon.bid>
---------
Co-authored-by: Amp <amp@ampcode.com>