Stream token usage on every agent message
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 can you resolve the conflicts when you get a chance?
@katzdave can you resolve the conflicts when you get a chance?
Done
I think this fixes https://github.com/block/goose/issues/3538 also in my testing
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.