Describe the bug
When using the flag -t or --token usage, the token usage count is stored based on the value returned from the AI API provider. However, this value is re-assigned with each call to the API provider, meaning it ultimately reflects the number of tokens used by the last file sent to the API provider.
To Reproduce
Steps to reproduce the behavior:
Run program with -t or --token usage and multiple files
codeshift -t examples/index.js examples/main.cpp
Expected behavior
The combined total token usage for all files is displayed.
Describe the bug When using the flag
-t
or--token usage
, the token usage count is stored based on the value returned from the AI API provider. However, this value is re-assigned with each call to the API provider, meaning it ultimately reflects the number of tokens used by the last file sent to the API provider.To Reproduce Steps to reproduce the behavior: Run program with
-t
or--token usage
and multiple filescodeshift -t examples/index.js examples/main.cpp
Expected behavior The combined total token usage for all files is displayed.