Files
DeepTutor/tests/core
Bingxi Zhao (Frank) 3f03d4eabd refactor(agentic): one shared once-per-stream usage recorder
Follow-up to #617, which fixed the N× inflation at three call sites and
left the pattern triplicated. record_streamed_usage() +
message_content_chars() in core/agentic/usage.py now serve
run_labeled_step, chat's _call_llm, and the question summarizer; the
redundant _UsageShim (UsageTracker already unwraps .usage), the dead
before_usage_calls guard, and both private _message_content_chars
copies are gone, along with an unreachable try/except around a dict
assignment. Accounting failures are now swallowed and debug-logged at
every site — usage bookkeeping can never break a completed stream.
Adds contract tests for the shared recorder.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:37:47 +08:00
..
2026-06-11 20:03:34 +08:00
2026-01-06 01:57:04 +08:00
2026-06-17 10:50:44 +08:00
2026-04-23 19:29:16 +08:00