Skip to content

[Bug] CompactionMiddleware does not include the summarization call's tokens in the accumulated total #7649

Description

@maomaodev

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

Describe the bug

CompactionMiddleware fires an extra summarizer LLM call when compaction triggers, but the tokens from that call (prompt_tokens / completion_tokens / total_tokens) are never added to the session's accumulated token totals. As a result, token accounting diverges from the LLM provider's actual billing.

Affects Version(s)

master

Kyuubi Server Log Output

Kyuubi Engine Log Output

Kyuubi Server Configurations

Kyuubi Engine Configurations

Additional context

No response

Are you willing to submit PR?

  • Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
  • No. I cannot submit a PR at this time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions