Fix agent reading and editing files over SSH (#30144)

Release Notes:

- Fixed a bug that would prevent the agent from working over SSH.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
This commit is contained in:
Antonio Scandurra 2025-05-07 19:07:01 +02:00 committed by GitHub
parent 582ad845b9
commit 89430a019c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 321 additions and 1780 deletions

View file

@ -1,7 +1,7 @@
use crate::example::{Example, ExampleContext, ExampleMetadata, JudgeAssertion};
use anyhow::Result;
use assistant_settings::AgentProfileId;
use assistant_tools::StreamingEditFileToolInput;
use assistant_tools::EditFileToolInput;
use async_trait::async_trait;
pub struct CommentTranslation;
@ -34,8 +34,7 @@ impl Example for CommentTranslation {
for message in thread.messages() {
for tool_use in thread.tool_uses_for_message(message.id, cx) {
if tool_use.name == "edit_file" {
let input: StreamingEditFileToolInput =
serde_json::from_value(tool_use.input)?;
let input: EditFileToolInput = serde_json::from_value(tool_use.input)?;
if input.create_or_overwrite {
create_or_overwrite_count += 1;
}