Enable Zeta edit predictions with custom URL without authentication#43236
Merged
agu-z merged 8 commits intozed-industries:mainfrom Dec 15, 2025
Conversation
Contributor
d4c2153 to
23146f9
Compare
nicky-isaacs-awoo
left a comment
There was a problem hiding this comment.
LGTM but very much not an expert
d1ba30f to
23146f9
Compare
3181b85 to
f524378
Compare
6d8b52a to
d1e6672
Compare
Add tests to verify authentication behavior with custom URLs: - test_unauthenticated_without_custom_url_blocks_prediction: verifies that without authentication and without a custom URL, prediction fails - test_unauthenticated_with_custom_url_allows_prediction: verifies that with a custom URL set via ZED_PREDICT_EDITS_URL, prediction should proceed even without authentication These tests establish the expected behavior: when using custom URLs, authentication should be optional (use if available, proceed without).
When ZED_PREDICT_EDITS_URL is set (custom URL), authentication is now optional - the prediction will use authentication if available, and proceed without it if not available. When no custom URL is set (standard Zed infrastructure), authentication remains required to maintain the existing behavior. Changes: - Token acquisition uses .ok() for custom URLs (converts error to None) - Authorization header only added when token is present - Token refresh only attempted when we had a token to begin with
d1e6672 to
0e41202
Compare
Add test-only infrastructure to allow testing custom URL auth behavior without requiring environment variable manipulation: - Add TEST_FORCE_CUSTOM_URL_MODE AtomicBool with #[cfg(test)] - Add has_custom_url() helper that checks test override first - Combine auth tests into single test_authentication_behavior function for sequential execution (avoids concurrency issues) - Remove #[ignore] from custom URL test - now runs in CI The test-only code has zero impact on production builds.
…if-ZED_PREDICT_EDITS_URL-set
agu-z
reviewed
Dec 15, 2025
Comment on lines
+1700
to
+1702
| let url = client | ||
| .http_client() | ||
| .build_zed_llm_url("/predict_edits/raw", &[])?; |
Contributor
There was a problem hiding this comment.
Raw requests are only used by staff for experimentation, and the payload struct doesn't match, so we shouldn't use PREDICT_EDITS_URL
Contributor
|
@DominicBurkart Thank you for your contribution! Merging after some tweaks |
308638a to
615fcb5
Compare
CherryWorm
pushed a commit
to CherryWorm/zed
that referenced
this pull request
Dec 16, 2025
…ed-industries#43236) Enables using Zeta edit predictions with a custom `ZED_PREDICT_EDITS_URL` without requiring authentication to Zed servers. This is useful for: - Development and testing workflows - Self-hosted Zeta instances - Custom AI model endpoints Prior context on this usage of `ZED_PREDICT_EDITS_URL`: zed-industries#30418 Release Notes: - Improved self-hosted zeta UX. Users no longer have to log into Zed to use custom or self-hosted zeta backends. --------- Co-authored-by: Agus Zubiaga <agus@zed.dev>
|
I understand use of this environment variable isn't an exactly supported configuration but i have a local ollama instance with zeta available on it. How exactly can i configure zed preview to use that zeta instance for edit predictions? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables using Zeta edit predictions with a custom
ZED_PREDICT_EDITS_URLwithout requiring authentication to Zed servers. This is useful for:Prior context on this usage of
ZED_PREDICT_EDITS_URL: #30418Release Notes: