发布

  • [OPIK-6855] [BE] Fix test suite items lost when saving after editing an item assertion (#7234)

    frostbyte_neo 发布于 2026-06-25 09:42:19 +00:00

    • [OPIK-6855] [BE] fix: prevent test-suite item loss from ClickHouse param unescaping

    The item-level edit path (EDIT_ITEM_VIA_SELECT_INSERT, v2 client) bound
    evaluators/description via {:String} substitution, which unescapes backslash
    sequences. The llm_judge prompt's "\n" became literal newlines, producing
    invalid stored JSON; the ClickHouse r2dbc driver then silently dropped the row
    on read, so test-suite items appeared lost. A backslash in a description failed
    the write outright.

    • base64-encode evaluators/description and base64Decode in SQL so the value
      crosses the {:String} substitution intact.
    • Harden getEvaluators to degrade to null + WARN on unparseable JSON so a
      corrupt row stays visible instead of being dropped.
    • Add a round-trip regression test covering both fields.
    • Revision: narrow evaluators parse catch and add row identifiers to the warning

    Address PR review: parseEvaluators caught RuntimeException broadly (masking
    unrelated bugs as null) and logged without identifying the row.

    • Narrow the catch to UncheckedIOException (what JsonUtils.readValue throws), so
      only the known JSON-corruption case degrades to null; any other exception
      propagates instead of being silently swallowed.
    • Thread dataset_item_id and dataset_id into the WARN so a parse failure is
      traceable to the corrupted item.
    下载附件