Fixed
- Flush telemetry on session end so short/one-shot runs (
hermes -z "…") no longer drop their trace. The plugin now registerson_session_endandon_session_finalize, ships the ending session's still-open run, and joins the export threads so the HTTP delivery completes before the process exits. Finalization is scoped to the ending session, so a gateway teardown of one session never disturbs runs still live in a concurrent session. Previously the background export thread was killed at interpreter exit before the request finished; only long-lived interactive sessions emitted.
Changed
- Split the
pre_api_request/post_api_requestcallbacks frompre_llm_call/post_llm_call. They fire at different times with different payloads, so binding one callback to both created duplicate/mislabeled spans. The*_api_requestpair is now the LLM-call span boundary (request/response/usage/provider/model/api_request_id); the*_llm_callpair frames the turn. The exported OTLP span shape is unchanged.