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 08:58:45 +02:00 committed by GitHub
parent ea7756b362
commit 1b593f616f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 37 additions and 14 deletions

View file

@ -20,7 +20,8 @@ use language_model::{
LanguageModelToolChoice, MessageContent, Role,
};
use project::{AgentLocation, Project};
use serde::Serialize;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::{cmp, iter, mem, ops::Range, path::PathBuf, sync::Arc, task::Poll};
use streaming_diff::{CharOperation, StreamingDiff};
@ -50,10 +51,10 @@ pub enum EditAgentOutputEvent {
OldTextNotFound(SharedString),
}
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)]
pub struct EditAgentOutput {
pub _raw_edits: String,
pub _parser_metrics: EditParserMetrics,
pub raw_edits: String,
pub parser_metrics: EditParserMetrics,
}
#[derive(Clone)]
@ -186,8 +187,8 @@ impl EditAgent {
}
Ok(EditAgentOutput {
_raw_edits: raw_edits,
_parser_metrics: EditParserMetrics::default(),
raw_edits,
parser_metrics: EditParserMetrics::default(),
})
}
@ -426,8 +427,8 @@ impl EditAgent {
}
}
Ok(EditAgentOutput {
_raw_edits: raw_edits,
_parser_metrics: parser.finish(),
raw_edits,
parser_metrics: parser.finish(),
})
});
(output, rx)