Skip to content

Conversation

@wang316902972
Copy link

@wang316902972 wang316902972 commented Jan 19, 2026

Pull Request

Choose the Right Template

For better organization and review process, please use the appropriate specialized template:


Description

Summary of changes:
Provide a clear and concise description of what this PR does.

Related issue(s):
Fixes #(issue number) or Closes #(issue number)

Motivation and context:
Why is this change required? What problem does it solve?

Type of Change

Please mark the relevant option(s):

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or improvement
  • 🔨 Build/CI changes
  • 🎨 Code style/formatting changes

Changes Made

Files modified:

  • file1.py - Description of changes
  • file2.py - Description of changes

Key changes:

  • Change 1: Description
  • Change 2: Description
  • Change 3: Description

Testing Performed

Manual testing completed:

  • CLI functionality tested
  • API endpoints tested (if applicable)
  • MCP service tested (if applicable)
  • Error handling tested
  • Edge cases tested

Test commands used:

# List the specific commands you used to test
uv run python main.py
# Add other test commands here

Test scenarios covered:

  1. Scenario 1: Description and result
  2. Scenario 2: Description and result
  3. Scenario 3: Description and result

Sample input/output:

Input: "Your test input here"
Output: "Expected output here"

Environment Tested

  • Python version: [e.g., 3.10.5]
  • Operating System: [e.g., Windows 11, macOS 13.0, Ubuntu 22.04]
  • Package manager: [e.g., uv, pip]
  • LLM Provider: [e.g., OpenAI, Anthropic]

Breaking Changes

Are there any breaking changes?

  • No breaking changes
  • Yes, breaking changes (describe below)

If yes, describe the breaking changes:

  • Change 1: What breaks and how to migrate
  • Change 2: What breaks and how to migrate

Documentation

  • Code comments added/updated
  • README.md updated (if needed)
  • CONTRIBUTING.md updated (if needed)
  • API documentation updated (if applicable)
  • No documentation changes needed

Dependencies

New dependencies added:

  • No new dependencies
  • New dependencies added (list below)

If new dependencies were added:

  • dependency-name==version - Reason for adding

Performance Impact

  • No performance impact
  • Performance improvement
  • Potential performance regression (explain below)

Performance notes:
Describe any performance considerations or measurements.

Security Considerations

  • No security implications
  • Security improvements
  • Potential security concerns (explain below)

Security notes:
Describe any security-related changes or considerations.

Reviewer Checklist

For reviewers to complete:

Code Quality:

  • Code follows project style guidelines
  • Code is well-documented and readable
  • Error handling is appropriate
  • No obvious bugs or issues

Functionality:

  • Changes work as described
  • No regressions in existing functionality
  • Edge cases are handled appropriately
  • Integration points work correctly

Testing:

  • Manual testing is adequate
  • Test scenarios cover the changes
  • Error conditions are tested
  • Performance is acceptable

Documentation:

  • Code is properly documented
  • User-facing documentation is updated
  • Breaking changes are clearly documented

Additional Notes

Anything else reviewers should know:
Add any additional context, concerns, or notes for reviewers.

Follow-up tasks:
List any tasks that should be done after this PR is merged.


Checklist for submitter:

  • I have tested these changes thoroughly
  • I have updated documentation as needed
  • I have followed the project's coding standards
  • I have checked for any breaking changes
  • I have linked related issues
  • I am ready for code review

wang316902972 and others added 5 commits January 16, 2026 22:33
修复预制件搜索功能:添加智能关键词提取和多关键词回退搜索

问题:
- LLM 传递完整句子(如"视频处理、格式转换、视频编辑")
- LocalPrefabSearcher 使用简单子字符串匹配无法匹配完整句子
- 导致用户查询返回 0 个预制件

解决方案:
- 添加 _extract_keywords_from_query() 函数处理中文和英文标点
- 修改 _execute_search_prefabs() 实现多关键词回退搜索机制
- 支持中文逗号(,)、顿号(、)等标点符号
- 添加结果去重逻辑(基于 prefab ID)
- 添加调试日志便于故障排查

测试验证:
✅ "视频处理、格式转换、视频编辑" → 成功找到 1 个预制件
✅ "文件处理,支持pdf和word文档" → 成功找到 1 个预制件
✅ "视频处理、格式转换" → 成功找到 1 个预制件
✅ 简单关键词查询(如"视频")仍然正常工作

同时初始化 OpenSpec 工作流:
- 添加 openspec/project.md 项目上下文文档
- 创建 fix-prefab-search 变更提案
- 包含完整的 spec deltas、tasks.md 和 design.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
归档预制件搜索修复变更到 OpenSpec archive

- 移动 changes/fix-prefab-search/ → changes/archive/2026-01-17-fix-prefab-search/
- 保留完整的 proposal.md、tasks.md、design.md 和 spec deltas
- 使用 --skip-specs 跳过 specs/ 更新(bug 修复不需要)
- 任务完成度:13/15 (87%)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…search

This commit resolves critical issues with prefab vector search and adds
support for Chinese text queries.

## Vector Search Fixes
- Change request parameter from "query" to "question" to match API
- Add "businesstype" parameter for proper index isolation
- Adapt response parsing for vector service format
- Implement 4-layer JSON extraction strategy for chunked responses
- Fix bug where only first prefab was extracted from chunks
- Add field mapping for "name" → "summary"

## Local Search Enhancements
- Add Chinese substring extraction (2-4 characters) for continuous text
- Implement smart keyword splitting for long queries without spaces
- Improve matching for technical terms and compound keywords
- Support multi-word queries like "反作弊 归因分析"

## Index Building Script
- Refactor to use /add endpoint instead of deprecated APIs
- Fix chunk_size parameter (5000 → 2000) to meet service limits
- Add proper delimiter >>>PREFAB<<< for prefab separation

## New Prefab
- Add anti-cheat attribution analyzer prefab
- Supports multi-dimensional query engine, correlation analysis,
  AI diagnosis, and customizable data export

## Testing
- Verified with short queries: "反作弊归因分析" ✅
- Verified with long queries (322 chars) ✅
- Verified with English keywords: "fraud detection" ✅
- All query patterns now work correctly

Fixes issues where prefab search returned 0 results due to API
contract mismatches and inadequate Chinese text handling.

Related: #prefab-search-refactor
实现完整的后台管理功能,支持会话管理、实时对话和系统监控。

核心功能:
- MySQL 数据库集成(SQLAlchemy ORM)
- 会话管理(创建、查看、更新、删除)
- 实时聊天界面(SSE 流式响应)
- 系统仪表盘和日志查看
- 配置管理和监控

技术实现:
- 数据库层:DBSession 和 Message 模型,支持连接池和自动重连
- API 层:RESTful API 设计,支持会话 CRUD 操作
- 前端界面:Bootstrap 5 + 原生 JavaScript,响应式设计
- SSE 流处理:Buffer 累积机制,支持跨行 JSON 解析
- 事件处理:修复 event_type 字段匹配,支持所有事件类型

文件变更:
- 新增 gtplanner/admin/ 模块(database.py, routes.py, __init__.py)
- 新增 6 个模板文件(base, dashboard, sessions, chat, logs, settings)
- 新增静态资源(CSS 样式和 JS 交互逻辑)
- 修改 fastapi_main.py(集成 admin 路由和静态文件服务)
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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