Include EditAgent's raw output when inspecting thread (#30337)

This allows us to debug the raw edits that were generated when people
report feedback, when running evals and when opening the thread as
Markdown.

Release Notes:

- Improved debug output for agent threads.
This commit is contained in:
Antonio Scandurra
2025-05-09 06:58:45 +00:00
committed by GitHub
parent ea7756b362
commit 1b593f616f
6 changed files with 37 additions and 14 deletions
+4 -2
View File
@@ -1,6 +1,6 @@
use crate::{
Templates,
edit_agent::{EditAgent, EditAgentOutputEvent},
edit_agent::{EditAgent, EditAgentOutput, EditAgentOutputEvent},
schema::json_schema_for,
};
use anyhow::{Result, anyhow};
@@ -88,6 +88,7 @@ pub struct EditFileToolOutput {
pub original_path: PathBuf,
pub new_text: String,
pub old_text: String,
pub raw_output: Option<EditAgentOutput>,
}
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
@@ -248,7 +249,7 @@ impl Tool for EditFileTool {
EditAgentOutputEvent::OldTextNotFound(_) => hallucinated_old_text = true,
}
}
output.await?;
let agent_output = output.await?;
project
.update(cx, |project, cx| project.save_buffer(buffer.clone(), cx))?
@@ -268,6 +269,7 @@ impl Tool for EditFileTool {
original_path: project_path.path.to_path_buf(),
new_text: new_text.clone(),
old_text: old_text.clone(),
raw_output: Some(agent_output),
};
if let Some(card) = card_clone {