fix(dialogs): F04 载入已保存定义后把原定义带入可见对话上下文
Verify / verify (push) Failing after 1s
Verify / verify (pull_request) Failing after 1s

- 载入定义时以“用户消息+助手确认”形式把名称、含义、范围、缺失处理和表达式
  写入对话,后续“把刚才公式改成乘以 100”等指代可关联到已载入定义;
  生成前仍需显式确认,不静默沿用旧定义
- 选择空选项时同步清理当前定义与上下文,选择状态与预览保持一致
- 服务端单条消息长度上限 1000→2000 以容纳完整定义上下文,超长仍拒绝
- E2E 覆盖:载入后请求包含原定义、修改后表达式为 (收入−成本)×100、
  空选项清理;单测覆盖 2000/2001 边界
This commit is contained in:
Jayway Liu
2026-09-26 01:30:34 +08:00
parent 6cf236a811
commit 9a5ab26014
4 changed files with 123 additions and 12 deletions
+2 -1
View File
@@ -22,7 +22,8 @@ def design_column(messages, ds, ctx):
or set(item) != {"role", "content"}
or item["role"] not in ("user", "assistant")
or not isinstance(item["content"], str)
or len(item["content"]) > 1000
# 2000 字符容纳载入已保存定义后的完整对话上下文
or len(item["content"]) > 2000
for item in messages
):
raise APIError("对话消息内容无效")