Commit Graph
5 Commits
Author SHA1 Message Date
RaykieLee bac0ccb905 tests: Zed's relative config dir falls back to its Windows default 2026-10-13 05:48:39 +08:00
Yibo Xiandyetone 5115f0eea6 feat: configure Zed-compatible Agent paths (#922)
* feat: configure Zed-compatible agent paths

* fix: honor custom Zed bundle paths

* fix: classify Zed path overrides correctly

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2026-10-06 01:04:26 +08:00
Zhizhen He 69a7744a9f fix(agent): preserve Zed reply limits (#857)
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.
2026-10-05 12:42:46 +08:00
yetone 12cba74ab3 agent: Zed's max_tokens is the window a prompt and its reply share, so a prompt keeps the room magpie's catalog gives it (#850) — Zed's openai_compatible max_tokens is the whole window: it keeps max_output_tokens of it for the reply and lets the prompt fill only the rest before it compacts (its thread's input_token_capacity = max_tokens - max_output_tokens). magpie wrote its catalog's Context there, which is what a prompt may hold, so Zed took the reply out of it: glm-4.6 (204800 / 131072) left a prompt 73728, deepseek-chat (128000 / 128000) none at all, gpt-5 (input 272000 / 128000) 144000 of its 400000 window. max_tokens is now Context + max_output_tokens: 335872, 256000, 400000 (OpenAI's own), and a model with no output limit still gets its Context alone. In a sandbox HOME with the real models.dev catalog, setting Zed to magpie wrote glm-4.6 335872/131072, gpt-5 400000/128000, deepseek-chat 256000/128000, claude-sonnet-4-5 264000/64000, kimi-k2 229376/98304. TestZedWindowHoldsPromptAndReply (gpt-5 400000 with a 272000 prompt; a model without an output limit) and TestZedRestoresProviderAndModelLimits fail on the old code. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass (TestProvidersAnswerWhileListsComeIn, TestUserPath and TestClaudeSignedOut timed out under load and pass on their own). 2026-10-05 11:05:49 +08:00
XYenonandAmp 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>
2026-10-03 01:51:53 +08:00