发布

  • [OPIK-6425] [FE] Extend Ollie Explain to Spans & Threads + stream robustness

    frostbyte_neo 发布于 2026-06-19 20:51:30 +00:00

    Extend the contextual Explain feature beyond the Traces table:

    • Widen ExplainKind with span.{error,duration,cost} and thread.{duration,cost};
      AI_EXPLAIN_REGISTRY stays a total Record so a missing config is a compile error.
    • Make the Traces/Spans builders entity-aware via shared factories: the Spans
      view emits span.* targets (entityId = span id; the backend resolves the parent
      trace), the Traces view emits trace.*. Wrapping moved into a per-view useMemo.
    • Wire Explain onto the Threads table (duration + cost; threads have no error).
    • Extract the generic withExplain HOC to a shared LogsPage/explain module so the
      Traces/Spans and Threads tabs share one wrapper.

    Stream robustness (host-only):

    • Watchdog for a stalled stream (no chunk yet): ~10s -> "waking" state, ~30s ->
      retryable timeout error + explain:cancel. A live pod streams/pings well before
      then, so this only catches a request that never reached a live pod.
    • Fail in-flight cells when the pod/bridge goes away (setReady(false)/clearEmit)
      so open popovers can't hang on "Thinking…/waking".
    • Optional structured explain:error.code mapped to contextual copy (falls back
      to the raw message); host-generated timeout/pod-loss set their own codes.

    Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

    下载附件