Skip to content

feat(cli): add the CLI entrypoint and benchmark runner (#41) - #232

Open
devops-bench-sync-bot wants to merge 2 commits into
mainfrom
backsync/from-upstream
Open

feat(cli): add the CLI entrypoint and benchmark runner (#41)#232
devops-bench-sync-bot wants to merge 2 commits into
mainfrom
backsync/from-upstream

Conversation

@devops-bench-sync-bot

Copy link
Copy Markdown
Collaborator

feat(cli): add the CLI entrypoint and benchmark runner (#41)

* feat(agents): add canonical token buckets shared across harnesses

Add one canonical six-bucket token schema — input (non-cached), cached,
cache_write, reasoning, output (excludes reasoning), total — with None for
unreported buckets rather than a fabricated 0, that harnesses map onto, and
carry the buckets through to the result row.

- agents/result.py: shared TOKEN_BUCKETS + empty_tokens().
- agents/cli/gemini_cli: the terminal result.stats block maps to the
  canonical dict (input = full input − cached; reasoning derived from the
  total gap).
- results/normalize.py + row.py: rows carry cachedTokens, reasoningTokens,
  cacheWriteTokens, and totalTokens as additive nullable fields (no
  SCHEMA_VERSION bump; historical rows stay valid); normalize_tokens reads
  the canonical keys first with legacy aliases kept for older records.

Signed-off-by: Eugene Ng <ngeugene@google.com>

* chore(agents): add type hints flagged in review

Annotate the exported __all__/TOKEN_BUCKETS constants, fully parameterize
_canonical_tokens, and add -> None to the new normalize/build_rows tests.

* chore(agents): address review feedback on token buckets

- empty_tokens() now returns dict[str, int | None] rather than dict[str, Any].
- normalize_tokens() returns a NormalizedTokens NamedTuple; build_rows reads its
  named fields (still unpacks/compares as a 6-tuple, so callers are unaffected).
- Clamp canonical gemini "input" at 0 so an over-reported "cached" can't push it
  negative, with coverage.

---------

Signed-off-by: Eugene Ng <ngeugene@google.com>
GitOrigin-RevId: 6d786921b228b0cb1558af44fd8d575ba390909d
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.

3 participants