Repository navigation
feat: 补全问数意图并保护检索输入长度 - #1458
Merged
Merged
Conversation
ulleo
force-pushed
the
feat/query-completion
branch
from
November 9, 2026 14:04
130423e to
64cb728
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
多轮追问省略、替换或撤销条件时,直接用当前原话检索容易丢失有效意图;长查询还可能被向量模型静默截断。本次在每个问数任务中先补全一次有效意图,再按检索对象准备输入,原始提问与 SQL 生成历史保持原样。
补全过程作为
COMPLETE_QUESTION写入chat_log,保存输入输出、模型、用量、时间、推理内容与回退原因,纳入过程详情和 token 汇总;同轮复用不重复记账。同步五种语言步骤名称,保留工作空间、数据源与高级应用的知识作用域。不修改检索阈值、候选数量、依赖或数据库表结构。Evidence
提交历史已整理为 3 个线性提交(无 merge commit),在临时工作区逐个 rebase 到
main成功;最终文件树与原 PR 完全一致。本次仅整理历史,未重复业务测试。After: 当前提交
64cb7283(文件树与已验证的130423ed完全一致) 的三个相关集成文件共 29 passed,覆盖问题补全、自动选源、HTTP 提问/重新生成、过程详情与用量汇总。测试模拟模型改按 history/current 输入结构识别步骤,保留原行为断言。After: 实际 tokenizer 边界验证 127/128 可编码、129 调用前跳过;受控回归覆盖补全失败及同义词扩展后超限、候选保留。原始集成版本
f0ca2b39的完整 PostgreSQL 集成 144 passed。npm run build通过,五种语言键结构一致;后续仅修改提示词及加载方式。5072919c使用相同默认模型及 11 个合成案例:补全意图、JSON 结构和日志均符合预期;完整 SQL 执行结果 10/11。失败例中补全保留了全部条件,但下游 SQL 将产品值“乙”写成“产品乙”。保留失败结果,不据此宣称语义等价或完整链路全通过。f0ca2b39默认测试 528 passed / 222 skipped / 9 failed;9 项 Excel 上传失败与未修改基线的失败测试 ID 一致。最新提交未重复全量测试;以上历史结果均注明对应版本。Merge Danger
Door: two-way
无 DDL 或存量向量重建;但新增
chat_log.operate = '15',回退不认识该枚举值的旧版本前需处理日志读取兼容性。历史缺失的补全日志不回填。Blast Radius: 问数
所有普通问数任务增加一次模型调用及相应耗时/费用,包括关键词提取关闭时。补全失败回退原问题,向量保护触发后可能扩大合法候选上下文。模型仍可能生成错误 SQL 或未闭合 JSON,现有 SQL 校验继续拒绝无效结果,本次未增加自动修复。