ZIm/crates
Michael Sloan 9bdfd1e98a
gpui: Fix pending keys dispatch path panic (#32891)
For me this is a panic that started occurring today in my use of Zed.
The repro is to type `ctrl-x` to start a pending key sequence and then
close the collab side panel with the mouse. The issue is that
dispatching the action based on pending keystrokes uses the same
`DispatchNodeId` as when the 1 second timer was started.
`DispatchNodeId` is not stable across frames. This also means that the
wrong `DispatchNodeId` can be used in the non-panicing case, potentially
causing the action to not occur.

The mystery here is why did this only start happening now in my use of
Zed, and why isn't it showing up in the panics dashboard / issue
reports.

Panic looks like

```
{
  "thread": "main",
  "payload": "index out of bounds: the len is 467 but the index is 1861",
  "location_data": {
    "file": "crates/gpui/src/key_dispatch.rs",
    "line": 519
  },
  "backtrace": [
    "zed::reliability::init_panic_hook::{{closure}}::he1d8257b19b16eec+155265758",
    "std::panicking::rust_panic_with_hook::h33b18b24045abff4+128544307",
    "std::panicking::begin_panic_handler::{{closure}}::hf8313cc2fd0126bc+128543530",
    "std::sys::backtrace::__rust_end_short_backtrace::h57fe07c8aea5c98a+128537145",
    "__rustc[95feac21a9532783]::rust_begin_unwind+128542669",
    "core::panicking::panic_fmt::hd54fb667be51beea+9456688",
    "core::panicking::panic_bounds_check::h1a9bf3d94de0fc80+9457170",
    "gpui::key_dispatch::DispatchTree::dispatch_path::hce77d277881569bf+73992023",
    "gpui::app::App::spawn::{{closure}}::hb1e79bbbdead3012+73687056",
    "async_task::raw::RawTask<F,T,S,M>::run::hd13f66f99bb24bbd+70694231",
    "<gpui::platform::linux::x11::client::X11Client as gpui::platform::linux::platform::LinuxClient>::run::h5a92ddaaf9a06dd1+74465138",
    "gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run::hd19ac52b2d94268e+74064525",
    "gpui::app::Application::run::hee83110c717a5af0+151862692",
    "zed::main::hca7e2265584c4139+153307630",
    "std::sys::backtrace::__rust_begin_short_backtrace::h2e04f4034c2d82c5+153146899",
    "std::rt::lang_start::{{closure}}::h91cf1ca0eeae23ae+154454121",
    "std::rt::lang_start_internal::h418648f91f5be3a1+128467809",
    "main+153326748",
    "__libc_start_call_main+25056432783818",
    "__libc_start_main_impl+25056432784011",
    "_start+12389486"
  ],
  "app_version": "0.190.6",
  "app_commit_sha": "9a2dcbbe24",
  "release_channel": "stable",
  "target": "x86_64-unknown-linux-gnu",
  "os_name": "Linux X11",
  "os_version": "ubuntu 24.04",
  "architecture": "x86_64",
  "panicked_on": 1750185799233,
  "system_id": "abae7201-61fb-442b-922b-202071ae81c0",
  "installation_id": "69a0fb9a-11a2-4065-ad8c-b281e68525ad",
  "session_id": "bc5b5f2f-e4c3-44a8-948e-c0550a2e2ef2"
}
```

Release Notes:

- Fixed a rare panic / potential incorrect action dispatch when a
pending keysequence is applied after the 1 second timer elapsing.
2025-06-18 01:40:59 +00:00
..
activity_indicator Move r-a status into the activity indicator (#32726) 2025-06-13 22:33:02 +00:00
agent Revert "debugger: Process ANSI color escape codes in console" (#32906) 2025-06-17 22:13:12 +00:00
agent_settings language_models: Add images support to LMStudio provider (#32741) 2025-06-17 12:14:44 +02:00
anthropic Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
askpass supermaven_api: Ensure downloaded Supermaven binary has executable permissions set (#32576) 2025-06-17 14:39:45 +00:00
assets Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
assistant_context_editor Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
assistant_slash_command chore: Make terminal_view own the TerminalSlashCommand (#31070) 2025-05-21 09:27:54 +00:00
assistant_slash_commands Remove separator! macro and make path! handle relative paths (#32527) 2025-06-13 06:32:29 +00:00
assistant_tool agent: Less disruptive changed file notification (#31693) 2025-06-16 18:45:24 +03:00
assistant_tools assistant_tools: Enable diff-fenced edit parser for all Gemini models (#32812) 2025-06-16 22:01:55 +03:00
audio agent: Add sound notification when done generating (#31472) 2025-05-26 21:20:41 -03:00
auto_update Silence failed auto update checks (#32696) 2025-06-13 13:11:02 -04:00
auto_update_helper Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
auto_update_ui Fix release notes appearing in project search (#32898) 2025-06-17 20:56:41 +00:00
aws_http_client Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
bedrock Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
breadcrumbs breadcrumbs: Stylize filename in breadcrumbs when tab-bar is off and file is dirty (#30507) 2025-05-30 08:32:54 -07:00
buffer_diff zlog: Replace usages of env_logger in tests with zlog (#31436) 2025-05-26 11:48:50 -04:00
call Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
channel Use git config --global user.email for email address in automatic Co-authored-by (#32624) 2025-06-12 19:39:08 +00:00
cli Disallow running CLI with root privileges (#32583) 2025-06-13 13:09:32 -04:00
client Correct variable name in project type detection (#32835) 2025-06-17 06:29:44 +00:00
clock Add the ability to follow the agent as it makes edits (#29839) 2025-05-04 08:28:39 +00:00
collab Show inline previews for LSP document colors (#32816) 2025-06-17 13:46:21 +00:00
collab_ui Revert "debugger: Process ANSI color escape codes in console" (#32906) 2025-06-17 22:13:12 +00:00
collections Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
command_palette Validate actions in docs (#31073) 2025-06-04 19:18:12 +00:00
command_palette_hooks Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
component Fix typo (#32160) 2025-06-05 12:59:22 +00:00
context_server context_server: Make notifications type safe (#32396) 2025-06-09 15:11:01 +00:00
copilot Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
credentials_provider Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
dap debugger: Add comment-preserving debug.json editing (#32896) 2025-06-17 15:51:05 -07:00
dap_adapters debugger: Prevent port collision when attaching to existing node debugger (#32862) 2025-06-17 13:22:32 +00:00
db Misc nitpicks, changes too small / unrelated to be in other PRs (#32768) 2025-06-15 19:51:04 +00:00
debug_adapter_extension extensions: Yet another PR for debugger touchups (#32822) 2025-06-17 07:34:55 +00:00
debugger_tools debugger: Improve logging of debug sessions (#32718) 2025-06-13 20:56:23 +00:00
debugger_ui debugger: Add comment-preserving debug.json editing (#32896) 2025-06-17 15:51:05 -07:00
deepseek Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
diagnostics Show inline previews for LSP document colors (#32816) 2025-06-17 13:46:21 +00:00
docs_preprocessor Validate actions in docs (#31073) 2025-06-04 19:18:12 +00:00
editor Revert "debugger: Process ANSI color escape codes in console" (#32906) 2025-06-17 22:13:12 +00:00
eval agent: Less disruptive changed file notification (#31693) 2025-06-16 18:45:24 +03:00
extension extensions: Yet another PR for debugger touchups (#32822) 2025-06-17 07:34:55 +00:00
extension_api extensions: Yet another PR for debugger touchups (#32822) 2025-06-17 07:34:55 +00:00
extension_cli extensions: Add "Debug Adapters" category to the extension store (#32845) 2025-06-17 12:09:08 +02:00
extension_host supermaven_api: Ensure downloaded Supermaven binary has executable permissions set (#32576) 2025-06-17 14:39:45 +00:00
extensions_ui extensions: Add "Debug Adapters" category to the extension store (#32845) 2025-06-17 12:09:08 +02:00
feature_flags debugger: Remove feature flag (#32877) 2025-06-17 13:56:19 -06:00
feedback Add (flatpak) and (snap) suffixes to Zed version in system info (#32903) 2025-06-17 20:39:35 +00:00
file_finder Remove separator! macro and make path! handle relative paths (#32527) 2025-06-13 06:32:29 +00:00
file_icons Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
fs Don't autosave unmodified buffers (#32626) 2025-06-12 22:12:14 +00:00
fsevent Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
fuzzy Fix out-of-bounds panic in fuzzy matcher with Unicode/multibyte characters (#30546) 2025-05-12 14:43:14 +00:00
git Use git config --global user.email for email address in automatic Co-authored-by (#32624) 2025-06-12 19:39:08 +00:00
git_hosting_providers Allow configuring custom git hosting providers in project settings (#31929) 2025-06-03 12:23:01 -04:00
git_ui Fix diff indicators not restored when reopening remote project (#31384) 2025-06-17 10:07:51 -04:00
go_to_line go_to_line: Show position relative to current excerpt in a multi-buffer (#31947) 2025-06-03 09:41:45 +02:00
google_ai Update Gemini Models (#32902) 2025-06-17 20:26:27 +00:00
gpui gpui: Fix pending keys dispatch path panic (#32891) 2025-06-18 01:40:59 +00:00
gpui_macros Add a live Rust style editor to inspector to edit a sequence of no-argument style modifiers (#31443) 2025-05-26 17:43:57 +00:00
gpui_tokio Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
html_to_markdown Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
http_client Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
http_client_tls Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
icons debugger: Add 'open docs' button in the panel and mention onboarding in the docs (#32496) 2025-06-10 21:56:29 +00:00
image_viewer Option to auto-close deleted files with no unsaved edits (#31920) 2025-06-03 13:18:29 +02:00
indexed_docs Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
inline_completion Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
inline_completion_button inline_completion_button: Fix links to account page (#31558) 2025-05-27 21:52:42 +00:00
inspector_ui Fix anchor biases for completion replacement ranges (esp slash commands) (#32262) 2025-06-06 20:54:00 +00:00
install_cli Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
jj Add a picker for jj bookmark list (#30883) 2025-05-17 16:42:45 +00:00
jj_ui Add a picker for jj bookmark list (#30883) 2025-05-17 16:42:45 +00:00
journal VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
language Show inline previews for LSP document colors (#32816) 2025-06-17 13:46:21 +00:00
language_extension supermaven_api: Ensure downloaded Supermaven binary has executable permissions set (#32576) 2025-06-17 14:39:45 +00:00
language_model Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
language_models Update Gemini Models (#32902) 2025-06-17 20:26:27 +00:00
language_selector Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
language_tools Revert "debugger: Process ANSI color escape codes in console" (#32906) 2025-06-17 22:13:12 +00:00
languages supermaven_api: Ensure downloaded Supermaven binary has executable permissions set (#32576) 2025-06-17 14:39:45 +00:00
livekit_api Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
livekit_client Use upstream cpal (#32571) 2025-06-11 22:44:20 +03:00
lmstudio Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
lsp Show inline previews for LSP document colors (#32816) 2025-06-17 13:46:21 +00:00
markdown chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
markdown_preview chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
media Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
menu agent: Add new panel navigation dropdown (#29539) 2025-04-29 21:58:45 -03:00
migrator Fix MCP settings migration continually adding the same key (#32848) 2025-06-17 09:32:08 +00:00
mistral Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
multi_buffer Improve code for unsaved tab titles (#32770) 2025-06-15 21:18:09 +00:00
node_runtime Replace async-watch with a custom watch (#32245) 2025-06-06 16:00:09 +00:00
notifications Move workspace::toast_layer::RunAction to zed_actions::toast::RunAction (#32222) 2025-06-06 06:23:09 +00:00
ollama Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
open_ai Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
open_router Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
outline Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
outline_panel gpui: Simplify uniform list API by removing entity param (#32480) 2025-06-10 18:50:57 +00:00
panel Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
paths Improve logic for finding VSCode / Cursor settings files (#32721) 2025-06-14 21:39:54 -06:00
picker gpui: Simplify uniform list API by removing entity param (#32480) 2025-06-10 18:50:57 +00:00
prettier Improve logging of prettier errors (#32665) 2025-06-13 07:26:06 +00:00
project Revert "debugger: Process ANSI color escape codes in console" (#32906) 2025-06-17 22:13:12 +00:00
project_panel project_panel: Allow collapse all from workspace context (#32660) 2025-06-13 12:26:29 +05:30
project_symbols Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
prompt_store Include full abs paths of worktrees in system prompt (#32725) 2025-06-15 15:45:26 +02:00
proto Show inline previews for LSP document colors (#32816) 2025-06-17 13:46:21 +00:00
recent_projects Add Caps Lock support (#30470) 2025-06-18 00:43:33 +00:00
refineable Add a live Rust style editor to inspector to edit a sequence of no-argument style modifiers (#31443) 2025-05-26 17:43:57 +00:00
release_channel Use shortened SHA when displaying version to install (#31281) 2025-05-23 14:53:53 +00:00
remote Make it possible to use cargo-zigbuild for ZED_BUILD_REMOTE_SERVER (#31467) 2025-05-27 16:56:27 +00:00
remote_server Fix diff indicators not restored when reopening remote project (#31384) 2025-06-17 10:07:51 -04:00
repl Fix clicking in to agent message editor and tighten up vertical spacing (#32765) 2025-06-15 18:45:44 +00:00
reqwest_client Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
rich_text Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
rope chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
rpc extensions: Add "Debug Adapters" category to the extension store (#32845) 2025-06-17 12:09:08 +02:00
rules_library Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
schema_generator Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
search Revert "debugger: Process ANSI color escape codes in console" (#32906) 2025-06-17 22:13:12 +00:00
semantic_index Remove separator! macro and make path! handle relative paths (#32527) 2025-06-13 06:32:29 +00:00
semantic_version Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
session Avoid unnecessary DB writes (#29417) 2025-04-25 17:41:49 +03:00
settings Improve logic for finding VSCode / Cursor settings files (#32721) 2025-06-14 21:39:54 -06:00
settings_ui Improve logic for finding VSCode / Cursor settings files (#32721) 2025-06-14 21:39:54 -06:00
snippet Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
snippet_provider Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
snippets_ui snippets: Add icons and file names to snippet scope selector (#30212) 2025-05-26 13:44:09 +00:00
sqlez Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
sqlez_macros Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
story gpui: Add a standard text example (#30747) 2025-05-16 17:35:44 +02:00
storybook Fix clicking in to agent message editor and tighten up vertical spacing (#32765) 2025-06-15 18:45:44 +00:00
streaming_diff Introduce a new StreamingEditFileTool (#29733) 2025-05-01 17:37:43 +02:00
sum_tree chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
supermaven Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
supermaven_api supermaven_api: Ensure downloaded Supermaven binary has executable permissions set (#32576) 2025-06-17 14:39:45 +00:00
tab_switcher tab_switcher: Add placeholder text (#31697) 2025-05-29 16:09:07 +00:00
task Revert "Bail and signal error when the cwd of a resolved task doesn't exist" (#32866) 2025-06-17 14:01:16 +00:00
tasks_ui Remove separator! macro and make path! handle relative paths (#32527) 2025-06-13 06:32:29 +00:00
telemetry Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
telemetry_events Add new action to run agent eval (#29158) 2025-04-21 21:30:21 -07:00
terminal terminal: Fix file paths links with URL escapes not being clickable (#31830) 2025-06-15 19:20:01 +00:00
terminal_view Revert "Bail and signal error when the cwd of a resolved task doesn't exist" (#32866) 2025-06-17 14:01:16 +00:00
text chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
theme Refine styling of merge conflicts (#31012) 2025-06-09 19:03:19 +00:00
theme_extension Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
theme_importer theme: Add colors for minimap thumb and border (#30785) 2025-05-26 18:23:41 +00:00
theme_selector Allow running certain Zed actions when headless (#32095) 2025-06-04 17:29:08 +00:00
time_format agent: Add date separators to Thread History (#29961) 2025-05-06 10:18:48 +00:00
title_bar title_bar: Use theme colors for window controls on Windows (#32400) 2025-06-12 11:09:05 -04:00
toolchain_selector python: Re-land usage of source file path in toolchain picker (#31893) 2025-06-02 16:29:06 +00:00
ui agent: Suggest turning burn mode on when close to the context window limit (#32691) 2025-06-13 11:41:17 -03:00
ui_input component: Replace linkme with inventory (#30705) 2025-05-14 23:29:11 +02:00
ui_macros Update syn crate from 1.0.109 to 2.0.101 (#31301) 2025-05-23 19:31:25 +00:00
ui_prompt gpui: Improve window.prompt to support ESC with non-English cancel text on macOS (#29538) 2025-05-30 15:26:27 +00:00
util supermaven_api: Ensure downloaded Supermaven binary has executable permissions set (#32576) 2025-06-17 14:39:45 +00:00
util_macros Remove separator! macro and make path! handle relative paths (#32527) 2025-06-13 06:32:29 +00:00
vim Revert "debugger: Process ANSI color escape codes in console" (#32906) 2025-06-17 22:13:12 +00:00
vim_mode_setting VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
watch chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
web_search agent: Expose web search tool to beta users (#29273) 2025-04-23 15:30:20 +00:00
web_search_providers Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
welcome Cursor keymap (#31702) 2025-05-29 15:20:58 -04:00
workspace Revert "Bail and signal error when the cwd of a resolved task doesn't exist" (#32866) 2025-06-17 14:01:16 +00:00
worktree chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
zed Add (flatpak) and (snap) suffixes to Zed version in system info (#32903) 2025-06-17 20:39:35 +00:00
zed_actions debugger: Improve debugger panel empty state (#32889) 2025-06-17 20:50:46 +02:00
zeta Misc nitpicks, changes too small / unrelated to be in other PRs (#32768) 2025-06-15 19:51:04 +00:00
zlog Initialize zlog default filters on init rather than waiting for settings load (#32209) 2025-06-06 00:49:30 -06:00
zlog_settings VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00