发布

  • [OPIK-6652] [FE][BE] Route optimization studio LLM calls through backend gateway (#6830)

    frostbyte_neo 发布于 2026-05-26 17:19:08 +00:00

    • [OPIK-6652] [FE][BE] Route optimization studio LLM calls through backend gateway

    Replace hardcoded per-provider API keys with the Opik backend's
    completions gateway so optimization studio supports all providers
    the playground supports.

    Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

    • [OPIK-6652] [BE] Fix null stream NPE in Anthropic mapper and improve error logging

    The Anthropic mapper NPE'd when stream was null — default to false.
    Pass stream=False from optimizer and metrics to prevent the issue on the
    Python side as well. Also surface subprocess stdout in error logs so
    optimizer failures are no longer silently swallowed.

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

    • style(fe): fix eslint errors in OptimizationModelSelect

    Remove unused PROVIDER_TYPE import and apply prettier formatting
    (compact destructuring, inline conditional, expanded object literal).

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • docs(helm): reflect workspace-based LLM provider configuration

    LLM API keys are no longer consumed from env vars on the python-backend
    pod; they're resolved from the workspace's AI Providers settings via the
    new gateway-routed path. Update the helm chart secretRefs comment to
    direct operators to the UI for LLM keys and reframe secretRefs as a
    generic mechanism for other sensitive configuration.

    Also drop the broken link to apps/opik-python-backend/docs/LLM_API_KEYS_CONFIGURATION.md
    (the file does not exist in the repo).

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • refactor: address PR review feedback
    • Reorder OptimizationModelSelect imports per convention (React, external libs, then @/ aliases)
    • Extract _parse_last_json_line helper in IsolatedSubprocessExecutor to dedupe stdout JSON parsing across success/failure branches

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • chore(helm): regenerate README to sync with Chart.yaml version 2.0.46

    Chart.yaml version was bumped to 2.0.46 in prior commits without
    regenerating the chart README. CI's update-readme check on PR #6830
    caught the drift because this branch touched values.yaml. Regeneration
    via 'pre-commit run helm-docs --all-files'.

    Local pre-commit doesn't currently invoke the helm-docs hook on chart
    file changes; tracking that gap as OPIK-6656.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • test(be): cover Anthropic stream null-defaults-to-false mapping

    Add parameterized regression test for LlmProviderAnthropicMapper covering
    all three stream input cases (Boolean.TRUE, Boolean.FALSE, null). The
    null case guards against the NPE that motivated the mapping change in
    this PR — previously, request.stream() returning null would NPE on
    primitive unboxing in the AnthropicCreateMessageRequest target field.

    Existing tests use Podam, which auto-generates non-null Boolean values,
    so the null path was uncovered.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • fix(fe): show placeholder when selected value has no configured provider

    The optimization-studio selector trigger fell back to rendering the raw
    value string when selectedInfo couldn't resolve it against the
    configured providers. With a stored default like openai/gpt-4o-mini
    but no OpenAI provider configured in the workspace, the trigger
    displayed the model as if selected while the dropdown showed
    "No configured providers" — out-of-sync UI.

    Drop the ?? value fallback. When the stored value doesn't match any
    configured provider, render no inner content and let SelectValue use
    its "Select an LLM model" placeholder. The orphaned value remains in
    state (and a submit guard / pre-existing OPIK-6655 work will handle
    the broader unification) but the trigger no longer lies about what
    the user can actually use.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • chore(helm): regenerate README to sync with Chart.yaml version 2.0.48

    Chart.yaml was bumped to 2.0.48 in the merge from main; regenerating the
    README badge to match so CI's update-readme check passes.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • refactor(py-be): address review feedback from @ldaugusto
    • optimizer_runner: rephrase the openai/ prefix comment to lead with the
      intent ("treat the Opik backend as an OpenAI-compatible endpoint") so
      the LiteLLM routing trick is clearer on first read
    • studio/config: rstrip("/") on OPIK_URL before composing the gateway URL,
      so a deployment that sets OPIK_URL_OVERRIDE with a trailing slash
      doesn't produce a double-slash URL
    • test_executor_isolated: add a TestParseLastJsonLine class with edge-case
      coverage for the new _parse_last_json_line helper (single line, multi-
      line, trailing blank lines, empty/whitespace input, malformed JSON,
      non-dict JSON)

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com


    Co-authored-by: Claude Sonnet 4.6 noreply@anthropic.com
    Co-authored-by: Daniel Dimenshtein danield@comet.com

    下载附件