Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(prompt-eval): sub-second wall-clock duration per run, documented

M3gA-Mind55464360c945
diff --git a/docs/prompt-evals.md b/docs/prompt-evals.md
index b5286e30cc..56ada00c4b 100644
--- a/docs/prompt-evals.md
+++ b/docs/prompt-evals.md
@@ -100,6 +100,16 @@ Scoring reads only artifacts the run already writes, in this order:
One row per case is appended to `target/prompt-eval-runs.jsonl`
(gitignored with `target/`), and the run prints the total USD.
+**Latency.** `seconds` is the wall clock of the agent call itself, measured by
+the harness around one `openhuman-core call` process. It covers boot (a no-op
+call takes about 0.01–0.16 s), agent assembly, every model call and every tool
+call. The judge call is excluded. It is total turn duration, which is what a
+user waits for. Time to first token is not measured: `call` is non-streaming,
+so the first token is never observable from outside. Transcript timestamps
+cannot stand in for it, because `_meta.created`, `_meta.updated` and each
+message's `ts` are all stamped when the file is written, not at turn
+boundaries.
+
**Every row records the model id beside its cost.** A provider-side model
update silently rebaselines every score. Compare rows only when the model
ids match.
diff --git a/scripts/prompt-eval.sh b/scripts/prompt-eval.sh
index 18ea7466d7..1b1890c201 100755
--- a/scripts/prompt-eval.sh
+++ b/scripts/prompt-eval.sh
@@ -125,9 +125,11 @@ for run in $(seq 1 "$RUNS"); do
continue
fi
fi
- started=$(date +%s)
+ # Wall clock of the agent call, measured here, not read from artifacts:
+ # transcript timestamps are stamped at persist time, not turn boundaries.
+ started=$(python3 -c 'import time; print(time.time())')
core "$method" "$params" > "$ws/result.json" || echo "case $id: $method exited non-zero (scored anyway)" >&2
- elapsed=$(( $(date +%s) - started ))
+ elapsed=$(python3 -c 'import sys,time; print(round(time.time() - float(sys.argv[1]), 2))' "$started")
# Judge in the same workspace (same credential), as a tool-less chat call.
judge_prompt=$(python3 "$ROOT/scripts/prompt-eval/score.py" judge-prompt "$CASES" "$id" "$ws")
diff --git a/scripts/prompt-eval/score.py b/scripts/prompt-eval/score.py
index 37675ed118..3aac9946df 100755
--- a/scripts/prompt-eval/score.py
+++ b/scripts/prompt-eval/score.py
@@ -321,4 +321,4 @@ if __name__ == "__main__":
elif cmd == "score":
doc, case = load_case(sys.argv[2], sys.argv[3])
run = int(sys.argv[6]) if len(sys.argv) > 6 else 1
- print(json.dumps(score(doc, case, sys.argv[4], int(sys.argv[5]), run)))
+ print(json.dumps(score(doc, case, sys.argv[4], float(sys.argv[5]), run)))