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:
parent
582ad845b9
commit
89430a019c
31 changed files with 321 additions and 1780 deletions
|
@ -4,7 +4,7 @@ use assistant_tool::{ActionLog, Tool, ToolResult};
|
|||
use futures::StreamExt;
|
||||
use gpui::{AnyWindowHandle, App, Entity, Task};
|
||||
use language::{OffsetRangeExt, ParseStatus, Point};
|
||||
use language_model::{LanguageModelRequestMessage, LanguageModelToolSchemaFormat};
|
||||
use language_model::{LanguageModel, LanguageModelRequestMessage, LanguageModelToolSchemaFormat};
|
||||
use project::{
|
||||
Project,
|
||||
search::{SearchQuery, SearchResult},
|
||||
|
@ -99,6 +99,7 @@ impl Tool for GrepTool {
|
|||
_messages: &[LanguageModelRequestMessage],
|
||||
project: Entity<Project>,
|
||||
_action_log: Entity<ActionLog>,
|
||||
_model: Arc<dyn LanguageModel>,
|
||||
_window: Option<AnyWindowHandle>,
|
||||
cx: &mut App,
|
||||
) -> ToolResult {
|
||||
|
@ -281,6 +282,7 @@ mod tests {
|
|||
use assistant_tool::Tool;
|
||||
use gpui::{AppContext, TestAppContext};
|
||||
use language::{Language, LanguageConfig, LanguageMatcher};
|
||||
use language_model::fake_provider::FakeLanguageModel;
|
||||
use project::{FakeFs, Project};
|
||||
use settings::SettingsStore;
|
||||
use unindent::Unindent;
|
||||
|
@ -743,7 +745,8 @@ mod tests {
|
|||
) -> String {
|
||||
let tool = Arc::new(GrepTool);
|
||||
let action_log = cx.new(|_cx| ActionLog::new(project.clone()));
|
||||
let task = cx.update(|cx| tool.run(input, &[], project, action_log, None, cx));
|
||||
let model = Arc::new(FakeLanguageModel::default());
|
||||
let task = cx.update(|cx| tool.run(input, &[], project, action_log, model, None, cx));
|
||||
|
||||
match task.output.await {
|
||||
Ok(result) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue