Tags: jamilahmadzai/zed
Tags
agent: Make messages vec cheap to clone (zed-industries#57712) For long threads we will spend more and more time cloning the messages just to save them to the database, as we need a copy of everything to do so asynchronously. Messages are really expensive to clone though and we accumulate a lot of them really fast, so even for smaller threads we start seeing pauses in the millisecond range. The fix to this is fairly simple though, we never mutate the messages once pushed to the vec, so just Arc them. This PR also slightly changes `UserMessage` to be a bit faster to clone as well. Release Notes: - Fixed a cause of stutters when interacting with the agent
Fix git hang caused by accidental inheritance of stdin FD (zed-indust… …ries#57572) When restarting Zed, I hit a bug where all Git operations were hung. I realized that there was a hanging git process running `git cat-file --batch-check=%(objectname)`. The process was waiting on stdin. This was surprising, because [the code](https://github.com/zed-industries/zed/blob/e2bbdb19b6da2ee157ca1d36100acde2134a1663/crates/git/src/repository.rs#L1665-L1709) that spawns this process explicitly closes the pipe that is attached to the process's stdin after writing a list of ref names. Using Claude, I found that this could be caused by that pipe file descriptor being cloned due to file descriptor inheritance when another child process is `exec`'d while that stdin pipe is open. The fix is to enhance our Darwin process spawning layer to set the close-on-exec flag for the pipe file descriptors, so that they are not inherited by child processes spawned using code paths that don't set `POSIX_SPAWN_CLOEXEC_DEFAULT`. Release Notes: - Fixed a bug on macOS where Git operations could be blocked depending on the timing of spawning child processes.
PreviousNext