EverOS/tests/unit
zhanghui 0cbfb9f854 fix(observability): address OTel review findings
Adversarial review of the merged OTel instrumentation (#352) surfaced
four issues, all on the enabled path (default-off, so no impact until
tracing is turned on):

- search LLM client was unwrapped, so hybrid/agentic token usage — the
  heaviest LLM spend — never reached Langfuse. Wrap it with
  UsageRecordingClient when observability is enabled, mirroring
  get_llm_client(); graceful keyword-only degradation is preserved.
- set_generation_usage overwrote token counts, undercounting any span
  that wraps more than one chat call (the now-wrapped agentic path).
  Accumulate instead of replacing.
- recall_hit was emitted for uncalibrated methods (unbounded BM25 /
  single-route vector), a near-constant always-hit signal that inflates
  dashboards. Gate hit on calibrated methods (HYBRID/AGENTIC); keyword
  and vector emit only the raw top_score.
- init_tracing / init_score_sink were not idempotent — a re-init without
  an intervening shutdown orphaned the export thread + OTLP socket +
  worker task. Tear down the previous instance first (init_score_sink is
  now async).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 15:29:54 +08:00
..
test_component feat(observability): capture LLM + embedding token usage 2026-07-23 20:47:39 +08:00
test_config feat(observability): OTel tracing chassis + request-id propagation 2026-07-23 20:47:39 +08:00
test_core fix(observability): address OTel review findings 2026-07-24 15:29:54 +08:00
test_entrypoints feat(api): serve endpoints under /api/v2, retain /api/v1 as alias 2026-07-24 13:44:58 +08:00
test_infra feat(observability): instrument memory ops + OME trace linking 2026-07-23 20:47:39 +08:00
test_memory fix(observability): address OTel review findings 2026-07-24 15:29:54 +08:00
test_scripts docs: align config and github workflow (#314) 2026-06-29 07:31:31 +08:00
test_service fix(observability): address OTel review findings 2026-07-24 15:29:54 +08:00
__init__.py chore: initialize EverOS 1.0.0 2026-06-06 07:33:17 +08:00
test_benchmark_config.py chore(release): update EverOS to 1.1.1 (#327) 2026-07-07 18:30:03 +08:00