zed/crates
MartinYe1234 620ceaaaca
agent: Flush thread content to database on app quit (#58962)
After prompting an agent, no response was received and only a spinner
was shown. After updating and reopening Zed, the thread still appeared
in the sidebar but failed to restore with `Failed to Launch` / `no
thread found with ID: SessionId(...)`, and the original prompt was lost.

## Root cause

A native agent thread is tracked by two independent persistence layers:

- **Sidebar metadata** (`ThreadMetadataStore`) and the **serialized
agent panel** record the thread's `session_id` through fast, separate
write paths.
- **Thread content** (`ThreadsDatabase`) is written by a per-session
async task (`NativeAgent::save_thread`) that can still be in flight when
the process exits.

When a graceful quit or update restart raced that async content save,
the metadata/serialized session id was persisted but the content row was
not. On restore, the metadata gate passes, then `load_thread` finds no
content row and hard-fails with `no thread found with ID`.

## Fix

Register an `on_app_quit` handler on `NativeAgent` that synchronously
commits every newly created non-empty thread's content to
`ThreadsDatabase` during shutdown, keeping the two stores consistent
across a graceful quit/restart (the auto-updater's path).

Closes AI-374

Release Notes:

- Fixed agent threads failing to restore after quitting or updating Zed
while a response was still in progress
2026-06-10 23:22:09 +00:00
..
acp_thread Stop rendering native slash commands as user messages (#58935) 2026-06-10 10:19:03 +00:00
acp_tools gpui: Allow chaining flex_grow() and flex_shrink() with custom factors (#58142) 2026-06-01 04:40:13 +00:00
action_log Refactor BufferDiff to allow multiple diffs to share the same base text buffer (#58266) 2026-06-09 20:13:13 +00:00
activity_indicator Fix activity indicator menu opening when actions are running (#56865) 2026-05-15 12:01:31 +00:00
agent agent: Flush thread content to database on app quit (#58962) 2026-06-10 23:22:09 +00:00
agent_servers remote: Do not swallow ssh errors (#58780) 2026-06-08 08:48:09 +00:00
agent_settings Add telemetry for context compaction (#58928) 2026-06-10 09:20:25 +00:00
agent_skills settings_ui: Move skills management into settings UI (#58701) 2026-06-08 14:57:47 +00:00
agent_ui agent_ui: Keep pending subagent edits when regenerating a prompt (#59060) 2026-06-10 22:54:28 +00:00
ai_onboarding component_preview: Clean up Component trait (#57731) 2026-05-29 07:06:57 +00:00
anthropic Add Claude Fable 5 to Anthropic BYOK (#58945) 2026-06-09 17:53:59 +00:00
askpass Fix SSH askpass on Windows by invoking cli.exe directly (#52491) 2026-06-08 09:37:00 +00:00
assets
audio Remove experimental microphone gain normalization option (#58677) 2026-06-05 16:49:42 +00:00
auto_update Change "Ok" to "OK" in UI (#58744) 2026-06-08 14:48:37 +00:00
auto_update_helper Fix Windows icon resource for bin zed.exe (#54738) 2026-05-01 22:33:54 +00:00
auto_update_ui Typed workspace errors (#57649) 2026-06-07 16:55:18 +00:00
aws_http_client
bedrock language_models: Support custom HTTP headers for provider requests (#55246) 2026-06-02 13:29:23 +00:00
benchmarks Bench app context phase 2 (#58202) 2026-06-10 09:26:50 +00:00
breadcrumbs gpui: Allow chaining flex_grow() and flex_shrink() with custom factors (#58142) 2026-06-01 04:40:13 +00:00
buffer_diff Refactor BufferDiff to allow multiple diffs to share the same base text buffer (#58266) 2026-06-09 20:13:13 +00:00
call Do not play join sound in large meetings (#54337) 2026-05-31 18:32:46 +00:00
channel scheduler: Add spawn_dedicated for single-threaded actors with !Send state (#57609) 2026-05-29 15:58:02 +00:00
cli Fix SSH askpass on Windows by invoking cli.exe directly (#52491) 2026-06-08 09:37:00 +00:00
client client: Format the whole error chain on failure to connect to Cloud (#59035) 2026-06-10 15:04:38 +00:00
clock
cloud_api_client cloud_api_client: Key the cached LlmApiToken by organization (#58915) 2026-06-09 19:12:34 +00:00
cloud_api_types cloud_api_client: Always pass up an organization ID when creating an LLM token (#58872) 2026-06-09 12:06:49 +00:00
cloud_llm_client Add supports_disabling_thinking to Cloud model listings (#58980) 2026-06-10 19:35:36 +00:00
codestral ep: Improve trigger granularity (#58561) 2026-06-04 22:52:29 +00:00
collab Refactor BufferDiff to allow multiple diffs to share the same base text buffer (#58266) 2026-06-09 20:13:13 +00:00
collab_ui outline: Switch the outline search to use fuzzy_nucleo (#56477) 2026-06-08 14:41:04 +00:00
collections Use no-op hasher for TypeId hashing (#58629) 2026-06-05 10:32:57 +00:00
command_palette Typed workspace errors (#57649) 2026-06-07 16:55:18 +00:00
command_palette_hooks Use no-op hasher for TypeId hashing (#58629) 2026-06-05 10:32:57 +00:00
component component_preview: Clean up Component trait (#57731) 2026-05-29 07:06:57 +00:00
component_preview gpui: Allow chaining flex_grow() and flex_shrink() with custom factors (#58142) 2026-06-01 04:40:13 +00:00
context_server Implement MCP OAuth client preregistration (#52900) 2026-05-19 17:45:07 +00:00
copilot ep: Improve trigger granularity (#58561) 2026-06-04 22:52:29 +00:00
copilot_chat copilot: Fix auth db fallback (#57764) 2026-05-28 15:00:31 +00:00
copilot_ui Typed workspace errors (#57649) 2026-06-07 16:55:18 +00:00
crashes Cleanup crashes crate (#54927) 2026-05-04 06:30:47 +00:00
credentials_provider
csv_preview csv_preview: Implement data_table columns pining (#56619) 2026-05-15 11:12:41 +00:00
dap dap: Support IPv6 addresses in TCP transport (#52244) 2026-04-27 08:42:45 +00:00
dap_adapters Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
db Remove smol as a dependency from a bunch of crates (#53603) 2026-04-24 10:29:51 +00:00
debug_adapter_extension
debugger_tools Fix macOS find query seeding (#56681) 2026-05-13 23:35:10 +00:00
debugger_ui Improve warning display UI related to skills (#58838) 2026-06-08 15:46:15 +00:00
deepseek language_models: Support custom HTTP headers for provider requests (#55246) 2026-06-02 13:29:23 +00:00
dev_container dev_container: Respect runServices for Docker Compose (#56293) 2026-05-29 05:12:28 +00:00
diagnostics Correctly handle file links in markdown and agent threads (#56024) 2026-06-05 11:17:44 +00:00
docs_preprocessor Staged docs releases (#50136) 2026-04-30 11:10:14 +00:00
edit_prediction cloud_api_client: Always pass up an organization ID when creating an LLM token (#58872) 2026-06-09 12:06:49 +00:00
edit_prediction_cli ep: Add more options to control split point (#58943) 2026-06-09 16:17:55 +00:00
edit_prediction_context ep: LSP telemetry (#58925) 2026-06-09 15:52:27 +00:00
edit_prediction_metrics ep: Minor changes to evaluate context retrieval (#58572) 2026-06-04 18:22:46 +00:00
edit_prediction_types ep: Improve trigger granularity (#58561) 2026-06-04 22:52:29 +00:00
edit_prediction_ui Refactor BufferDiff to allow multiple diffs to share the same base text buffer (#58266) 2026-06-09 20:13:13 +00:00
editor Bench app context phase 2 (#58202) 2026-06-10 09:26:50 +00:00
editor_benchmarks text: Preserve structural sharing when rebuilding the fragment tree (#58681) 2026-06-05 19:24:28 +00:00
encoding_selector Make all status bar tools able to hide its button via UI (#54971) 2026-05-08 10:36:03 +00:00
env_var
etw_tracing
eval_cli git_ui: Make git_ui call support optional (#58413) 2026-06-03 13:18:45 +00:00
eval_utils
explorer_command_injector
extension Use unstable sorts if deduplicating (#58751) 2026-06-08 19:47:30 +00:00
extension_api extension_api: Remove x86 support (#58259) 2026-06-04 11:01:48 +00:00
extension_cli extension: Perform compilation tasks in parallel (#55160) 2026-06-07 16:39:58 +00:00
extension_host extension: Perform compilation tasks in parallel (#55160) 2026-06-07 16:39:58 +00:00
extensions_ui Typed workspace errors (#57649) 2026-06-07 16:55:18 +00:00
feature_flags Remove handoff feature flag and un-gate compaction (#58931) 2026-06-10 10:02:53 +00:00
feature_flags_macros Feature flag overrides (#54206) 2026-04-18 06:34:19 +00:00
feedback Cleanup crashes crate (#54927) 2026-05-04 06:30:47 +00:00
file_finder file_finder: Fix path duplication when opening non-project files with a filter (#54944) 2026-06-02 13:38:47 +00:00
file_icons
fs Update notify to v9.0.0-rc.4 (#58944) 2026-06-09 20:24:45 +00:00
fs_benchmarks
fuzzy
fuzzy_nucleo outline: Switch the outline search to use fuzzy_nucleo (#56477) 2026-06-08 14:41:04 +00:00
git git_ui: Add Add to .git/info/exclude option to context menus (#57044) 2026-06-08 19:37:22 +00:00
git_hosting_providers Fix GitHub bot avatar URL (#55297) 2026-04-30 14:17:32 +00:00
git_ui git_ui: Add button to remove open worktrees from the window in the worktree picker (#58996) 2026-06-10 14:54:19 +00:00
go_to_line go_to_line: Fix go to line in multibuffers (#57700) 2026-05-26 13:41:28 +00:00
google_ai language_models: Support custom HTTP headers for provider requests (#55246) 2026-06-02 13:29:23 +00:00
gpui Bench app context phase 2 (#58202) 2026-06-10 09:26:50 +00:00
gpui_linux linux: Fix Wayland clipboard reads blocking indefinitely (#58826) 2026-06-08 12:23:04 +00:00
gpui_macos Bench app context phase 2 (#58202) 2026-06-10 09:26:50 +00:00
gpui_macros Bench app context phase 2 (#58202) 2026-06-10 09:26:50 +00:00
gpui_platform
gpui_shared_string gpui_shared_string: Implement SharedString via smol_str (#54649) 2026-04-24 08:58:26 +00:00
gpui_tokio gpui_tokio: Use shutdown_background to avoid WASI panic on exit (#53904) 2026-04-14 18:14:31 +02:00
gpui_util Use no-op hasher for TypeId hashing (#58629) 2026-06-05 10:32:57 +00:00
gpui_web Log worst hanging tasks and actions (#57835) 2026-06-02 12:03:05 +00:00
gpui_wgpu gpui: Free atlas tile space when removing tiles (#58874) 2026-06-08 23:09:47 +00:00
gpui_windows Fix miscellaneous typos (#58979) 2026-06-09 22:46:22 +00:00
grammars Fix indentations for expressions in C/C++ (#58740) 2026-06-09 03:12:17 +00:00
html_to_markdown
http_client acp: Support raw agent registry binaries (#58579) 2026-06-05 09:26:19 +00:00
http_client_tls
icons Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
image_viewer image_viewer: Reveal images in file manager from keyboard shortcut (#56438) 2026-06-08 21:24:44 +00:00
input_latency_ui telemetry: Add latency metrics (#54454) 2026-04-22 22:22:10 +00:00
inspector_ui Improve warning display UI related to skills (#58838) 2026-06-08 15:46:15 +00:00
install_cli Change "Ok" to "OK" in UI (#58744) 2026-06-08 14:48:37 +00:00
journal Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
json_schema_store Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
keymap_editor Improve warning display UI related to skills (#58838) 2026-06-08 15:46:15 +00:00
language Refactor BufferDiff to allow multiple diffs to share the same base text buffer (#58266) 2026-06-09 20:13:13 +00:00
language_core language: Support emitting multiple runnables from a single tree-sitter match (#57276) 2026-06-02 13:59:39 +00:00
language_extension
language_model Add supports_disabling_thinking to Cloud model listings (#58980) 2026-06-10 19:35:36 +00:00
language_model_core Return typed completion errors from Cloud provider (#58997) 2026-06-10 14:29:02 +00:00
language_models Add supports_disabling_thinking to Cloud model listings (#58980) 2026-06-10 19:35:36 +00:00
language_models_cloud Add supports_disabling_thinking to Cloud model listings (#58980) 2026-06-10 19:35:36 +00:00
language_onboarding
language_selector Make all status bar tools able to hide its button via UI (#54971) 2026-05-08 10:36:03 +00:00
language_tools Escape control characters in syntax tree view (#59012) 2026-06-10 09:28:16 +00:00
languages go: Fix table test detection in large files (#57277) 2026-06-03 10:53:22 +00:00
line_ending_selector Make all status bar tools able to hide its button via UI (#54971) 2026-05-08 10:36:03 +00:00
livekit_api
livekit_client Remove experimental microphone gain normalization option (#58677) 2026-06-05 16:49:42 +00:00
lmstudio language_models: Support custom HTTP headers for provider requests (#55246) 2026-06-02 13:29:23 +00:00
lsp lsp: Fix retained notification subscriptions leaking dropped language servers (#58866) 2026-06-08 21:24:36 +00:00
markdown Hide markdown code block scrollbar when wrapped (#58472) 2026-06-04 08:01:09 +00:00
markdown_preview Correctly handle file links in markdown and agent threads (#56024) 2026-06-05 11:17:44 +00:00
media
menu
mermaid_render mermaid: The other half of #57967 (#58419) 2026-06-03 14:10:43 +00:00
migrator Handle hiding cursor on keyboard input at GPUI level (#55664) 2026-05-04 22:51:56 +00:00
miniprofiler_ui Log worst hanging tasks and actions (#57835) 2026-06-02 12:03:05 +00:00
mistral language_models: Support custom HTTP headers for provider requests (#55246) 2026-06-02 13:29:23 +00:00
multi_buffer Refactor BufferDiff to allow multiple diffs to share the same base text buffer (#58266) 2026-06-09 20:13:13 +00:00
net
node_runtime node_runtime: Tolerate non-string values in npm time metadata (#57765) 2026-05-27 04:39:26 +00:00
notifications component_preview: Clean up Component trait (#57731) 2026-05-29 07:06:57 +00:00
oauth_callback_server Add ChatGPT subscription provider via OAuth 2.0 PKCE (#53166) 2026-05-14 21:03:56 +00:00
ollama language_models: Support custom HTTP headers for provider requests (#55246) 2026-06-02 13:29:23 +00:00
onboarding Change "Ok" to "OK" in UI (#58744) 2026-06-08 14:48:37 +00:00
open_ai language_models: Support custom HTTP headers for provider requests (#55246) 2026-06-02 13:29:23 +00:00
open_path_prompt Fix race condition in OpenPathDelegate (#57290) 2026-05-21 03:59:50 +00:00
open_router Fix lost error messages when listing OpenRouter models (#58502) 2026-06-04 11:18:14 +00:00
opencode opencode: Model updates (#58743) 2026-06-06 20:28:26 +00:00
outline outline: Switch the outline search to use fuzzy_nucleo (#56477) 2026-06-08 14:41:04 +00:00
outline_panel outline: Switch the outline search to use fuzzy_nucleo (#56477) 2026-06-08 14:41:04 +00:00
panel git_panel: Add commit history view (#56500) 2026-05-12 15:52:52 +00:00
paths Migrate Rules to global Skills and AGENTS.md (#56672) 2026-05-14 16:30:08 +00:00
picker agent_ui: Fix crash when filtering tools in the agent profile tool picker (#58299) 2026-06-02 08:43:52 +00:00
platform_title_bar Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
prettier
project debugger: Fix running ignored Rust tests in nested modules (#54787) 2026-06-10 13:06:15 +00:00
project_benchmarks Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
project_panel Remove outdated TODO comment (#58985) 2026-06-09 23:51:54 +00:00
project_symbols Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
prompt_store agent: Warn about long skill descriptions (#58356) 2026-06-05 19:46:05 +00:00
proto acp: Indicate when agent is downloading (#57710) 2026-06-02 09:40:28 +00:00
recent_projects Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
refineable
release_channel Add a function to produce docs scoped to release channel (#56917) 2026-05-15 21:17:43 +00:00
remote Fix SSH askpass on Windows by invoking cli.exe directly (#52491) 2026-06-08 09:37:00 +00:00
remote_connection agent: Fix find_or_create repository to support remote (#54074) 2026-04-16 16:36:09 -07:00
remote_server Log worst hanging tasks and actions (#57835) 2026-06-02 12:03:05 +00:00
repl Log worst hanging tasks and actions (#57835) 2026-06-02 12:03:05 +00:00
reqwest_client Actually remove file (#56223) 2026-05-08 21:03:40 +00:00
rope Bump ctor (#57728) 2026-05-27 10:31:53 +00:00
rpc Use no-op hasher for TypeId hashing (#58629) 2026-06-05 10:32:57 +00:00
sandbox Add sandbox crate with macOS Seatbelt integration (#57429) 2026-05-27 20:35:32 +00:00
scheduler Fix TestScheduler::spawn_dedicated leaking due to cycle (#58802) 2026-06-08 15:44:17 +00:00
schema_generator
search agent: Warn about long skill descriptions (#58356) 2026-06-05 19:46:05 +00:00
session
settings Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
settings_content Disable commit title width limit by default (#58960) 2026-06-10 15:00:07 +00:00
settings_json
settings_macros
settings_profile_selector
settings_ui Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
shell_command_parser Extract nested command substitutions from arithmetic expansions (#54690) 2026-05-05 16:25:56 +00:00
sidebar Fix not being able to scroll sidebar when the mouse is hovering a header (#59054) 2026-06-10 19:27:15 +00:00
snippet
snippet_provider Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
snippets_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
sqlez Remove smol as a dependency from a bunch of crates (#53603) 2026-04-24 10:29:51 +00:00
sqlez_macros
streaming_diff Speed up StreamingDiff::push_new part two (#57849) 2026-05-27 19:33:04 +00:00
sum_tree Bump ctor (#57728) 2026-05-27 10:31:53 +00:00
svg_preview
syntax_theme
system_specs Cleanup crashes crate (#54927) 2026-05-04 06:30:47 +00:00
tab_switcher tab_switcher: Show full file names without truncation (#58483) 2026-06-04 05:21:56 +00:00
task Fix miscellaneous typos (#58979) 2026-06-09 22:46:22 +00:00
tasks_ui Change .join("") to .concat() (#58200) 2026-06-01 17:04:14 +00:00
telemetry
telemetry_events
terminal Make zed:// links clickable in terminal (#58910) 2026-06-09 12:52:06 +00:00
terminal_view Change .join("") to .concat() (#58200) 2026-06-01 17:04:14 +00:00
text Refactor BufferDiff to allow multiple diffs to share the same base text buffer (#58266) 2026-06-09 20:13:13 +00:00
theme Fix error prompt darkened background exceeding window boundaries on Linux (#57608) 2026-06-08 14:59:39 +00:00
theme_extension
theme_importer
theme_selector theme_selector: Mark the active theme with a check icon (#58404) 2026-06-03 13:56:42 +00:00
theme_settings Make the commit editor's font size independently configurable (#56077) 2026-05-21 22:16:01 +00:00
time_format time_format: Show compound "N years, M months ago" for blame entries (#57973) 2026-05-28 19:43:30 +00:00
title_bar Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
toolchain_selector Make all status bar tools able to hide its button via UI (#54971) 2026-05-08 10:36:03 +00:00
ui Improve warning display UI related to skills (#58838) 2026-06-08 15:46:15 +00:00
ui_input settings_ui: Move skills management into settings UI (#58701) 2026-06-08 14:57:47 +00:00
ui_macros component_preview: Clean up Component trait (#57731) 2026-05-29 07:06:57 +00:00
ui_prompt Fix error prompt darkened background exceeding window boundaries on Linux (#57608) 2026-06-08 14:59:39 +00:00
util Improve sandbox write-path handling (#58283) 2026-06-02 18:15:07 +00:00
util_macros
vim helix: Fix line selection after undoing delete (#55365) 2026-06-05 16:50:02 +00:00
vim_mode_setting
watch Bump ctor (#57728) 2026-05-27 10:31:53 +00:00
web_search
web_search_providers cloud_api_client: Always pass up an organization ID when creating an LLM token (#58872) 2026-06-09 12:06:49 +00:00
which_key
windows_resources Fix Windows icon resource for bin zed.exe (#54738) 2026-05-01 22:33:54 +00:00
workspace Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
worktree Fix stale Git UI on reftable repositories on Linux (#58719) 2026-06-08 18:37:40 +00:00
worktree_benchmarks
x_ai x_ai: Add support for specifying reasoning effort (#58078) 2026-05-29 16:28:27 +00:00
zed zed: Hide log file actions when logging to stdout (#57114) 2026-06-10 22:16:38 +00:00
zed_actions Allow opening a new window by default (#58805) 2026-06-10 12:02:29 +00:00
zed_credentials_provider
zed_env_vars
zeta_prompt Limit top context identifiers and diagnostics (#58870) 2026-06-08 22:43:48 +00:00
zlog
zlog_settings
ztracing Relicense Zed source code under GPL (#57948) 2026-05-28 20:19:17 +00:00
ztracing_macro Relicense Zed source code under GPL (#57948) 2026-05-28 20:19:17 +00:00