fix(feedback): sources_json 落库前条数封顶 + 逐条收缩,防超 TEXT 上限整条反馈 500 丢失 - #10
Open
leaderwm wants to merge 1 commit into
Open
fix(feedback): sources_json 落库前条数封顶 + 逐条收缩,防超 TEXT 上限整条反馈 500 丢失#10leaderwm wants to merge 1 commit into
leaderwm wants to merge 1 commit into
Conversation
sources 列表(List[dict])原无条数/长度上限,超 MySQL TEXT 64KB 时 sources_json 落库 commit 抛 DataError → 反馈接口 500 且该条反馈丢失; 对齐 reason/retrieval_sources/trace_id 已有的边界截断风格
leaderwm
force-pushed
the
fix/feedback-sources-cap
branch
from
September 4, 2026 10:30
ce63a2a to
b216881
Compare
Contributor
Author
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.
问题
/qa/feedback新增的 sources 列表(List[dict])无条数与单条长度上限;超 MySQL TEXT 64KB 时sources_json落库 commit 抛 DataError → 反馈接口 500 且该条反馈整体丢失。改动
record_feedback内对齐 reason/retrieval_sources/trace_id 已有的边界截断风格:条数封顶 50 条,序列化超 60KB 时逐条收缩直到可落库(保证sources_json恒为合法 JSON,读路径_parse_sources不会收到残缺串)。新增tests/test_feedback_sources_cap.py2 例(超限截断 + 正常数据不受影响)。验证
python -m pytest tests/ -q --ignore=tests/test_api.py -m "not integration":828 passed(3 个失败为 main 上已存在的 test_batch3_infra openai SDK 环境差异,与本 PR 无关,已在未改动代码上复现确认)python scripts/validate_golden.py通过