Skip to content

v1.20.18 — HTML enriched display consistent across turns + exact token/cost accounting

Choose a tag to compare

@jgouviergmail jgouviergmail released this 01 Jun 23:13

Two fixes. No DB migration, no new env var, no endpoint change.

🎨 Fixed — HTML enriched display no longer drifts back to Markdown over multi-turn conversations

In the HTML enriched display mode, the first replies rendered as rich HTML but, as the conversation grew, the model drifted back to Markdown — in both execution modes (pipeline & ReAct) — without any setting change. Root cause: the response LLM's history filter treated prior turns asymmetrically (HTML answers erased to a [Résultats affichés] placeholder, Markdown kept verbatim), so the visible history looked uniformly plain and biased the model away from the HTML directive. Fixed by symmetric, structural style neutralization scoped to the HTML mode only (neutralize_formatting, default False) — the cards/markdown modes, the planner path and all existing callers stay byte-for-byte unchanged.

📊 Fixed — Token/cost double-counting of the proactive "initiative" call

A proactive (initiative) LLM call appeared twice in the Debug Panel — one INITIATIVE row and one phantom UNKNOWN row with identical tokens — inflating the per-message total, token_usage_logs and user_statistics. On the reasoning-streaming path, flattening config["callbacks"] re-rooted the run so on_llm_end fired twice. Fixed at the source (enrich_config_preserving_callbacks keeps the CallbackManager) and locked by a symmetric idempotency guard on both the DB (TokenTrackingCallback) and Prometheus (MetricsCallbackHandler) handlers — each LLM call is now recorded exactly once.

Validation: Ruff / Black / MyPy strict clean · 8404 unit tests pass · i18n key parity across 6 locales · ESLint + TypeScript clean.

Full details in CHANGELOG.md.