ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
bc320e249f |
agent: T3 Code, Air, OpenChamber and the rest send the LAN key to a gateway pinned beyond loopback (#1647, ggbdpq)
The gateway takes gateway.Token, and the keys that name an agent (gateway.TokenFor), only from loopback. When MAGPIE_ADDR pins the gateway to an address beyond loopback and sharing is on, keyAt gives the LAN sharing key, and most writers use it. T3 Code's instance still wrote gateway.Token, so every call it made got 401. Air's and OpenChamber's Checks compared against gateway.Token, so they said the wiring Sync had just written was off. The same mistake was in every writer that pairs gateway.URL() or gatewayV1() with a fixed token: - agy, Alma, Cindy, Claude Desktop, Copilot for JetBrains, Cursor's local agent, OpenHanako, Pencil, VS Code / Insiders / VSCodium, WorkBuddy-family models.json, ZCode (both files), Zed's credential, Aside's provider, and the legacy Claude token rename. - Fix: these now take agentKey(agent) or hereKey(), which are keyAt and agentKeyAt for gateway.URL(). On loopback they are unchanged. - Alma re-keys a provider that holds any of magpie's keys other than the one it should have now. - WorkBuddy and Aside also count the new key as theirs. - ZCode treats a saved address equal to the pinned gateway as this machine's, not another magpie's. What was run: - New tests: TestT3CodeKeyBeyondLoopback and TestAirAndOpenChamberChecksTakeTheKeyForTheGateway (from the reporter's patch), and TestPinnedGatewayKeyForEveryWriter, which covers the other writers. - With the product files reverted, all three are red. The T3 token reads "magpie", and each of the 11 writers shows its old key. They are green with the fix. - go test -tags nogui ./internal/agent/ is green. - gofmt -l and go vet are clean on darwin, linux and windows. Not tried with a real T3 Code, Air, OpenChamber or a real pinned MAGPIE_ADDR on a second machine. |
||
|
|
6e6338f8d6 |
agent: configure Zed models and gateway credentials automatically (#584)
* 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> |