Skip to content

fix: include token usage in Databricks streaming responses#7959

Merged
DOsinga merged 3 commits intomainfrom
jhugo/databricks-token-count
Mar 18, 2026
Merged

fix: include token usage in Databricks streaming responses#7959
DOsinga merged 3 commits intomainfrom
jhugo/databricks-token-count

Conversation

@jh-block
Copy link
Copy Markdown
Collaborator

Summary

Add stream_options: {"include_usage": true} to Databricks streaming requests. The Databricks provider was not including this option, so the API never returned token usage data in streaming chunks. This caused token counts to stay at zero in the chat UI footer, even though the backend was making requests and receiving responses.

Testing

Manual testing with Databricks provider models (e.g., databricks-claude-sonnet-4) should now show token counts updating in the UI footer as responses stream in.

Related Issues

None

Add stream_options with include_usage=true to Databricks streaming requests so the API returns token counts in streaming chunks. Without this, token counts remain unreported and show as zero in the UI.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d15925e0a9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Preserve any caller-supplied stream_options from request_params instead
of overwriting them unconditionally.
@DOsinga DOsinga added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit c2d10ce Mar 18, 2026
23 checks passed
@DOsinga DOsinga deleted the jhugo/databricks-token-count branch March 18, 2026 15:56
michaelneale added a commit that referenced this pull request Mar 19, 2026
* origin/main:
  fix(openai): use Responses API for gpt-5.4 (#7982)
  Remove lead/worker provider (#7989)
  chore(release): release version 1.28.0 (#7991)
  Fix empty tool results from resource content (e.g. auto visualiser) (#7866)
  Separate SSE streaming from POST work submission (#7834)
  fix: include token usage in Databricks streaming responses (#7959)
  Optimize tool summarization (#7938)
lifeizhou-ap added a commit that referenced this pull request Mar 20, 2026
* main: (22 commits)
  feat: add gemini-acp provider, update docs on subscription models + improvements to codex (#8000)
  fix(openai): use Responses API for gpt-5.4 (#7982)
  Remove lead/worker provider (#7989)
  chore(release): release version 1.28.0 (#7991)
  Fix empty tool results from resource content (e.g. auto visualiser) (#7866)
  Separate SSE streaming from POST work submission (#7834)
  fix: include token usage in Databricks streaming responses (#7959)
  Optimize tool summarization (#7938)
  fix: overwrite the deprecated googledrive extension config (#7974)
  refactor: remove unnecessary Arc<Mutex> from tool execution pipeline (#7979)
  Revert message flush & test (#7966)
  docs: add Remote Access section with Telegram Gateway documentation (#7955)
  fix: update webmcp blog post metadata image URL (#7967)
  fix: clean up OAuth token cache on provider deletion (#7908)
  fix: hard-coded tool call id in code mode callback (#7939)
  Fix SSE parsers to accept optional space after data: prefix (#7929)
  docs: add GOOSE_INPUT_LIMIT to config-files.md (#7961)
  Add WebMCP for Beginners blog post (#7957)
  Fix download manager (#7933)
  Improve the formatting of tool calls, show thinking, treat Reasoning and Thinking as the same thing (sorry Kant) (#7626)
  ...
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
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.

2 participants