Skip to content

Conversation

@katzdave
Copy link
Collaborator

@katzdave katzdave commented Oct 23, 2025

Token usage gets saved to the session every turn, so just pull that.

  • Some clientside renames to make more clear what each token means
  • Make sure we always sum input + output tokens -> total tokens even if the provider doesn't provide

katzdave and others added 30 commits October 16, 2025 13:36
* 'main' of github.com:block/goose:
  Break compaction back into check_ and do_ compaction (#5212)
  fix: revert built app name to uppercase Goose (#5206)
  feat: add Code Documentation Generator recipe (#5121) (#5125)
  Revert "feat: enhance goose to search sessions for easy recall (#5177)" (#5209)
* 'main' of github.com:block/goose:
  Rewrite extension management tools (#5057)
  fix: re-sync package-lock.json (#5235)
  docs: Hacktoberfest MCP youtube short entry to community-content.json (#5150)
  feat: add schedule button to recipe entries (#5217)
  Autocompact threshold UI cleanup (#5232)
  fix: correct schema for openai tools (#5229)
* 'main' of github.com:block/goose:
  docs: provide more clarity in tagging step of releases (#5269)
  docs: add GOOSE_DEBUG environment variable (#5265)
  Lifei/UI parameter input (#5222)
  turn off WAL (#5203)
  Skip subagents for gemini (#5257)
  Revert "Standardize Session Name Attribute" (#5250)
  improve provider request logging a bit (#5236)
  Fix OpenAI empty choices panic (#5248)
  Revert "Rewrite extension management tools" (#5243)
  Standardize Session Name Attribute (#5085)
  Docs: Include step-by-step model configuration instructions for first… (#5239)
  Delete message visibility filter (#5216)
  delete flaky pricing integration tests (#5207)
  chore: upgrade most npm packages to latest (#5185)
  Release/1.11.0 (#5224)
* 'main' of github.com:block/goose:
  Feat/smart task organizer recipe (#5032)
  docs: `goose recipe open` command (#5264)
Changes:
- Replace "manual-compact" command with "/compact" for better UX
- Remove all traces of setChatState exposure from TypeScript codebase
- Remove setMessages prop from ChatInput component

The setChatState exposure was a bad abstraction that enabled incorrect
state manipulation. Now state is controlled entirely by the server through
message content, with only internal useState usage remaining.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@katzdave katzdave marked this pull request as ready for review October 24, 2025 21:47
@zanesq
Copy link
Collaborator

zanesq commented Oct 28, 2025

@katzdave can you resolve the conflicts when you get a chance?

@katzdave
Copy link
Collaborator Author

@katzdave can you resolve the conflicts when you get a chance?

Done

@katzdave katzdave requested review from DOsinga and zanesq October 28, 2025 20:09
Copy link
Collaborator

@zanesq zanesq left a comment

Choose a reason for hiding this comment

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

LGTM tested locally and token count is much better.

One question: what happens when multiple agents/requests update the same session concurrently would it lose the updates?

setRecipeUserParams: (values: Record<string, string>) => Promise<void>;
stopStreaming: () => void;
sessionLoadError?: string;
tokenState?: TokenState;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be optional? When would tokenState not be available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed; had thought it was more widely used.

@zanesq
Copy link
Collaborator

zanesq commented Oct 28, 2025

I think this fixes #3538 also in my testing

@katzdave
Copy link
Collaborator Author

LGTM tested locally and token count is much better.

One question: what happens when multiple agents/requests update the same session concurrently would it lose the updates?

I think it should be fine, since all of the updates are just pulling the latest state from the session on every message.

I think this fixes #3538 also in my testing

Nice! I think desktop will need one more small fix for this but, very close.

@katzdave katzdave merged commit 37e1bb1 into main Oct 30, 2025
25 of 28 checks passed
@katzdave katzdave deleted the dkatz/token-usage-message branch October 30, 2025 03:23
zanesq added a commit that referenced this pull request Oct 30, 2025
* 'main' of github.com:block/goose: (81 commits)
  nextcamp - fix session resume when navigating back to chat in sidebar (#5370)
  feat/fix: set optional config params, and don't overwrite unset secrets (#5325)
  Stringly typed config (#5463)
  Fix: Compaction client <-> server sync  (#5481)
  docs: recipe activity parameter substitution (#5462)
  only run fork on branch PRs (#5461)
  docs: video on goose with apify mcp (#5472)
  Clear windows and fix build failure (#5452)
  Add menu option for setting window always on top (#5429)
  Delete environment variable (#5479)
  chore: upgrade rmcp to 0.8.3 (#5458)
  docs: add "Building Custom Tools and Extensions for Goose" (#5469)
  Doc (Blog): Managing goose Configurations Across Multiple Projects (#5467)
  apify doc fix (#5460)
  Stream token usage on every agent message (#5342)
  rpm install in /opt/Goose to avoid conflicts with chrome-sandbox (#5421)
  Don't disable extensions after they fail to activate in new chat session (#5464)
  Add OTLP logs layer (#5386)
  openapi to locust load test generator recipe (#5447)
  technical debt tracker recipe (#5451)
  ...

# Conflicts:
#	ui/desktop/src/components/ChatInput.tsx
michaelneale added a commit that referenced this pull request Oct 31, 2025
* main: (45 commits)
  Change Recipes Test Script (#5457)
  Goose recover (#5450)
  don't start the default provider (#5351)
  keep the order of keys in config.yaml (#5468)
  Removed drafts and agentIsReady in ChatInput (#5366)
  nextcamp - fix session resume when navigating back to chat in sidebar (#5370)
  feat/fix: set optional config params, and don't overwrite unset secrets (#5325)
  Stringly typed config (#5463)
  Fix: Compaction client <-> server sync  (#5481)
  docs: recipe activity parameter substitution (#5462)
  only run fork on branch PRs (#5461)
  docs: video on goose with apify mcp (#5472)
  Clear windows and fix build failure (#5452)
  Add menu option for setting window always on top (#5429)
  Delete environment variable (#5479)
  chore: upgrade rmcp to 0.8.3 (#5458)
  docs: add "Building Custom Tools and Extensions for Goose" (#5469)
  Doc (Blog): Managing goose Configurations Across Multiple Projects (#5467)
  apify doc fix (#5460)
  Stream token usage on every agent message (#5342)
  ...
fbalicchia pushed a commit to fbalicchia/goose that referenced this pull request Nov 7, 2025
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
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