Sync fork with upstream zed-industries/zed - #1
Merged
Conversation
# Objective - Currently, the file preview pane in pickers forces line numbers and the editor gutter to always be visible, ignoring user-configured preferences. This PR ensures the preview component respects the user's global editor layout settings. ## Solution - Modified `EditorPreview::new` within `crates/picker/src/preview.rs`. - Imported `EditorSettings` from the `editor` crate. - Replaced the hardcoded `true` values for `set_show_gutter` and `set_show_line_numbers` with the user's active global configuration retrieved via `EditorSettings::get_global(cx).gutter.line_numbers`. ## Testing - Did you test these changes? If so, how? - Yes, manually verified that toggling line numbers off or using relative line numbers in `settings.json` is accurately reflected inside the picker's file preview pane. - Are there any parts that need more testing? - No, using the global context lookup seamlessly integrates with Zed's existing configuration lifecycle. - How can other people (reviewers) test your changes? Is there anything specific they need to know? - Open your `settings.json` and change your line number preferences (e.g., set `"line_numbers": false`). - Bring up a picker that renders a file preview (like the project search or file finder). - Confirm that the preview pane's gutter and line number layout perfectly matches your active configuration. - If relevant, what platforms did you test these changes on, and are there any important ones you can't test? - Tested on Linux. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase <details> <summary>Click to view showcase</summary> ### Line numbers ON <img width="1940" height="2072" alt="preview-line-numbers-on" src="https://github.com/user-attachments/assets/db824b5e-bc29-459d-bc0c-86762d44f707" /> ### Line numbers OFF <img width="1940" height="2072" alt="preview-line-numbers-off" src="https://github.com/user-attachments/assets/48a6357e-d4b5-462b-920f-d1c20d3d27af" /> </details> --- Release Notes: - Preview line numbers now respect user configuration settings
https://github.com/user-attachments/assets/794334dd-9f57-4ed3-bdaf-731b8691fa38 Release Notes: - Made `Esc` dismiss agent notifications
# Objective Fix unreliable working/status indicators for ACP agent threads. ACP threads update their internal running state when a turn starts, completes, or is canceled, but those status-only changes were not being emitted as thread events. The agent UI could miss transitions unless another entry-related event happened nearby, making it particularly hard to monitor the status of multiple agent threads running at once. Hope this helps, and thanks for making Zed. ## Solution - Add an `AcpThreadEvent::StatusChanged` event. - Emit it when `running_turn` is set, cleared, or canceled. - Have `ConversationView` handle the event by syncing the active thread view's generating indicator. - Treat status changes as UI state only, not root thread metadata changes. ## Testing - `cargo check -p sidebar -p project -p git_ui -p workspace` - Manually verified in a local dev build on macOS that ACP agent status/working indicators update reliably. No automated test was added; this changes UI synchronization for ACP thread status events. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed unreliable working indicators for ACP agent threads.
…ndustries#52537) Closes zed-industries#39159 ## Summary • resolve remote terminal path candidates outside known worktrees through `Project::resolve_abs_path` • keep the local filesystem backed resolution path unchanged • preserve the existing preference for direct in-worktree matches when the terminal cwd is already inside a worktree • add regression coverage for both absolute and cwd-relative remote external paths ### Why The hyperlink parser wasn't the bug. `terminal_path_like_target` already knew how to parse these paths. The actual problem was that remote projects had no equivalent of the local background existence check. After worktree lookup failed, remote projects only fell back to worktree traversal, so cmd-click on `/tmp/a.txt` in an SSH remote terminal no-op'd. The project layer already has remote absolute-path resolution via `Project::resolve_abs_path`, so the right fix is to use that existing path for remote candidates instead of pretending remote projects cannot resolve paths outside their worktrees. ## Verification • `cargo test -p terminal_view terminal_path_like_target --quiet` • `cargo test -p terminal_view --quiet` ## Manual • Verified locally on my MBP w/ a stateless Zed build using SSH to self (`localhost`) • Opened `/tmp/zed-39159-project` as a remote project • Confirmed cmd-click opens `/tmp/zed-39159-external/a.txt` • Confirmed cmd-click opens `zed-39159-external/b.txt` from `cwd=/tmp` • Confirmed in-worktree paths still open correctly • Confirmed nonexistent external paths do not open bogus targets Release Notes: - Fixed remote terminal path opening so cmd-click can open files outside the project worktree.
Summary: - Protect Git metadata in Windows/WSL sandboxes by passing Git policy into the WSL Bubblewrap wrapper. - Map protected Git paths and overlay them read-only, while allowing approved Git metadata paths to be writable. - Update tool descriptions and sandboxing docs for platform-specific Git metadata behavior. Validation: - cargo check -p sandbox - cargo check -p sandbox --tests --target x86_64-pc-windows-msvc - cargo check -p agent -p acp_thread - git --no-pager diff --check Release Notes: - Improved Windows agent sandboxing to protect Git metadata unless access is approved
…stries#60069) This moves the MCP timeout setting to the MCP subpage, instead of rendering it in a separate section called "Context Servers" Before: <img width="896" height="332" alt="image" src="https://github.com/user-attachments/assets/edf6e681-4bad-43f5-89b0-3e8228f74f7a" /> After: <img width="660" height="222" alt="image" src="https://github.com/user-attachments/assets/7b2bfbea-f0c7-4419-8d06-dfc7d7f740e8" /> Release Notes: - N/A
…ries#59980) Adding a series of UI tweaks to refine how we display whether a thread is covered by sandbox. Most notably, separating all the tooltip UI stuff into a dedicated component so we can get a preview and iterate more easily on all of its states. Release Notes: - N/A
…-industries#60072) Closes zed-industries#59143 This hides a bunch of actions from the terminal context menu when showing it in the agent panel. For agent terminal threads: <img width="383" height="205" alt="image" src="https://github.com/user-attachments/assets/a090d62c-7f49-4169-8d82-5cf9577c7444" /> For terminals inside of an ACP agent: <img width="418" height="366" alt="image" src="https://github.com/user-attachments/assets/225cf0c7-ab28-4a71-b692-b4b89bc074c2" /> Previously we would show all of these options both cases: <img width="221" height="291" alt="image" src="https://github.com/user-attachments/assets/bcb4e6b6-4a23-48b2-a778-fca4877d2b78" /> Also makes the inline assistant actually work inside of terminal threads Release Notes: - agent: Fixed an issue where some actions would be displayed in terminals that would not work
…tries#60071) Closes zed-industries#59584 Release Notes: - agent: Delete subagent threads from database when deleting parent thread
Hi there, I'm Celina from Hugging Face! Opening this PR to add [llama.cpp](https://llama.app) as a model provider # Objective Today Zed users running llama.cpp have to fall back to the generic OpenAI-compatible provider, which means no auto-discovery (the router mode (`llama serve`) discovers models from the cache and loads them on demand) and manual configuration of every model and its capabilities. This PR makes `llama.cpp` a first-class provider with the same auto-discovery experience. ## Solution - Add a `llama_cpp` client crate with the OpenAI-compatible chat types (`/v1/chat/completions`, including `reasoning_content`) and the discovery types (`/v1/models`, `/props`), mirroring the existing `ollama` crate. - Add the provider in `crates/language_models/src/provider/llama_cpp.rs`, modeled on the Ollama provider (settings, configuration view, event mapping). - Auto discover served models and their context length and tool/vision support from `/props`. Set `auto_discover: false` to list models manually instead. - An unloaded model can't be inspected without loading it, so it is listed with optimistic defaults (large context, tools enabled) and is usable from the first message; its real context length and tool support are filled in once it loads. These live behind a shared map, so a model already selected in an open conversation picks them up without being re-selected. - Show load progress. The provider subscribes to `/models/sse` and surfaces each model's load progress (e.g. "Loading weights 42%") in its display name, reconciling stale labels against `/v1/models`. Builds without `/models/sse` degrade gracefully - no progress, and no capability refresh after the initial discovery. - Add settings (`api_url`, `auto_discover`, `available_models` with per-model `max_tokens` / `supports_tools` / `supports_images`, `context_window`, `custom_headers`), the provider icon, a `default.json` entry, and documentation under "Use a Local Model". No new dependencies: the crate reuses existing workspace dependencies, and shared state uses `std::sync::RwLock`. ## Testing - Unit tests in both new crates cover wire/response parsing, model discovery for single-model and router shapes, the cold-start optimistic defaults, the in-place capability refresh once a model loads, and the `/models/sse` event handling (state changes, load failure, load progress). - Built Zed locally and ran it against a local `llama serve` router: confirmed models are discovered without manual configuration, that the first message works before a model has finished loading, that load progress is shown in the model's display name while it loads, and that the reported context length and tool support refine to the model's real values once it finishes loading. - Platforms: tested on macOS (Apple Silicon). ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase The generation speed (tokens/sec) depends on the machine you're running the model, here it's a Apple M3 Max 64GB running a 4-bit quant of https://huggingface.co/Qwen/Qwen3.5-35B-A3B. For the load progress status, make sure to upgrade your llama.cpp version to the latest build. https://github.com/user-attachments/assets/0254f6ef-abe9-42ed-810b-ef1a5b8fa3bd --- Release Notes: - Added llama.cpp as a language model provider --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
…es#60090) This PR adds a conditional `allow(dead_code)` to the `wake_sender` field to fix this error when building Collab: ``` error: field `wake_sender` is never read --> crates/gpui_linux/src/linux/platform.rs:126:5 | 116 | pub(crate) struct LinuxCommon { | ----------- field in this struct ... 126 | wake_sender: Sender<()>, | ^^^^^^^^^^^ | = note: `-D dead-code` implied by `-D warnings` = help: to override `-D warnings` add `#[expect(dead_code)]` or `#[allow(dead_code)]` error: could not compile `gpui_linux` (lib) due to 1 previous error warning: build failed, waiting for other jobs to finish... ``` https://github.com/zed-industries/zed/actions/runs/28374439219/job/84060893437 Release Notes: - N/A
Before: https://github.com/user-attachments/assets/b95f3317-669a-462d-bbe8-ba80ede3e496 After: https://github.com/user-attachments/assets/16536d14-fc91-4d68-ac0d-6b7c382dd298 Release Notes: - Fixed telescope picker being overly small on consequent reopens
…ustries#60085) Quick follow up to zed-industries#59980 with some adjustments. Release Notes: - N/A
…s#59929) ## Summary Tune the shared `ReqwestClient` builder so HTTP connections that have silently gone bad on a flaky network path are detected and dropped rather than reused. A stale, reused HTTP/2 connection (after a NAT/conntrack timeout, a silent reset, or a degraded path) is a common source of intermittent TLS `BadRecordMac` errors against long-lived endpoints such as `cloud.zed.dev`. The client already retries these (`HttpSend` is retryable with exponential backoff), but users still see periodic multi-second stalls and "connection error" warnings. These settings make the client probe and recycle connections instead of sending a request's first records into a connection that is already dead: - `tcp_keepalive(30s)` — surface dead TCP connections instead of reusing them. - `pool_idle_timeout(30s)` — bound how long an idle connection lingers in the pool. - `http2_keep_alive_interval(15s)` / `http2_keep_alive_timeout(10s)` / `http2_keep_alive_while_idle(true)` — ping idle HTTP/2 connections so broken ones are torn down. All three constructors (`new`, `user_agent`, `proxy_and_user_agent`) go through `builder()`, so every Zed HTTP client picks this up. ## Notes - Values are conservative; they can be tightened if stale-connection errors persist. - `tcp_keepalive_interval` is not yet available in the pinned `zed-reqwest` fork rev, so only the initial keepalive idle time is set here. ## Verification Behavior is network-dependent, so there is no deterministic test. Verified that the crate builds (`cargo check -p reqwest_client`). The change is being validated empirically against a setup that reproduces the `BadRecordMac` errors. Release Notes: - Improved resilience to intermittent network errors by detecting and dropping stale HTTP connections instead of reusing them.
This PR adds the `username` field to `User` and `proto::User`. Closes CLO-949. Release Notes: - N/A
…59995) When opening Zed from GNOME on Wayland, the cursor can stay stuck in the launch spinner state for several seconds because GPUI never tells the compositor that the launched app's first window has loaded. Desktop launchers pass this information through `XDG_ACTIVATION_TOKEN`, which Wayland clients are expected to consume once their first toplevel surface is ready. This PR fixes that by reading and removing `XDG_ACTIVATION_TOKEN` during Wayland client startup, storing it on the client state, and consuming it on the first XDG toplevel surface via the existing `xdg_activation_v1.activate(token, surface)` plumbing. Anthony manually verified this on GNOME Wayland. docs ref: https://wayland.app/protocols/xdg-activation-v1 Release Notes: - Fixed Linux Wayland cursor being stuck as a spinner for a couple of seconds.
…Store` (zed-industries#60103) This PR removes the `cached_user_by_github_login` method from the `UserStore`, as it was unused. Release Notes: - N/A
# Objective Fix the agent `terminal` tool in headless eval environments. In the eval sandbox, terminal commands failed before the shell ran with `IOError: Not a tty (os error 25)` because PTY setup attempted to acquire a controlling terminal. ## Solution - Add a `terminal::HeadlessTerminal` global that is set by `eval_cli` only. - When headless mode is enabled, run terminal task commands as plain subprocesses with piped stdout/stderr instead of opening a PTY. - Pump subprocess output through the existing terminal emulator/event channel so output capture, completion, and task killing keep working. - Build ACP terminal commands non-interactively in headless mode. - Keep the normal editor terminal path unchanged when the global is unset. - Handle non-PTY output edge cases by preserving split CRLF sequences and avoiding an indefinite wait if subprocess exit-status polling errors. ## Testing - `cargo fmt --all` - `cargo test -p util non_interactive_omits_interactive_flag` - `cargo test -p terminal test_no_pty_task_terminal_captures_output` - `cargo test -p terminal test_convert_lf_to_crlf_preserves_split_crlf` - `cargo test -p terminal test_write_output` - `cargo check -p eval_cli` - `git --no-pager diff --check` ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed the agent terminal tool failing with "Not a tty" in headless/eval environments
) After a filesystem watcher loses sync (e.g. a `git pull` that changes many files overflows the backend's event queue), the backend can enqueue many `Rescan` markers in quick succession. The dispatch thread processed each one separately, and each rescan invokes every registration for that watcher mode, so a single burst could kick off several full worktree scans at once — leading to sustained CPU and an unresponsive project panel. This adds `dispatch_batch`, which handles the first event and drains the events already waiting in the channel, forwarding at most one `Rescan` per `WatcherMode` per drained batch while letting ordinary filesystem events and errors pass through untouched. A later watcher overflow can still trigger another recovery scan. Reported with a reproduction and patch in zed-industries#59610. Release Notes: - Batch file watcher rescan events to improve Zed's responsiveness under heavy FS usage
Brings in a needed fix to make sure we are properly ignoring unknown notifications Release Notes: - N/A
Release Notes: - N/A
…tries#60110) # Objective Closes EP-202 Prevent V4 edit predictions from leaking `<|user_cursor|>` markers into users' buffers. ## Solution - Strip cursor marker text from emitted prediction edits, including when `text_diff` splits the marker across edit fragments. - Preserve literal marker-like text that already exists in the buffer. ## Testing - `cargo test -p edit_prediction prediction_edits_for_single_file_diff -- --nocapture` - `cargo test -p edit_prediction --lib` - `cargo fmt --check` ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - N/A
…0107) This PR adds a `username` field to the `User` and starts using it instead of the `github_login`. Closes CLO-952. Release Notes: - N/A
…ed-industries#60114) Follow-up to zed-industries#59604 Build stats changes for `cargo clean && RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= cargo build --timings -p zed`: ``` ===== BASE (441de84) ===== total schedule end: 161.5s units compiled: 1671 crate start dur end editor 121.3 19.6 140.9 picker 131.6 2.3 133.9 picker_preview (absent) command_palette 133.8 2.2 136.0 dev_container 133.8 5.4 139.2 onboarding 137.4 2.5 139.8 settings_profile_selector 136.1 1.8 137.8 theme_selector 134.0 2.3 136.3 ===== HEAD (PR) ===== total schedule end: 158.5s units compiled: 1672 crate start dur end editor 120.5 18.4 138.8 picker 119.5 1.7 121.2 picker_preview 131.2 1.7 132.9 command_palette 121.1 1.9 122.9 dev_container 121.0 3.3 124.3 onboarding 121.1 2.2 123.3 settings_profile_selector 121.2 1.7 122.9 theme_selector 121.2 2.0 123.2 ``` Release Notes: - N/A
…zed-industries#60141) Summary: - Use the compaction-aware request history when generating thread summaries. - Reuse the same compaction boundary logic for thread title generation, including saved-thread title regeneration. - Add regression tests for summary and title request construction with compacted history. Tests: - `cargo test -p agent uses_compacted_history` Release Notes: - Improved agent thread summary and title generation to respect compaction boundaries. Co-authored-by: gaauwe <gaauwe@users.noreply.github.com>
# Objective The objective is to improve Helix's default keymap within Zed as a few are still missing. These are all [default keymaps](https://docs.helix-editor.com/keymap.html) i was using within Helix but dissapointed they weren't working in Zed There's more info in [Are we Helix yet?](zed-industries#33580 (comment)) ## Solution - Add `] g` and `[ g` for hunk navigation in helix mode, in helix this is go to next/previous change which maps nicely to Zed's go to next/previous hunk. (it was set to `c` here but this is incorrect and doesn't match Helix's keymap. - Add `alt-b` and `alt-e` for larger syntax node navigation in helix mode, i use this a few times to go to the top of a function within the body and Zed doesn't have it mapped. - Add `] space` and `[ space` for inserting empty lines in helix mode. This one was incorrectly implemented previously, after the `space` Zed is waiting for input. It needs to be a direct chord added rather than on `helix_next` mode. - This means the space binding from the helix_next operator context is redundant, so ive removed it - Add `*` to use selection for find in helix mode. Helix mode is slightly different and doesn't "go to next" on `*`, instead that becomes the `/` register. This is pretty fundamental to helix navigation so should be ported to Zed also. - Move `] d` and `[ d` diagnostics navigation into helix_normal context. Vim was already using this one but it wasn't shared with Helix. I've moved it to the shared Vim and Helix block. ## Testing I've tested these changes with a local build and each one works as expected ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Added `alt-b`/`alt-e` in Helix mode to move to the start/end of the larger syntax node. - Added `*` in Helix mode to set the current selection for search. - Fixed Helix `[`/`]` navigation so `c` goes to the previous/next comment and `g` to the previous/next hunk, and single-key follow-ups like `g` no longer hang. --------- Co-authored-by: dino <dinojoaocosta@gmail.com>
Now that we have `/compact` we want to make the "new from summary" option less prominent. You can still manually handoff to a new thread by @mentioning the thread in a new one (`@thread threadname`) Release Notes: - agent: Remove "New from summary" menu item from agent panel dropdown. You can still @mention the thread in a new one, or run /compact Co-authored-by: gaauwe <gaauwe@users.noreply.github.com>
Adds ability to re-open any closed picker. Release Notes: - Added: workspace::ReopenLastPicker Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Still behind a feature flag until the RFD is completed. Release Notes: - N/A --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This follows up on discussion zed-industries#56551. Right now, when Zed generates a commit message, it includes project rules files like `AGENTS.md`, `CLAUDE.md`, and `.rules` in the prompt alongside the git diff. That can add a lot of extra context for a task that is really just summarizing the changes in a commit. This PR adds an `include_project_rules` option to `agent.commit_message_model`. When it is set to `false`, Zed skips loading project rules when generating commit messages. If the option is omitted, the current behavior stays the same. Example: ```json { "agent": { "commit_message_model": { "provider": "anthropic", "model": "claude-3-5-haiku", "include_project_rules": false } } } ``` I also updated the settings plumbing so this option is only used for commit message generation and defaults to true when not specified. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - agent: Added setting to exclude project rules files from commit message generation prompts (`agent.commit_message_include_project_rules`) --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
…s#57959) This PR fixes a few History tab edge cases in the Git Panel. For a fresh repo with no commits, the History tab now finishes loading and shows No commits yet instead of sitting on Loading… indefinitely or falling into a misleading empty/error state. It also fixes detached HEAD history loading. In that case, the Git Panel asks the backend to load history from the current commit SHA. The local git backend was accidentally treating the raw object ID bytes as a string instead of formatting them as a normal hex SHA, so git log could fail before returning any commits. The backend now passes the SHA in the format git expects. **Repro for empty repo:** mkdir /tmp/zed-empty-history cd /tmp/zed-empty-history git init zed . Open Git Panel → History. Before: History could stay stuck on Loading…. After: History shows No commits yet. **Repro for detached HEAD:** mkdir /tmp/zed-detached-history cd /tmp/zed-detached-history git init echo hi > file git add file git commit -m initial git checkout --detach HEAD zed . Open Git Panel → History. Before: History could fail to load commits. After: History shows the commit history normally. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed Git history tab states for empty repositories and detached HEAD history. Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Dropping a scheduled runnable cancels its task and makes the next poll of any awaiter panic with "Task polled after completion." The only paths where we drop these runnables seem to be during shutdown or extreme resource exhaustion, so, let's leak the runnables instead of crashing. On Windows, we also moved to calling the Win32 thread pool API directly, because 1) WinRT thread pool API is just a wrapper that adds overhead we don't need, and 2) the closure we pass to the `WorkItemHandler` object takes ownership of the runnable object, so if the WinRT thread pool releases the delegate, it can free the runnable without our control. Release Notes: - N/A
# Objective Fixes zed-industries#60709 by removing the duplicate menu section for "MCP Servers". ## Solution Update `agent_ui::agent_panel::AgentPanel::render_panel_options_menu` to ensure the "MCP Servers" section is only rendered once, if not using a Terminal Thread. ## Testing Tested manually, comparing against the stable release, as this bug is present in Preview. Screenshot is shown in the "Showcase" section. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable ## Showcase <details> <summary>Before</summary> <img width="2736" height="1586" alt="CleanShot 2026-07-09 at 23 14 34@2x" src="https://github.com/user-attachments/assets/ce2014db-bd72-46fb-bfa1-247cd5471daf" /> </details> <details> <summary>After</summary> <img width="2736" height="1586" alt="CleanShot 2026-07-09 at 23 15 13@2x" src="https://github.com/user-attachments/assets/bbba9965-3f6a-4137-94e5-17704efd2cce" /> </details> --- Release Notes: - N/A
…es#60717) Release Notes: - Fixed a panic when running “Show in Git Graph” while the Git Graph was already open.
…#60743) Release Notes: - agent: Added GPT 5.6 Sol & Terra for ChatGPT subscription. Note: GPT 5.6 Luna is not available yet, since OpenAI has not unlocked access for third-party clients
### Closes zed-industries#51951 ## Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the UI/UX checklist - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable #### Note : Reopens previous work from closed PR zed-industries#52161 (fork was deleted) ## Video [Screencast from 2026-03-22 23-26-06.webm](https://github.com/user-attachments/assets/ab68e47a-7e74-4f1e-991d-8ca4fed7952c) ## Release Notes: - Fixed MCP servers from `.zed/settings.json` not being discovered when multiple project folders are open in a workspace. --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com> Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
…d-industries#59586) # Objective - Fixes zed-industries#58097. - Opening a new project and clicking `+` in the agent panel to start a terminal thread creates two terminals instead of one. I am able to replicate the issue on version 1.8.0 on macOS 27 ## Solution The new-thread action creates the terminal and then focuses the agent panel. Focusing re-activates the panel (`Panel::set_active` then `ensure_thread_initialized`) before the terminal, which is spawned asynchronously, has registered. The panel still looks uninitialized at that moment, so it spawns its own "initial" terminal too, and that is the duplicate. `spawn_terminal` now marks the spawn as in-flight (`pending_terminal_spawn`) the moment it starts, the same way the restore and initial-terminal paths already do, so the existing guard in `ensure_thread_initialized` skips the redundant terminal. This only affected new (unrestored) projects, since existing ones restore their previous entry instead of auto-creating one. The auto-init behavior was introduced in zed-industries#57150. ## Testing - Verified in a local dev build on macOS: opening a fresh project and clicking `+` now creates one terminal, and clicking `+` again creates a second, as expected. Reopening an existing project still restores a single terminal. - Added `test_explicit_terminal_blocks_redundant_auto_init`, which fails without the fix. - The change is platform-agnostic (no platform-specific code); I wasn't able to test on Linux/Windows. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed a duplicate terminal being created when starting an agent terminal thread in a new project
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes zed-industries#57174 Release Notes: - Open non-writeable files in Capability::Read mode Co-authored-by: Lukas Wirth <lukas@zed.dev>
Removes the feature flag. The RFD is in Preview and I am confident it will be stable without major changes by the time this hits Zed Stable. Release Notes: - acp: Allow ACP agents to use Elicitation capturing structure user input.
zed-industries#58879) ## Context On Linux, `ctrl-q` is globally bound to `zed::Quit`. When a `TerminalView` is focused, pressing `ctrl-q` quit the application instead of forwarding the keycode to the shell, breaking programs like `ftp`, `tig`, and any app that uses XON/XOFF flow control. Windows already had the fix: its `Terminal` keymap context overrides `ctrl-q` with `["terminal::SendKeystroke", "ctrl-q"]`. The Linux keymap was simply missing that override. Closes zed-industries#58809 Manual test after fix below : [Screencast from 2026-06-09 00-46-37.webm](https://github.com/user-attachments/assets/3d103b2a-bff1-4559-af1d-2a52d57a6b18) ## How to Review - **`assets/keymaps/default-linux.json`** : One-line addition in the `Terminal` context under the "Overrides for conflicting keybindings" comment, mirroring the existing Windows entry. - **`crates/terminal_view/src/terminal_view.rs`** : Regression test `ctrl_q_is_forwarded_to_terminal_not_quit` (Linux-only, `#[cfg(target_os = "linux")]`): loads the default keymap, focuses a display-only terminal, simulates `ctrl-q`, and asserts the PTY receives byte `0x11` instead of the quit action firing. ## Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the UI/UX checklist - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed `ctrl-q` quitting Zed instead of being forwarded to the shell when a terminal is focused on Linux
Turns out I only tested it with all tabs closed, the keybinding would only work when all tabs were closed and you focused the agent panel. If a file was opened in the center pane, cmd-f would open a search in that file instead of searching in the agent panel, even if the thread view as focused. Closes zed-industries#60686 Release Notes: - agent: Fixed an issue where cmd-f would not work if file is open in center pane
…d template literals (zed-industries#55341) Extends the existing ECMAScript comment-label injection system to support GLSL and WGSL shader languages inside JS/TS strings and template literals. The pattern `/* language */` before a string is already used for `html`, `sql`, `graphql`, and `css`. This adds the same support for two shader languages commonly embedded as strings in WebGL/WebGPU code: before: <img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 05" src="https://github.com/user-attachments/assets/8952eddc-2f53-42ea-b086-7a0b63dceb10" /> after: <img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 39" src="https://github.com/user-attachments/assets/93bf536a-9df4-438b-af7b-382efda196ca" /> Syntax highlighting activates when the corresponding extension is installed: - GLSL: the built-in `glsl` extension - WGSL: the community extension [`wgsl-wesl-zed`](https://github.com/lucascompython/wgsl-wesl-zed) (language name `WGSL/WESL`) Both `/*glsl*/` and `/* glsl */` forms are accepted (same behavior as the existing patterns). Release Notes: - Added `/*glsl*/` and `/*wgsl*/` comment-label syntax injection for JavaScript and TypeScript template literals
…2560) Closes zed-industries#21822 The issue is closed already, but it was requested to provide the `hard_tabs` boolean param. Follow-up to zed-industries#52175 Reviewed by @maxdeviant (it already bumped the settings path to v0.8.0, so this `hard_tabs` change only needs 2 files, 2-3 lines of code additions). ## Context Exposes `hard_tabs` from `AllLanguageSettings` to the Extension API's `LanguageSettings` struct. Currently, only `tab_size` and `preferred_line_length` are available to extensions, which prevents language extensions (e.g., Go, C++) from reading the user's hard tabs preference and forwarding it to their language server or formatter (e.g., as rustfmt.hard_tabs or clang-format.UseTab). Related: zed-industries#21822 (comment) ## How to Review Small change — follow how `tab_size` is plumbed through: 1. WIT definition (`language-settings` record) 2. `extension_api` Rust struct 3. Host-side bridge conversion The new field follows the exact same pattern. ## Self-Review Checklist <!-- Check before requesting review: --> - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - Compile-time verified via WIT bindings; no runtime behavior change - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
…d-industries#59134) This passes the `include_remote_name` flag through the remote `GetDefaultBranch` RPC instead of dropping it at the client/host boundary. That lets remote repositories resolve default branches as `origin/main` when needed, so worktree creation uses a valid remote branch name instead of falling back to `main`. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes zed-industries#59121 Release Notes: - Fixed remote worktree creation from the default branch when the default branch requires its remote name. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
…ies#58225) Adds support for enabling Anthropic fast mode on configured models. Previously, Anthropic models configured through `language_models.anthropic.available_models` were always marked as not supporting fast mode, so `speed: "fast"` would be stripped before sending requests even when the configured model supported Anthropic fast mode. This adds an optional `supports_fast_mode` field to configured Anthropic models. When enabled, the model is marked as supporting fast mode and the required Anthropic beta header is added automatically. Built-in fast-mode model detection remains the fallback when the setting is omitted. Testing: - `cargo fmt --package anthropic --package language_models --package settings_content` - `cargo test -p language_models available_model --lib` - `cargo test -p anthropic from_listed_enables_fast_mode --lib` - `cargo check -p language_models` - Manual: verified in a local build that a configured Anthropic model can send fast mode requests correctly. Release Notes: - agent: Allow specifying if fast mode is supported for custom anthropic models Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
…ponses (zed-industries#57861) LM Studio doesn't show the context token wheel (zed-industries#53790) because token usage is never reported in streaming responses. Causes: 1. `stream_options` was missing from the request. Without `stream_options: { include_usage: true }`, the LM Studio API omits `usage` from every streaming chunk entirely. 2. The event mapper discarded usage data in the final chunk. OpenAI-compatible servers send the usage summary in a trailing chunk that has an empty `choices` array. The old guard treated that as an error, so even when usage was present it was thrown away before emitting a `UsageUpdate` event. Fix: - Add `StreamOptions { include_usage: bool }` and `stream_options` to `ChatCompletionRequest`, and always set it to `true` for streaming requests. - Move usage handling in `LmStudioEventMapper::map_event` to run *before* the empty-choices guard, mirroring the OpenAI provider's approach. - Add four unit tests for `map_event` covering the fixed behavior. Release Notes: - Fixed LM Studio not showing the context window usage wheel. <img width="1184" height="1080" alt="Screenshot_20260527_130449" src="https://github.com/user-attachments/assets/97eb8500-39dd-4824-aaf8-f0422b62119d" /> --------- Co-authored-by: Gabriele Ancillai <gabriele.ancillai@sofka.com.co> Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
…ed-industries#60559) # Objective Fixes zed-industries#59820. ## Solution At a high level, I approached this by conditionally rendering a `Below` preview layout only when the preview was at or below the min width of the `Right` when the layout is `Right`. Since there's one breakpoint at `SizeBounds::min_width()` and hitting that breakpoint only changes rendering (and doesn't change the state), there's no need to persist to storage or memory that the view is forced to be Below. I toggled between the two rendering modes by defining `Picker::preview_layout_rendered()` that would return `Below` if the window was equal to or smaller than its min width. Then I replaced all calls of `preview_layout()` that used the response purely for rendering purposes with `preview_layout_rendered()`. I avoided replacing `preview_layout()` calls that were responsible for persisting the current layout and window dimensions to disk to ensure that changes to the window dimensions were properly synced to the correct layout. This way changes to the window while in the `BelowAuto` rendering mode edit the `Right` window dimensions on disk. ## Testing I tested these changes manually with the following actions on my local machine (an Apple Silicon Macbook Pro): - resizing the popover - resizing the window - adjusting the split - making sure the popover size and split percent remains the same after: - closing and re-opening the popover - closing and re-opening the application and making sure the window size and split percent remains the same Reviewers can test my changes by performing the same manual actions. ## Self-Review Checklist: - [X] I've reviewed my own diff for quality, security, and reliability - [X] Unsafe blocks (if any) have justifying comments - [X] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable ## Showcase ### Before https://github.com/user-attachments/assets/a4524065-d1a3-4595-bc9e-50c9715b4e66 ### After https://github.com/user-attachments/assets/fede7eb0-5d73-423c-8df0-8192caee8d26 --- Release Notes: - fix(picker): Automatically switch from Right split to Down split when picker gets too narrow
…d-industries#60660) On Linux and FreeBSD the native file watcher is non-recursive, so a watch on the .git directory itself does not report changes to files nested below it. Loose refs live in nested directories under refs, so external git commit, fetch, branch, and update-ref operations that don't also touch a direct child of .git (like the index) went entirely unnoticed. Watch every directory in the refs tree when a repository is inserted, and watch directories subsequently created under refs (new remotes, slash-named branches) as their creation events arrive. On platforms with recursive watchers these registrations dedupe against the existing recursive watch, making them free. --- Release Notes: - N/A or Added/Fixed/Improved ...
…-line indent (zed-industries#60613) The `edit_file` tool re-indents `new_text` by computing a single indent delta from the first line of `old_text` versus the matched buffer line, then applying that delta to every line of the replacement. When a model omits the leading indentation on only the first line of `old_text`/`new_text` (a common pattern when copying from mid-line context), the delta computed from the first line was wrongly applied to the remaining, already-correctly-indented lines, doubling their indentation. This PR: - Tracks the `(query_row, buffer_row)` line pairs aligned by the streaming fuzzy matcher so the indent of each `old_text` line can be compared against the buffer line it actually matched. - Computes a separate indent delta for the lines after the first: when those lines agree on a consistent delta, it's used for the rest of the replacement; otherwise the previous uniform behavior is preserved. - Keeps `query_lines`/line pairs in sync when `finish()` extends a match with a trailing incomplete line. - Adds an end-to-end regression test reproducing the issue, plus unit tests for the new re-indentation logic. Closes zed-industries#60302 Release Notes: - Fixed the agent's `edit_file` tool corrupting indentation when a replacement omitted leading whitespace on only its first line.
Closes security loopholes and updates docs: - installs seccomp filter for blocking naughty syscalls - tightens macos seatbelt profile - fetch tool responses that redirect are now constrained by allowed domains list Also adds a few "Learn More" buttons that link to the new docs. Also fixes a bug where the agent would try to create a `~/.config/zed/AGENTS.md` directory Also adds unicode confusable detection to URL/path privilege escalation prompts. --- Release Notes: - N/A or Added/Fixed/Improved ... --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
## Summary - Document pricing and Zed-hosted context limits for Claude Fable 5, Claude Sonnet 5, and GPT-5.6 Sol, Terra, and Luna. - Record recent Gemini and xAI model retirements and replacement guidance. - Put the Fable safety-retention warning on the hosted-model reference and align the privacy docs with the current Anthropic Covered Models terminology and retention period. ## Sources - zed-industries/cloud origin/main at f5d109a868a303241e89ea30d6da8da19699ead4 - OpenAI GPT-5.6 model documentation - Anthropic Covered Models retention policy - xAI May 15, 2026 model retirement guide ## Testing - pnpm dlx prettier@3.5.0 . --check - mdbook build docs Release Notes: - N/A
## Summary - Add an ACP-mode guard to the documented OpenCode bell plugin snippet - Preserve terminal bell notifications for Terminal Threads while avoiding writes to stdout when OpenCode is used as an ACP External Agent ## Rationale The OpenCode bell plugin writes BEL to stdout for Terminal Thread notifications. When the plugin is installed globally and OpenCode runs in ACP mode, stdout is the JSON-RPC transport. OpenCode sets `OPENCODE_CLIENT=acp` in this mode, so the guard prevents BEL bytes from corrupting ACP JSON-RPC messages, including usage updates and permission flows. Release Notes: - N/A
# Objective - Add a view option for group by staging. ## Solution - Add a new option for group_by under git_panel view options, with 2 sections "Staged" and "Unstaged", with buttons (+/-) to stage and unstage ## Testing - cargo check -p git_ui ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase <img width="1679" height="1140" alt="Screenshot 2026-06-25 at 2 09 44 PM" src="https://github.com/user-attachments/assets/1b605cad-7792-4823-983c-ada41be25504" /> --- Release Notes: - Added group by staging view option --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes zed-industries#55934 Release Notes: - Fixed terminal jitter when resizing vertically with content that doesn't fill the available height. --------- Co-authored-by: Nathan Sobo <nathan@zed.dev>
TODO: - [ ] Remove slop comments - [ ] Review APIs in detail # Objective - This PR aims to add official mobile API surfaces to GPUI ## Solution - This PR cross references several internal experiments to come up with a general cross-platform abstraction for core input mechanisms, but defers actual implementations to later. These are intended to be a common base to build off of. ## Testing - Yes, as mentioned above with external experiments ## Self-Review Checklist: - [ ] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - N/A
) Window roots whose size is `auto` now stretch to fill the window, the way the root element on the web fills the initial containing block. Previously a window root with no explicit size shrink-wrapped its content (flex/grid roots collapsed to content size in both axes), which is why every root view needed `size_full()`. Mechanically: `draw_roots` requests layout for the window root (and prompt roots), then `TaffyLayoutEngine::stretch_auto_size_to_fill` rewrites any `auto` dimension on the root node to the viewport size before layout runs. Explicitly styled root dimensions are preserved, and tooltips, drags, and anchored/deferred draws keep their shrink-wrap semantics. Includes regression tests covering both the auto-fill and explicit-size cases (the auto case collapses to 0×0 without the fix). Release Notes: - N/A --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Adds a `container_query` element to GPUI, in the spirit of CSS container
queries: the element's own size is determined solely by its style and
the space offered by its parent, and once that size is known the
provided closure is called with the measured size to build the contents.
```rust
container_query(|size, _window, _cx| {
if size.width < px(240.) {
div().child("Narrow layout")
} else {
div().child("Wide layout")
}
});
```
Implementation notes:
- Defaults to filling its parent (`size_full()` semantics), overridable
via `Styled` since contents can't influence the container's size (the
same constraint CSS container queries impose).
- Reworks the `grid_layout` example (the Holy Grail layout) to
demonstrate it: the three-column grid collapses to a stacked column when
the window is narrower than 400px, and the header shows the live
measured width.
Release Notes:
- N/A
---------
Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
The unstaged diff view introduced in the partially staged changes commit only had a Stage button but no Restore option. This adds: - A per-hunk Restore button in the inline hunk controls (disabled for new files) - A Restore button in the toolbar for selected hunks - A Restore All button in the toolbar to discard all unstaged changes - A restore method override on UnstagedDiffDelegate for the Restore action Release Notes: - Added restore buttons to the unstaged diff view for discarding unstaged changes. # Objective New unstaged and staged diffs were added in zed-industries#46541 . However for unstaged changes, only option available is to stage a change. It would also be a common use case to restore the changes. (Like how it is done in uncommitted changes). ## Solution - A per-hunk Restore button in the inline hunk controls (disabled for new files) - A Restore button in the toolbar for selected hunks - A Restore All button in the toolbar to discard all unstaged changes - A restore method override on UnstagedDiffDelegate for the Restore action ## Testing Tested in locally and ensured both features work ## Self-Review Checklist: - [ ] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable ## Showcase <img width="1141" height="635" alt="Screenshot 2026-07-09 at 9 00 47 AM" src="https://github.com/user-attachments/assets/b1d3f091-9f1d-49c6-87e6-9efad25e62dd" /> ## Note I am still learning rust bit by bit. Please let me know if something is massively wrong. This is assisted by AI but reviewed by me with best of my knowledge. --- Release Notes: - Added restore buttons to the unstaged diff view for discarding unstaged changes. --------- Signed-off-by: Pranav <pranav10121@gmail.com> Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
|
Important Review skippedToo many files! This PR contains 2638 files, which is 2488 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (122)
📒 Files selected for processing (2638)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
|
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.
Objective
mainwith upstreamzed-industries/zed, which it had fallen ~4.5 months behind (last synced commit6acc1a3, Feb 25, 2026).Solution
mainat60099a06("git_ui: Add restore buttons to unstaged diff view (git_ui: Add restore buttons to unstaged diff view zed-industries/zed#60639)", July 12, 2026).Testing
mainHEAD is a direct ancestor of upstreammain(git merge-base --is-ancestor), confirming a clean fast-forward with no local changes to reconcile.Self-Review Checklist:
Release Notes:
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ma4aDWK5Bm9V2zdxDnvNTh
Generated by Claude Code