Skip to content

[Fix] openai: Cover image-token usage on the generic chat path - #41379

Open
divyvasal wants to merge 1 commit into
sgl-project:mainfrom
divyvasal:coral/glm-image-usage-report-upstream
Open

divyvasal wants to merge 1 commit into
sgl-project:mainfrom
divyvasal:coral/glm-image-usage-report-upstream

Conversation

@divyvasal

@divyvasal divyvasal commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a response-builder test proving meta_info.image_tokens reaches usage.prompt_tokens_details.image_tokens on the generic chat path.
  • Existing coverage named the equivalent behavior only in a Kimi-specific test.

Context

Multimodal token counts are computed from schedule_batch offsets and should be independent of the chat encoding. This test pins the generic behavior for all vision models.

Validation

Targeted unit test; CI will run the registered suite.


CI States

Latest PR Test (Base): ❌ Run #36282923367
Latest PR Test (Extra): ❌ Run #36282923195
Latest PR Test (AMD ROCm 10): ❌ Run #36282923325

Multimodal token counts come from schedule_batch offsets and are emitted into
meta_info regardless of the model's chat encoding. Add a direct response-builder
test that image_tokens reaches usage.prompt_tokens_details.image_tokens on the
generic path, not only in the Kimi-specific test.
@divyvasal

Copy link
Copy Markdown
Contributor Author

@JustinTong0323 @hnyls2002 @mickqian Could one of you take a look and add run-ci? This only adds a genric response-builder test for image_tokens in usage.prompt_tokens_details. No runtime changes.

@divyvasal divyvasal changed the title Cover image-token usage on the generic chat path [Fix] openai: Cover image-token usage on the generic chat path Oct 29, 2026

This branch has not been deployed

No deployments
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