Skip to content

feat: add tool label#3326

Merged
Dallas98 merged 16 commits into
developfrom
feature/moeext/tool-label
Jun 30, 2026
Merged

feat: add tool label#3326
Dallas98 merged 16 commits into
developfrom
feature/moeext/tool-label

Conversation

@MoeexT

@MoeexT MoeexT commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What't changed

Usage Demonstration

output1.mp4

Isolate labels between different tenants

image

close: #2848

@MoeexT MoeexT requested review from Dallas98 and WMC001 as code owners June 29, 2026 07:28
@MoeexT MoeexT force-pushed the feature/moeext/tool-label branch from 7d83df4 to 5700c6d Compare June 29, 2026 07:44
MoeexT added 2 commits June 29, 2026 16:33
- test_tool_db.py: add consts.tool_labels mock with BUILTIN_LABEL_MAP
- test_tool_config_app.py: add labels=None to assert_called_once_with
…ls mock

The mock consts module must have __path__ set to be recognized as a
package by Python's import system, otherwise  fails with ModuleNotFoundError.
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/database/tool_db.py 80.95% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

MoeexT added 10 commits June 29, 2026 17:00
Addresses SonarCloud python:S8572 - use logging.exception() to include
the traceback when logging within an exception handler.
- test_tool_db.py: test_query_tools_by_labels, test_update_tool_labels
- test_tool_config_app.py: TestUpdateToolLabelsAPI (success, 404, 500)
- Total: 105 passed (was 98)
…ng rebase

docker/init.sql was deleted from develop by PR #3302. Accepting 'theirs'
during rebase conflict incorrectly restored it. The migration SQL lives
at the correct path: deploy/sql/migrations/v2.3.0_0624_....
Also updated the reference in consts/tool_labels.py.
- SQL: merged 8 similar UPDATEs into single CASE WHEN (eliminates 4.6% duplication)
- Frontend: added localeCompare to 3 sort() calls (fixes D reliability rating)
- SelectToolsDialog.tsx: add role=button, tabIndex, onKeyDown (fixes BUG → A rating)
- SQL migration: replace CASE WHEN with VALUES-based CTE (eliminates duplication)
- test_tool_configuration_service: add TestListAllToolsWithLabels exercising real
  list_all_tools body with and without labels parameter (fixes codecov 87.5% → 90%)
SQL seed data files (*/migrations/*.sql, */docker/sql/*.sql) contain
structurally similar INSERT/UPDATE rows that SonarCloud incorrectly
flags as code duplication. Excluding them from both cpd and general
analysis.
Replace VALUES(...) with a single JSON object expanded by jsonb_each_text.
The 28 structurally identical VALUE rows were flagged as 60 lines / 2 blocks
of duplication by SonarCloud. A JSON literal has no repeating SQL patterns.
Also reverts sonar-project.properties — PR analysis uses target branch config.
Grouped the 28 tool→label pairs into per-category dicts with .update()
calls. This eliminates the structural similarity with the SQL JSON literal
that SonarCloud CPD detected as 60 lines / 2 blocks of duplication.
Extracted shared constants and helpers into tool/utils.ts:
- TOOLS_REQUIRING_KB_SELECTION, TOOLS_REQUIRING_EMBEDDING,
  TOOLS_REQUIRING_IMAGE_UNDERSTANDING, TOOLS_REQUIRING_VIDEO_UNDERSTANDING
- getToolKbType(), getToolLabels()

These were duplicated verbatim between ToolManagement.tsx (24 lines)
and SelectToolsDialog.tsx (36 lines) for 60 total duplicated lines.
@MoeexT MoeexT changed the title Feature/moeext/tool label feat: add tool label Jun 29, 2026
@Dallas98 Dallas98 merged commit b165772 into develop Jun 30, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants