feat: capture normalised bash command heads for the favorite-tools stat

This commit is contained in:
damocles 2026-06-06 00:18:55 +02:00 committed by mara
commit 1569d55f78
7 changed files with 252 additions and 17 deletions

View file

@ -303,6 +303,10 @@ async fn run_task(mut task: TaskFile, socket: &Path) {
tracing::warn!(id = %id, error = ?e, "bash_runner: write running state failed");
}
refresh_loose_ends();
// Best-effort: tally the normalised command head for the /stats
// "favorite tools" view. Counted once per execution, regardless of
// exit status. Never fails the task.
crate::stats::record_command(&task.cmd);
let out_path = paths::task_out(&id);
let err_path = paths::task_err(&id);