feat: Improve streaming cost warning display

This commit is contained in:
Paul Gauthier (aider) 2025-03-28 16:20:23 -10:00
parent e559bc8694
commit f37b814570
2 changed files with 3 additions and 5 deletions

View file

@ -1961,11 +1961,6 @@ class Coder:
f" ${format_cost(self.total_cost)} session."
)
if self.add_cache_headers and self.stream:
warning = " Use --no-stream for accurate caching costs."
self.usage_report = tokens_report + "\n" + cost_report + warning
return
if cache_hit_tokens and cache_write_tokens:
sep = "\n"
else:

View file

@ -568,6 +568,9 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
io = get_io(False)
io.tool_warning("Terminal does not support pretty output (UnicodeDecodeError)")
if args.stream and args.cache_prompts:
io.tool_warning("Caching costs may be inaccurate when using --stream.")
# Process any environment variables set via --set-env
if args.set_env:
for env_setting in args.set_env: