Skip to content

fix(knowledge-network): preserve relation picker search after LIKE alignment - #1322

Open
rongwei-liu wants to merge 1 commit into
mainfrom
fix/3079-like-pattern-studio
Open

rongwei-liu wants to merge 1 commit into
mainfrom
fix/3079-like-pattern-studio

Conversation

@rongwei-liu

@rongwei-liu rongwei-liu commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

What Changed

Brief description of changes:

  • Preserve substring search in the relation instance picker after LIKE values become complete SQL patterns.
  • Escape user-entered %, _, and backslash as literal characters.
  • Add a focused regression test for wildcard characters and retain exact typed-identity lookup.

Why

  • Related Issue: openbkn-ai/bkn-foundry#3079
  • Related Feature: Not applicable; this is a compatibility fix for an existing picker.
  • Background: Under the complete SQL LIKE contract, the picker's previous plain-text value would become an exact match rather than the intended substring search.

How

  • Key implementation points: Wrap the escaped search term in % before sending the existing object-instance query. Numeric primary-key searches and structured identity searches retain their existing exact-match paths.
  • Breaking changes (API, config, database, etc.): None in Studio; the server-side LIKE contract change is tracked in the related Foundry issue.

Testing

  • Unit tests passed locally
  • Integration tests passed locally (not applicable; no live service was used)
  • Verified in test environment (not performed)

Test notes: pnpm exec vitest --run --maxWorkers=50% src/modules/knowledge-network/eval/case-form.service.test.ts (13 passed); repository formatter, license check, format check, type-aware ESLint, tsc -b, production Vite build, and pnpm audit --prod passed. The build emits existing dependency annotation and chunk-size warnings.


Risk & Rollback

  • Potential risks: Search results depend on the server accepting complete SQL LIKE patterns. Deploy with the compatible Foundry version.
  • Rollback plan: Revert this commit together with the server-side LIKE rollout if necessary.

Additional Notes

  • Screenshots, logs, documentation links, etc.: No UI layout changes. Paired Foundry PR: openbkn-ai/bkn-foundry#3122. It will close the cross-repository issue after both sides are reviewed.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改动把关系实例选择器的文本检索改为 %<转义后关键词>% 的完整 SQL LIKE 模式,并补上了 _ 的转义,转义规则与仓内 data-catalog 的 sqlLikePatternRegex 约定一致;新增测试断言了真实请求体,未发现阻断问题。

影响范围与未覆盖面
  • 影响范围:仅影响评测用例表单中关系实例选择器的模糊搜索;若 Studio 先于 Foundry 的 LIKE 契约改动上线,旧后端对显式 % 的处理方式会决定搜索结果是否正确。
  • 未覆盖:后端 /agent-retrieval/v1/kn/query_object_instance 的 LIKE 转义语义在 Foundry 仓库,本轮未核实。

有异议或想再评一轮,请回复 /review——普通回帖不会触发复评,且回帖人需为本仓 OWNER/MEMBER/COLLABORATOR。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

by-agent Issue or pull request produced by an agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant