Skip to content

Commit fd5f7d1

Browse files
Address PR 143 review
Tighten three stale comments that still referred to a sentinel "pair" on the failure path. The provider now emits only a single sentinel completed event on failure (no started counterpart); the comments in langfuse/observer.py (dispatch site + handler docstring) and openai.py (failure-emission site) didn't catch up with the v0.13.0 emission change in the same PR.
1 parent 6bf1b5b commit fd5f7d1

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

src/openarmature/llm/providers/openai.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,12 @@ async def complete(
461461
# Failure path: the sentinel NodeEvent carries the
462462
# error fields per llm-provider §7. LlmCompletionEvent
463463
# is success-only per proposal 0049 §3 alternative 3,
464-
# so failures continue to surface through the sentinel
465-
# pair until the spec extends the typed event with
466-
# error semantics. Only ``completed`` is emitted on
467-
# failure — no started counterpart, since both bundled
468-
# observers' handlers ignore sentinel-started after the
469-
# v0.13.0 migration.
464+
# so failures continue to surface through a sentinel
465+
# ``completed`` event until the spec extends the typed
466+
# event with error semantics. Only ``completed`` fires
467+
# — no started counterpart, since both bundled
468+
# observers' handlers ignore sentinel-started after
469+
# the v0.13.0 migration.
470470
dispatch(
471471
_make_llm_event(
472472
"completed",

src/openarmature/observability/langfuse/observer.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ async def __call__(
369369
# Proposal 0049 typed LlmCompletionEvent (success path). Drives
370370
# the §5.5 Generation observation lifecycle for successful
371371
# provider calls. Failures don't emit this variant; they flow
372-
# through the sentinel-pair error path below.
372+
# through the sentinel error path below (a single sentinel
373+
# ``completed`` event — no started counterpart in v0.13.0+).
373374
if isinstance(event, LlmCompletionEvent):
374375
if not self.disable_llm_spans:
375376
self._handle_typed_llm_completion(event)
@@ -1325,11 +1326,13 @@ def _observation_metadata(self, event: NodeEvent, correlation_id: str | None) ->
13251326
# one shot at typed-event arrival, with start_time back-dated by
13261327
# latency_ms so the observation's duration reflects the adapter-
13271328
# boundary measurement rather than dispatcher queue delay. Failure
1328-
# path keeps the sentinel NodeEvent pair (LlmCompletionEvent is
1329-
# success-only per proposal 0049 §3 alternative 3). The provider
1330-
# also dropped sentinel-pair emission on the success path in this
1331-
# release, so on success the typed event is the only signal the
1332-
# Generation observation has to fire from.
1329+
# path keeps a single sentinel NodeEvent (``completed`` phase
1330+
# carrying error fields on its LlmEventPayload — LlmCompletionEvent
1331+
# is success-only per proposal 0049 §3 alternative 3). The provider
1332+
# dropped success-path sentinel emission entirely in this release,
1333+
# so on success the typed event is the only signal the Generation
1334+
# observation has to fire from; the failure path's sentinel
1335+
# ``started`` was also dropped, leaving only ``completed``.
13331336
def _handle_typed_llm_completion(self, event: LlmCompletionEvent) -> None:
13341337
"""Open + close the Generation observation from the typed
13351338
LlmCompletionEvent (success path)."""

0 commit comments

Comments
 (0)