improve logging
All checks were successful
/ upload (release) Successful in 1m42s

This commit is contained in:
pavel 2026-02-11 01:55:13 +01:00
commit b9c6c831c1
3 changed files with 36 additions and 12 deletions

View file

@ -59,6 +59,7 @@ pub async fn execute_agent_run(
goal: String,
) -> AppResult<TaskResponse> {
let run_id = Uuid::new_v4();
tracing::info!(%task_id, %run_id, "Starting agent execution run");
let new_run = task_run::ActiveModel {
id: Set(run_id),
@ -81,12 +82,18 @@ pub async fn execute_agent_run(
)?;
let (logs, answer, status) = match agent.run(config).await {
Ok((logs, answer)) => (logs, answer, "completed".to_string()),
Err(e) => (
format!("Execution failed: {}", e),
None,
"failed".to_string(),
),
Ok((logs, answer)) => {
tracing::info!(%task_id, %run_id, "Agent execution completed successfully");
(logs, answer, "completed".to_string())
}
Err(e) => {
tracing::error!(%task_id, %run_id, error = %e, "Agent execution failed");
(
format!("Execution failed: {}", e),
None,
"failed".to_string(),
)
}
};
let run: task_run::ActiveModel = TaskRun::find_by_id(run_id)