Skip to content

fix: always populate mot.usage in HuggingFace backend#697

Merged
jakelorocco merged 1 commit intogenerative-computing:mainfrom
planetf1:fix/hf-usage-694
Mar 18, 2026
Merged

fix: always populate mot.usage in HuggingFace backend#697
jakelorocco merged 1 commit intogenerative-computing:mainfrom
planetf1:fix/hf-usage-694

Conversation

@planetf1
Copy link
Contributor

@planetf1 planetf1 commented Mar 18, 2026

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Fixes #694

Token count extraction in _post_process_async was gated behind span is not None or metrics_enabled, so mot.usage was always None in plain (non-telemetry) runs. Extraction is now unconditional — usage is a standard mot field, not a telemetry concern.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

…puting#694)

Token count extraction in _post_process_async was gated behind
`span is not None or metrics_enabled`, so mot.usage was never
populated in plain (non-telemetry) runs. Now extracted unconditionally
— usage is a standard mot field, not a telemetry concern.
@github-actions
Copy link
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@planetf1 planetf1 requested a review from jakelorocco March 18, 2026 18:46
@planetf1 planetf1 marked this pull request as ready for review March 18, 2026 18:46
@planetf1 planetf1 requested a review from a team as a code owner March 18, 2026 18:46
@planetf1
Copy link
Contributor Author

@jakelorocco this is the hf only test.
An earlier branch verified the fix but contained other fixes. I'm still waiting on GPU availability to fully rerun all HF tests -

@mergify
Copy link

mergify bot commented Mar 18, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@jakelorocco jakelorocco enabled auto-merge March 18, 2026 18:47
@planetf1 planetf1 changed the title fix: always populate mot.usage in HuggingFace backend (#694) fix: always populate mot.usage in HuggingFace backend Mar 18, 2026
@jakelorocco jakelorocco added this pull request to the merge queue Mar 18, 2026
Merged via the queue into generative-computing:main with commit 4d3fc1b Mar 18, 2026
9 checks passed
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.

fix: HuggingFace backend mot.usage always None without telemetry enabled

2 participants