Skip to content

feat(bench): per-task token totals in runner rows and summary - #358

Merged
dahai80 merged 1 commit into
mainfrom
bench-token-cost
Nov 26, 2026
Merged

dahai80 merged 1 commit into
mainfrom
bench-token-cost

Conversation

@dahai80

@dahai80 dahai80 commented Nov 26, 2026

Copy link
Copy Markdown
Owner

What

Adds cost-per-task telemetry to the harness-gain runner (SWE-Lancer practice: quality must be reported with cost).

  • sumTokensFromTranscript() sums input_tokens/output_tokens from assistant usage blocks in the per-task session transcript (best-effort; missing transcript/fields = 0, never fails a run).
  • HarnessRun gains tokensIn/tokensOut; row log line gains tokens=<in>/<out>; summary.json gains tokensIn/tokensOut totals.

Verification

  • bun build --no-bundle clean.
  • Sanity sum on the 2026-11-26 run transcripts: T19 = 107366 in / 452 out.

Follow-up

Next rerun records the first full cost-per-task table for the report; combined with wall seconds this enables resolve-rate-per-token comparisons across tiers.

🤖 Generated with Claude Code

Cost-per-task anchoring (SWE-Lancer practice: quality must be reported
with cost). The runner already copies the session transcript per task;
assistant entries carry the engine's usage block, so sumTokensFromTranscript
totals input/output tokens best-effort (missing transcript or usage fields
count as zero and never fail a run). Row log line gains tokens=<in>/<out>;
summary.json gains tokensIn/tokensOut totals.

Sanity-checked on the 2026-11-26 run transcripts (T19: 107366 in / 452 out).

Co-Authored-By: Claude Code <[email protected]>
@dahai80
dahai80 merged commit 4b8d7fe into main Nov 26, 2026
1 check passed
@dahai80
dahai80 deleted the bench-token-cost branch November 26, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant