Clean up session file optionality for --no-session (#3230)
This commit is contained in:
@@ -18,7 +18,7 @@ pub struct BenchAgentError {
|
||||
#[async_trait]
|
||||
pub trait BenchBaseSession: Send + Sync {
|
||||
async fn headless(&mut self, message: String) -> anyhow::Result<()>;
|
||||
fn session_file(&self) -> PathBuf;
|
||||
fn session_file(&self) -> Option<PathBuf>;
|
||||
fn message_history(&self) -> Vec<Message>;
|
||||
fn get_total_token_usage(&self) -> anyhow::Result<Option<i32>>;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ impl BenchAgent {
|
||||
pub(crate) async fn get_token_usage(&self) -> Option<i32> {
|
||||
self.session.get_total_token_usage().ok().flatten()
|
||||
}
|
||||
pub(crate) fn session_file(&self) -> PathBuf {
|
||||
pub(crate) fn session_file(&self) -> Option<PathBuf> {
|
||||
self.session.session_file()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,8 +155,15 @@ impl EvalRunner {
|
||||
.canonicalize()
|
||||
.context("Failed to canonicalize current directory path")?;
|
||||
|
||||
BenchmarkWorkDir::deep_copy(agent.session_file().as_path(), here.as_path(), false)
|
||||
.context("Failed to copy session file to evaluation directory")?;
|
||||
BenchmarkWorkDir::deep_copy(
|
||||
agent
|
||||
.session_file()
|
||||
.expect("Failed to get session file")
|
||||
.as_path(),
|
||||
here.as_path(),
|
||||
false,
|
||||
)
|
||||
.context("Failed to copy session file to evaluation directory")?;
|
||||
|
||||
tracing::info!("Evaluation completed successfully");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user